Вот и пришел момент писать фигню, лишь бы запостить эту ссылочку. А все из-за того что сам себе установил правило не печатать до 10 сло посты. Ну вот и все.
entity coder is
port(sel:in std_logic_vector(3 downto 0);
mux_out: out std_logic_vector(2 downto 0));
end ;
architecture coder of coder is
begin
process(sel)
begin
if (sel(3) = '1') then mux_out <= "100";
else
if (sel(2) = '1') then mux_out <= "011";
else
if (sel(1) = '1') then mux_out <= "010";
else
if (sel(0) = '1') then mux_out <= "001";
else
mux_out <= "000";
end if;
end if;
end if;
end if;
Комментарии
Лаба 1
library IEEE;
use IEEE.std_logic_1164.all;
entity coder is
port(sel:in std_logic_vector(3 downto 0);
mux_out: out std_logic_vector(2 downto 0));
end ;
architecture coder of coder is
begin
process(sel)
begin
if (sel(3) = '1') then mux_out <= "100";
else
if (sel(2) = '1') then mux_out <= "011";
else
if (sel(1) = '1') then mux_out <= "010";
else
if (sel(0) = '1') then mux_out <= "001";
else
mux_out <= "000";
end if;
end if;
end if;
end if;
end process ;
end ;
D-Trigger
library IEEE;
use IEEE.std_logic_1164.all;
entity laba1Dtrigger is
port(
CLK : in STD_LOGIC;
DIN : in STD_LOGIC;
DOUT : out STD_LOGIC
);
end laba1Dtrigger;
architecture laba1Dtrigger of laba1Dtrigger is
begin
process (CLK)
-- declarations
begin
if ((CLK'event) and (CLK = '1')) then
DOUT <= DIN;
end if;
end process;
end laba1Dtrigger;