style: ✨ counter
This commit is contained in:
parent
13b2826b20
commit
c6bdc199f3
3 changed files with 33 additions and 0 deletions
14
01-counter/counter.v
Normal file
14
01-counter/counter.v
Normal file
|
@ -0,0 +1,14 @@
|
|||
module counter(out, clk, reset);
|
||||
parameter WIDTH = 8;
|
||||
output [WIDTH-1:0] out;
|
||||
input clk, reset;
|
||||
reg [WIDTH-1: 0] out;
|
||||
wire clk, reset;
|
||||
|
||||
always @(posedge clk or posedge reset) begin
|
||||
if (reset)
|
||||
out <= 0;
|
||||
else
|
||||
out <= out + 1;
|
||||
end
|
||||
endmodule
|
Loading…
Add table
Add a link
Reference in a new issue