Дешифратор 3-х разрядный
process(CLK,RESET,D_IN)
begin
if
( RESET = '1')
then
D_OUT <= "00000000";
elsif
( CLK'event and CLK ='1') then
case
D_IN is
when
"000" => D_OUT <= "00000001";
when
"001" => D_OUT <= "00000010";
when
"010" => D_OUT <= "00000100";
when
"011" => D_OUT <= "00001000";
when
"100" => D_OUT <= "00010000";
when
"101" => D_OUT <= "00100000";
when
"110" => D_OUT <= "01000000";
when
"111" => D_OUT <= "10000000";
when
others => NULL;
end
case;
end
if;
end
process;
Мультиплексор 4_1
architecture
Behavioral of m4_1e is
begin
process
(D,E,S)
begin
if
(E=’0’) then
O
<= ’0’;
else
case
S is
when
"00" => O <= D(0);
when
"01" => O <= D(1);
when
"10" => O <= D(2);
when
"11" => O <= D(3);
when
others => NULL;
end
case;
end
if;
end
process;
end
Behavioral;
Счетчик 4-х разр.
architecture
Behavioral of cj4ce is
begin
process
(C, CLR)
begin
if
(CLR = ’1’) then
Q
<= (others => ’0’);
elsif
(C’event and C = ’1’) then
if
(CE = ’1’) then
Q(0)
<= not Q(WIDTH-1);
Q(WIDTH-1
downto 1) <= Q(WIDTH-2 downto 0);
end
if;
end
if;
end
process;
end
Behavioral;