Combinational Circuit2
Combinational Circuit2
Write VHDL code & design Circuit for the given equation “res = ( (not(A and B)) and (not(A or
B)) ) and C ”
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity combi2_entity is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
C : in STD_LOGIC;
O1 : inout STD_LOGIC;
O2 : inout STD_LOGIC;
end combi2_entity;
begin
O1 <= A and B;
O2 <= A or B;
end Behavioral;
-- Module Name: /home/ise/comb2/comb2_tb.vhd
--------------------------------------------------------------------------------
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY comb2_tb IS
END comb2_tb;
COMPONENT combi2_entity
PORT(
A : IN std_logic;
B : IN std_logic;
C : IN std_logic;
O1 : INOUT std_logic;
O2 : INOUT std_logic;
);
END COMPONENT;
--Inputs
signal O1 : std_logic;
signal O2 : std_logic;
--Outputs
BEGIN
A => A,
B => B,
C => C,
O1 => O1,
O2 => O2,
);
-- Stimulus process
stim_proc: process
begin
A <= '0';
B <= '0';
C <= '0';
wait for 1 ps;
A <= '0';
B <= '0';
C <= '1';
A <= '0';
B <= '1';
C <= '0';
A <= '0';
B <= '1';
C <= '1';
A <= '1';
B <= '0';
C <= '0';
A <= '1';
B <= '0';
C <= '1';
A <= '1';
B <= '1';
C <= '0';
A <= '1';
B <= '1';
C <= '1';
end process;
END;