eda问题带使能端的2位十进制计数器vhdl语言程序

如题所述

你好哦。
有幸看到你的问题。
但是又很遗憾到现在还没有人回答你的问题。也可能你现在已经在别的地方找到了答案,那就得恭喜你啦。
可能是你问的问题有些专业了,没人会。或者别人没有遇到或者接触过你的问题,所以帮不了你。建议你去问题的相关论坛去求助,那里的人通常比较多,也比较热心,可能能快点帮你解决问题。
祝你好运~!
希望我的回答也能够帮到你!
谢谢
温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-06-29
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_ensigned.all;
entity jishu is
port(en,reset,clk:in std_logic;//en使能,reset复位
da1,da2:out std_logic_vector(3 downto 0));
end entity jishu;
architecture art of jishu is
signal s1,s2:std_logic_vector(3 downto 0);
begin
process(reset,clk)is
begin
if reset='1' then
s1<=(others=>'0');
s2<=(others=>'0');
elsif clk'event then clk='1' then
if en='1' then
if s1="1001" then
if s2="1001"then
s1<="0000";s2<="0000";
else s2<=s2+1;s1<="0000";
end if;
else
s1<=s1+1;
end if;
end if;
end process;
da1<=s1;//十进制低位
da2<=s2; //十进制高位
da1,da2 这是用二进制表示的,还要将这转换成对应数字代码.用CASE语句就可搞定