RING COUNTER USING D FLIP FLOP
D FLIP FLOP
module df1(q,d,c);
output q;
input d,c;
reg q;
initial
q=1'b1;
always@(posedge c)
q=d;
endmodule
RING COUNTER
module ringcounter(q,clk);
inout [3:0]q;
input clk;
df1 f1(q[0],q[3],clk);
df2 f2(q[1],q[0],clk);
df2 f3(q[2],q[1],clk);
df2 f4(q[3],q[2],clk);
endmodule
No comments:
Post a Comment