hourcount.tdf

来自「veriloghdl 交通灯veriloghdl 交通灯veriloghdl 交」· TDF 代码 · 共 32 行

TDF
32
字号
subdesign hourcount
(
 clk		:	input;
 manu		:	input;
 rst		:	input;
 hour[4..0]	:	output;
)
variable
 count[5..0]:dff;
 hourcount[4..0]:dff;
begin
count[].clk=clk;
hourcount[].clk=clk;
if rst then count[].d=0;
			hourcount[].d=0;
elsif count[].q==59 
	then count[].d=0;
	if hourcount[].q==23
		then hourcount[].d=0;
	else hourcount[].d=hourcount[].q+1;
	end if;
else count[].d=count[].q+1;
end if;
if manu
	then if hourcount[].q==23
			then hourcount[].d=0;
		 else hourcount[].d=hourcount[].q+1;
		 end if;
end if;
hour[]=hourcount[];
end;

⌨️ 快捷键说明

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