永发信息网

用74LS76怎么实现三进制计数?

答案:2  悬赏:30  手机版
解决时间 2021-02-16 00:06
  • 提问者网友:临风不自傲
  • 2021-02-15 04:50
用74LS76怎么实现三进制计数?
最佳答案
  • 五星知识达人网友:玩世
  • 2021-02-15 05:53
我写的是否是你想要的。
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;

entity cnt_3or7 is
port (
clk: in STD_LOGIC;
k: in STD_LOGIC;
q: out STD_LOGIC_VECTOR (2 downto 0)
);
end cnt_3or7;

architecture cnt_3or7_arch of cnt_3or7 is
signal en:integer range 0 to 1;
signal qq:std_logic_vector(2 downto 0);
begin
process(clk)
variable n:integer range 0 to 2;
begin
if clk'event and clk='1' then
if n=2 then en<=1;
else
n:=n+1;en<=0;
end if;
end if;
end process;

process(clk,k,en)
begin
if en=1 then
if clk'event and clk='1' then
if k='1' then
if qq="111" then
qq<="000";
else
qq<=qq+'1';
end if;
else
if qq="011" then
qq<="000";
else
qq<=qq+'1' ;
end if;
end if;
end if;
end if;
end process;

process(qq)
begin
q<=qq;
end process;

end cnt_3or7_arch;
全部回答
  • 1楼网友:行路难
  • 2021-02-15 07:28
74ls76是双jk触发器,要用2片
要用2片74ls76中的3个jk触发器,接成3级二进制计数器。就是8进制的计数器了。
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯