count (2)
2
module counter(clk,en,rst,read,write); input clk,rst,en; output read,write; always@(posedge clk) begin if(rst) count<=4'd0; else if if(en) count<=count+1'd1; else'count<=4'd0; end endmoulde /**********************************************count**************************** ****/ module counter(clk,en,rst,read,write); input clk,rst,en; output read,write; reg[1:0] count; always@(posedge clk) begin if(rst) count<=4'd0; else if(en==1) count <= count+1'd1; else if(en==0) count <= count+1'd1; else count<=4'd0; end endmodule
-
Upload
navneeth-gnl -
Category
Documents
-
view
217 -
download
0
Transcript of count (2)
7/21/2019 count (2)
http://slidepdf.com/reader/full/count-2 1/1
module counter(clk,en,rst,read,write);
input clk,rst,en;
output read,write;
always@(posedge clk)beginif(rst)count<=4'd0;else if if(en)count<=count+1'd1;else'count<=4'd0;endendmoulde
/**********************************************count********************************/module counter(clk,en,rst,read,write);
input clk,rst,en;
output read,write;
reg[1:0] count;
always@(posedge clk)beginif(rst)count<=4'd0;else if(en==1)count <= count+1'd1;else if(en==0)count <= count+1'd1;elsecount<=4'd0;
endendmodule