--第一个底层设计实体 74HC161
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
entity v74x161 is
port(
clk,clr_l,ld_l,enp,ent:in std_logic;
d:in unsigned(3 downto 0);
q:out unsigned(3 downto 0);
rco:buffer std_logic);
end v74x161;
architecture v74x161_arch of v74x161 is
signal iq:unsigned(3 downto 0);
begin
process(clk,ent,iq)
begin
if clr_l='0' then iq<=(others=>'0');--异步清零
elsif clk'event and clk='1' then
if ld_l='0' then iq <= d;--置数
elsif rco='1' then iq<=(others=>'0');
elsif(ent and enp)='1' then iq<=iq+1;--计数
end if;
end if;
if (iq=15) and (ent='1') then rco<='1';
else rco<='0';
end if;
q<=iq;
&n
1. 用4位二进制计数器74HC161实现一个六十七进制计数器。 用VHDL层次结构设计方法设计程序并仿真,底层器件是74HC161和逻辑门。...
最新推荐文章于 2023-02-08 14:16:45 发布