Demux VHDL Code Using Behavioural Modeling
Demux VHDL Code Using Behavioural Modeling
Library declaration
library IEEE;
Std_logic_1164; package for std_logic (predefined data type).
use IEEE.STD_LOGIC_1164.ALL;
------------------------------------------------------------------------
entity dmux_1 is
Port ( i: in std_logic;
sel: in std_logic_vector (1 downto 0);
y: out std_logic_vector (3 downto 0);
end dmux_1;
----------------------------------------------------------------------architecture Behavioral_dmux of dmux_1 is
begin
-------------------------------------------------------process (sel, i)
begin
case sel is
when "00" =>
y(0)<=i;y(1)<='0';y(2)<='0';y(3)<='0';
when "01" =>
y(0)<='0';y(1)<=i;y(2)<='0';y(3)<='0';
when "10" =>
y(0)<='0';y(1)<='0';y(2)<=i;y(3)<='0';
when others =>
y(0)<='0';y(1)<='0';y(2)<='0';y(3)<=i;
end case;
end process;
------------------------------------------------------end Behavioral_dmux;
RTL VIEW:-
INFOOP2R.WIX.COM/OP2R
Entity declaration.
i :- input port bit.
Sel: select lines for selecting a particular
input in mux.
y: - output port bits.