divideby6.tdf

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

TDF
27
字号
subdesign divideby6
(
 clk			:	input;
 rst			:	input;
 shihour[3..0]	:	output;
 gehour[3..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;
hour[]=hourcount[];
end;

⌨️ 快捷键说明

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