锐单电子商城 , 一站式电子元器件采购平台!
  • 电话:400-990-0325

74LS161十进制计数器的VHDL程序

时间:2024-05-17 10:07:11

先编辑一个74LS161十进制的vhdl程序:
Library ieee;
Use ieee.std_logic_1164.all;
Use ieee.std_logic_unsigned.all;
Entity court161 is
port( clk,C,CTP,LD,CR:in std_logic;
D3,D2,D1,D0: in std_logic;
Q:out std_logic_(3 O 0);
Co: out std_logic);
end court161;
architecture court of court161 is
signal a,b,c: std_logic ;
signal D,CQI:std_logic_vector(3 downto 0);
begin
D<=D3&D2&D1&D0;
a<=CTT and CTP;
b<=(not (CQI(3) and CQI(0)))and LD;
process(clk,CTT,CTP,LD,CR,D3,D2,D1,D0)
begin
if a='1' then
if clk'event and clk='1' then
if b='0' then CQI<=D;
else CQI<=CQI+1;
end if;
end if;
if CQI=9 then c<='1';
else c<='0';
end if;
end if;
if clk'event and clk='1' then Co<=c;
end if;
if CR='0' then CQI<="0000";
end if;
Q<=CQI ;
end process;
end ;


-电子元器件采购网(www.ruidan.com)是本土元器件目录分销商,采用“小批量、现货、样品”销售模式,致力于满足客户多型号、高质量、快速交付的采购需求。 自建高效智能仓储,拥有自营库存超过50,000种,提供一站式正品现货采购、个性化解决方案、选型替代等多元化服务。
锐单商城拥有海量元器件数据手册IC替代型号,打造电子元器件IC百科大全!

相关文章