hour.v

来自「基于vriloge的数字钟具有调时、分、秒和定时报警功能」· Verilog 代码 · 共 14 行

V
14
字号
module hour(ckhour,Rest,sethour,A,B);
input ckhour,sethour,Rest;
output[3:0]A,B;
reg[3:0]A,B;
wire code;
assign code=ckhour|sethour;
always @(posedge  code or negedge Rest )begin
if(!Rest)begin A=0;B=0;end
else begin A=A+1;end
if(A==9)begin A=0;B=B+1;end
else if(A==4&&B==2)begin A=0;B=0;end
end
endmodule

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?