eda数字钟的设计有些问题
eda吧
全部回复
仅看楼主
level 1
523431602 楼主
process(clk)
variable sout1: std_logic_vector(3 downto 0);
variable mout1: std_logic_vector(3 downto 0);
variable hout1: std_logic_vector(3 downto 0);
variable sout2: std_logic_vector(3 downto 0);
variable mout2: std_logic_vector(3 downto 0);
variable hout2: std_logic_vector(3 downto 0);
begin
if clk'event and clk='1' then
if en='0' then
sout1:=sout1+1;
end if;
end if;
if conv_integer(sout1)=10 and en='0' then
sout2:=sout2+1;
sout1:=(others=>'0');
end if;
if conv_integer(sout2)=6 and en='0' then
mout1:=mout1+1;
sout2:=(others=>'0');
end if;
if conv_integer(mout1)=10 and en='0' then
mout2:=mout2+1;
mout1:=(others=>'0');
end if;
if conv_integer(mout2)=6 and en='0' then
hout1:=hout1+1;
mout2:=(others=>'0');
end if;
if conv_integer(hout1)=4 and conv_integer(hout2)=2 and en='0' then
hout1:=(others=>'0');
hout2:=(others=>'0');
end if;
if conv_integer(hout1)=10 and en='0' then
hout2:=hout2+1;
hout1:=(others=>'0');
end if;
dou1<=hout2&hout1&"0000"&mout2&mout1&"0000"&sout2&sout1;
end process;
这是其中一个进程,en没有问题 是零,用了3个程序包,1164,unsigned,arith
实际效果:秒钟部分没有任何问题,但是分钟部分会出现先加3再加1,再加3再加1的进位方式,弄了很久了,一直不知道原因。
2014年05月29日 11点05分 1
level 1
大神在吗,我有些数字钟的问题求请教
2014年07月02日 07点07分 2
1