Final
Final
HALF SUBTRACTOR
TRUTH TABLE
2 to 4 DECODER
TRUTH TABLE
AND GATE
entity mux8to1 is
Port ( s0 : in std_logic;
s1 : in std_logic;
s2 : in std_logic;
s3 : in std_logic;
s4 : in std_logic;
s5 : in std_logic;
s6 : in std_logic;
s7 : in std_logic;
a : in std_logic;
b : in std_logic;
c : in std_logic;
o : out std_logic);
end mux8to1;
begin
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity mux8to1 is
Port ( s0 : in std_logic;
s1 : in std_logic;
s2 : in std_logic;
s3 : in std_logic;
s4 : in std_logic;
s5 : in std_logic;
s6 : in std_logic;
s7 : in std_logic;
a : in std_logic;
b : in std_logic;
c : in std_logic;
o : out std_logic);
end mux8to1;
begin
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity mux4to1 is
Port ( s0 : in std_logic;
s1 : in std_logic;
s2 : in std_logic;
s3 : in std_logic;
a,b: in std_logic;
o1 : out std_logic);
end mux4to1;
architecture Behavioral of mux4to1 is
component or2 is
port(p,q,r,t:in std_logic ;s:out std_logic);
end component ;
component and2 is
port(p,q,r:in std_logic ;s:out std_logic);
end component ;
component not1 is
port(p:in std_logic ;s:out std_logic);
end component ;
signal d0,d1,d2,d3,ad,bd:std_logic;
begin
x1: not1 port map (a,ad);
x2: not1 port map (b,bd);
x3: and2 port map (ad,bd,s0,d0);
x4: and2 port map (ad,b,s1,d1);
x5: and2 port map (a,bd,s2,d2);
x6: and2 port map (a,b,s3,d3);
x7: or2 port map (d0,d1,d2,d3,o1);
end Behavioral;