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

ASYNCHRONOUS COUNTER UP

module asyncnt4(rst,clk,en,q);
input rst,clk,en;
output [3:0]q;
reg [3:0]q;
always @ (posedge clk, rst,posedge en)
begin
if(rst==1)
q<=4'b0000;
else if(en==1)
q<=q+1;
else
q<=4'b0000;
end
endmodule

You might also like