[SOLVED] 4 bit ripple counter using four D flip flops

Status
Not open for further replies.

naavid

Newbie level 6
Joined
Dec 22, 2012
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,348
4 bit ripple counter using four D flip flops without using other components. Can you please help.........
 

Config each DFF as a divide by 2 - i.e. connect Q/ to D and input clock to CLK.
Now connect them in series - Q1 - CLK2, Q2-CLK3, .... and so on.

And there you are !! A 4 bit binary counter
 

Dear Rohit, Really thanks. It works.............................
 

Config each DFF as a divide by 2 - i.e. connect Q/ to D and input clock to CLK.
Now connect them in series - Q1 - CLK2, Q2-CLK3, .... and so on.

And there you are !! A 4 bit binary counter

Hi Rohit,
This way we will get asynchronous counter. Is it possible to make synchronous one using dff alone?
 

module counterdff(clk,d0,d1,d2,q
);
input clk,d0,d1,d2;
output q;
reg q0,q1;
reg q;
always@(posedge clk)
begin
if(clk==1)
q0<=d0;

if(q0<=1)
q1<=d1;

if(q1<=1)
q<=d2;


end

endmodule
i done it by same maanner bt my code is nt synthesizing...plz tell me error
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…