用VHDL语言编写十进制计数译码显示电路,在一个程序中用块形式编写,高手给答案不
答案:2 悬赏:70 手机版
解决时间 2021-11-27 11:37
- 提问者网友:最美的风景
- 2021-11-26 13:44
用VHDL语言编写十进制计数译码显示电路,在一个程序中用块形式编写,高手给答案不
最佳答案
- 五星知识达人网友:低音帝王
- 2021-11-26 15:06
process(data_in,add_pul,reg_count)--在输入数据的基础上加1
begin
if falling_edge(add_pul) then--下降沿加数
if data_in(3 downto 0) >= "1001" then
reg_count(3 downto 0) <= "0000";
if data_in(7 downto 4) >= "1001" then
reg_count(7 downto 4) <= "0000";
else
reg_count(7 downto 4) <= data_in(7 downto 4)+1;
end if;
else
reg_count(3 downto 0) <= data_in(3 downto 0)+1;
reg_count(7 downto 4) <= data_in(7 downto 4);
end if;
end if;
if rising_edge(add_pul) then--上升沿赋值
addbcd <= reg_count;
end if;
end process;
begin
if falling_edge(add_pul) then--下降沿加数
if data_in(3 downto 0) >= "1001" then
reg_count(3 downto 0) <= "0000";
if data_in(7 downto 4) >= "1001" then
reg_count(7 downto 4) <= "0000";
else
reg_count(7 downto 4) <= data_in(7 downto 4)+1;
end if;
else
reg_count(3 downto 0) <= data_in(3 downto 0)+1;
reg_count(7 downto 4) <= data_in(7 downto 4);
end if;
end if;
if rising_edge(add_pul) then--上升沿赋值
addbcd <= reg_count;
end if;
end process;
全部回答
- 1楼网友:玩世
- 2021-11-26 16:36
library ieee; use ieee.std_logic_1164.all; entity smg_16 is port( a:in std_logic_vector(3 downto 0); q:out std_logic_vector(6 downto 0) ); end smg_16; architecture bhv of smg_16 is begin process(a) begin case a is when "0000"=> q<="0
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯