P a g e | 27
D e p a r t m e n t o f E l e c t r o n i c s a n d I n s t r u m e n t a t i o n E n g i n e e r i n g
1.1 3X8 DECODER in DATA FLOW :
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity decoder_3X8_df is
Port ( i : in STD_LOGIC_VECTOR (2 downto 0);
Y : out STD_LOGIC_VECTOR (7 downto 0));
end decoder_3X8_df;
architecture Behavioral of decoder_3X8_df is
begin
Y(0)<= not(i(2))and not(i(1)) and not(i(0)) ;
Y(1)<= not(i(2))and not(i(1)) and i(0) ;
Y(2)<= not(i(2))and i(1) and not(i(0)) ;
Y(3)<= not(i(2))and i(1) and i(0) ;
Y(4)<= i(2)and not(i(1)) and not(i(0)) ;
Y(5)<= i(2)and not(i(1)) and i(0) ;
Y(6)<= i(2)and i(1) and not(i(0)) ;
Y(7)<= i(2)and i(1) and i(0) ;
end Behavioral;
1.2 3X8 DECODER IN STRUCTURAL MODELLING
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity DEC_3X8_BEHAvior is
Port (w,x,y,z ,Ein: in STD_LOGIC;
v: out STD_LOGIC_VECTOR (7 downto 0);
end DEC_3X8_BEHAvior;
architecture Behavioral of DEC_3X8_BEHAvior is
component And_gate_4IP is
port (p,q,r,s : in STD_LOGIC;
t :out STD_LOGIC);
end component;
begin
V1: And_gate_4IP port map((not y),(not x),(not w),Ein,v(0));
V2: And_gate_4IP port map((not y),(not x),w,Ein,v(1));
V3 : And_gate_4IP port map((not y),x,(not w),Ein,v(2));
V4 : And_gate_4IP port map((not y),x,w,Ein,v(3));
V5 : And_gate_4IP port map (y,(not x),(not w),Ein,(v4));
V6 : And_gate_4IP port map (y,(not x),w,Ein,v(5));