This repository has been archived on 2024-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
justhomework/Quartus/v2/jyh_4490_2_1.v
2022-03-30 18:15:31 +08:00

21 lines
No EOL
220 B
Verilog

//计数器模块
module jyh_4490_2_1(clk,en,Q);
input clk,en;
output reg[2:0] Q;
always@(posedge clk)
begin
if(en == 1'b1)
begin
if(Q<3'd6)
Q <= Q + 3'b1;
else
Q <= 0;
end
else
Q<=0;
end
endmodule