0
하드웨어 설명 언어 이론 및 VHDL을 처음 사용했습니다. VHDL로 2421 카운터를 디자인해야합니다. 필자는 T 플립 플롭을 사용하여 동기식 바이너리 카운터를 구축하고 프리셋을 활성화하고 조건부로 지워서 마지막 2 개의 원하는 카운트 인 8과 9를 생성하도록 수정했습니다. 파형 시뮬레이션을 시도하면 클럭 입력이 무시됩니다. 문제가 무엇인지 알 수 없습니다. 여기VHDL에서 파형 시뮬레이션 중에 클럭 입력이 무시됩니까?
library ieee;
use ieee.std_logic_1164.all;
entity count2421 is
port(clock:in std_logic;qq:buffer std_logic_vector(3 downto 0));
end count2421;
architecture arch of count2421 is
component t_ff is
port(clock,clear,preset,t:in std_logic;q:buffer std_logic);
end component;
signal p1,p2,p,t,u,a,b:std_logic;
begin
t<='1';
u<='0';
qq(0)<='0';
qq(1)<='0';
qq(2)<='0';
qq(3)<='0';
process(clock) begin
if(clock'event and clock='0') then
p1<=(not qq(3)) and qq(2) and qq(1) and qq(0);
p2<=qq(3) and qq(2) and qq(1) and (not qq(0));
p<=p1 or p2;
a<=qq(3) and qq(2);
b<=a and qq(1);
end if;
end process;
stage0:t_ff port map(clock,u,p,t,qq(0));
stage1:t_ff port map(clock,u,p,qq(0),qq(1));
stage2:t_ff port map(clock,u,p,a,qq(2));
stage3:t_ff port map(clock,p1,p2,b,qq(3));
end arch;
T 플립 플롭의 코드는 다음과 같습니다 : 여기에 코드입니다
library ieee;
use ieee.std_logic_1164.all;
entity t_ff is
port(clock,clear,preset,t:in std_logic;q:buffer std_logic);
end t_ff;
architecture arch of t_ff is
signal temp:std_logic;
begin
temp<=q;
process(clock)
begin
if(clock'event and clock='0') then
if(clear='1') then
q<='0';
elsif(preset='1') then
q<='1';
elsif(t='1') then
q<=not q;
end if;
end if;
end process;
end arch;
어떻게 시계 입력을 생성합니까? –