strangesiva
Newbie level 6
- Joined
- Feb 12, 2012
- Messages
- 14
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,374
Hi ,
the below code uses dff for mod3 counter design . rst generated (using expression1) does not work,where as rst generated (using expression 2) works . what is the reason ?
the below code uses dff for mod3 counter design . rst generated (using expression1) does not work,where as rst generated (using expression 2) works . what is the reason ?
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 module dff(output reg q,output qn,input d,clk,reset); always @(posedge clk or negedge reset) begin if(!reset) q<=1'b0; else q<=d; end assign qn=~q; endmodule module mod3(output clk_3,input clk,reset); wire q0,q1,qn0,qn1,rst,temp; dff dff0(q0,qn0,qn0,clk,rst); dff dff1(q1,qn1,qn1,qn0,rst); assign clk_3=q1; //assign rst=reset & ~(q0 & q1); //this expression1 does not work assign rst=reset & temp; //this expression2 works assign temp=~(q0 & q1); endmodule
Last edited by a moderator: