Sop - Form STD - Logic STD - Logic Sop - Form Arch Sop - Form
Sop - Form STD - Logic STD - Logic Sop - Form Arch Sop - Form
Sop - Form STD - Logic STD - Logic Sop - Form Arch Sop - Form
---------------------------------------------------------
-- Design a SOP based boolean equation in VHDL (BEHAVIOURAL)
-- Y = Abar C + Bbar C
---------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
entity sop_form is
port(
A, B, C: in std_logic;
Y: out std_logic
);
end sop_form;
else
Y <= '1';
end if;
end process;
end arch;
---------------------------------------------------------
--TESTBENCH for SOP form
---------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity testbench is
-- empty
end testbench;
architecture tb of testbench is
component sop_form is
Port ( A, B, C : in STD_LOGIC;
Y : out STD_LOGIC);
end component;
signal A, B, C, Y : STD_LOGIC;
begin
process
begin
A <= '0';
B <= '0';
C <= '0';
wait for 1 ns;
A <= '0';
B <= '1';
C <= '0';
wait for 1 ns;
assert (Y = '1') report "PASSED" severity error ;
A <= '1';
B <= '0';
C <= '0';
wait for 1 ns;
A <= '1';
B <= '1';
C <= '0';
wait for 1 ns;
wait;
end process;
end tb;
---------------------------------------------------------
-- Design a SOP based boolean equation in VHDL (DATA FLOW)
-- Y = Abar C + Bbar C
---------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
entity c_dataflow is
port(
A, B, C: in std_logic;
Y: out std_logic
);
end c_dataflow;
begin
not_a <= not A;
not_b <= not B;