Professional Documents
Culture Documents
Lab - 4 - приклад виконання
Lab - 4 - приклад виконання
Рисунок 3 – Код
12. Додати до послідовності операцій процесу Pr_А вираз wait for 30 ns.
entity comp is
port(
CLK : in STD_LOGIC;
Ainout : out STD_LOGIC;
Bout : out STD_LOGIC
);
end comp;
Pr_A: process(CLK)
begin
if CLK'event and CLK = '1' then
internal_A <= '1' after 5 ns;
Ainout <= internal_A;
elsif CLK'event and CLK = '0' then
internal_A <= '0' after 5 ns;
Ainout <= internal_A;
end if;
end process Pr_A;
Pr_B: process(internal_A)
begin
if internal_A'event then
Bout <= not internal_A;
end if;
end process Pr_B;
end architecture Behavioral;
Код 2:
library IEEE;
use IEEE.std_logic_1164.all;
entity comp is
port(
Ainout : out STD_LOGIC;
Bout : out STD_LOGIC
);
end comp;
Pr_A: process
begin
wait on CLK;
internal_A <= not CLK after 5 ns;
Ainout <= internal_A;
end process Pr_A;
Pr_B: process
begin
wait until internal_A'event;
Bout <= not internal_A;
end process Pr_B;
end architecture Behavioral;