Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

module asynchcounter(q, clk, t);

output [3:0]q;

input clk;

input t;

tff a(q[0],clk,t);

tff b(q[1],q[0],t);

tff c(q[2],q[1],t);

tff d(q[3],q[2],t);

endmodule

module tff(q, clk, t);

output q;

input clk;

input t;

reg q;

always@(negedge clk)

begin

q=q^t;

end

endmodule

You might also like