Guest
library IEEE;
use IEEE.std_logic_1164.all;
entity SOP_Logic is
port(A : in std_logic_vector(7 down to 0);
B : in std_logic_vector(7 down to 0);
A_gt_B : in std_logic_vector(7 down to 0);
B_gt_A : in std_logic_vector(7 down to 0);
OUT7: out std_logic_vector(7 down to 0)
);
end entity SOP_Logic;
architechcture STRUCTURAL of SOP_Logic is
component NAND_gate2 is
port(X,Y,:in bit; Qut bit);
end component NAND_gate2;
component NAND_gate3 is
port(X,Y,Z:in bit; Qut bit);
end component NAND_gate3;
signal OUT1, OUT2, OUT3, OUT4:bit;
begin
G1: NAND_gate3 port map (X => not A,Y=>B,Z=>not A_gt_B, Q=> OUT3);
G2 : NAND_gate3 port map (X=> not B_gt_A, Y=>A, Z=>not B,Q=>OUT4);
G3: NAND_gate2 port map (X=> OUT3, Y=> not B_gt_A, Q=>OUT1);
G4: NAND_gate2 port map (X=>OUT4, Y=> not A_gt_B, Q=>OUT2);
G5: NAND_gate2 port map (X=>OUT1, Y=>OUT2, Q=>OUT7);
end STRUCTURAL;
use IEEE.std_logic_1164.all;
entity SOP_Logic is
port(A : in std_logic_vector(7 down to 0);
B : in std_logic_vector(7 down to 0);
A_gt_B : in std_logic_vector(7 down to 0);
B_gt_A : in std_logic_vector(7 down to 0);
OUT7: out std_logic_vector(7 down to 0)
);
end entity SOP_Logic;
architechcture STRUCTURAL of SOP_Logic is
component NAND_gate2 is
port(X,Y,:in bit; Qut bit);
end component NAND_gate2;
component NAND_gate3 is
port(X,Y,Z:in bit; Qut bit);
end component NAND_gate3;
signal OUT1, OUT2, OUT3, OUT4:bit;
begin
G1: NAND_gate3 port map (X => not A,Y=>B,Z=>not A_gt_B, Q=> OUT3);
G2 : NAND_gate3 port map (X=> not B_gt_A, Y=>A, Z=>not B,Q=>OUT4);
G3: NAND_gate2 port map (X=> OUT3, Y=> not B_gt_A, Q=>OUT1);
G4: NAND_gate2 port map (X=>OUT4, Y=> not A_gt_B, Q=>OUT2);
G5: NAND_gate2 port map (X=>OUT1, Y=>OUT2, Q=>OUT7);
end STRUCTURAL;