VHDL高手进,急!急!急!!!!!

来源:百度知道 编辑:UC知道 时间:2024/05/31 21:45:14
用VHDL语言设计如图所示的的电路。T触发器的真值表如右表所示。要求:
(1)写出正确的VHDL程序。
(2)clk为25Mhz的时钟信号,画出Q0、Q1、Q2的波形。
(3)说明此电路的功能。
如图

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity tff1 is
port(clk: in std_logic;
t:in std_logic;
qout: out std_logic);
end tff1;
architecture one of tff1 is
signal qtemp: std_logic;
begin
process(clk,t)
begin
if(clk'event and clk='1')then
if(t='1') then
qtemp<=not qtemp;
else
qtemp<=qtemp;
end if;
end if;
qout<=qtemp;
end process;
end architecture one;
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY tff3 IS
PORT( clk: IN std_logic;
q : OUT std_logic_vector(0 TO 2));
END tff3;
ARCHITECTURE a OF tff3 IS
COMPONENT tff1
PORT (clk,t:IN std_logic;
qout:OUT std_logic);
END COMPONENT ;
SIGNAL x:std_logic_vector(0 TO 3);
BE