Professional Documents
Culture Documents
Task: The task is to build a logic circuit that will indicate the number of correctly functioning
generators. If all three generators are working, only the green light is on. If only two generators
are working only the amber light is on. If less than two generators are working only the red light
is on.
Simplified expression: LG = 𝐺1 𝐺2 𝐺3
Amber Light – LA
Truth Table Karnaugh Map
G1 G2 G3 LA
0 0 0 0 G1G2 00 01 11 10
0 0 1 0 G3
0 1 0 0 0 0 0 1 0
0 1 1 1
1 0 0 0 1 0 1 0 1
1 0 1 1
1 1 0 1
1 1 1 0
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity Circuit2 is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
C : in STD_LOGIC;
X : out STD_LOGIC;
Y : out STD_LOGIC;
Z : out STD_LOGIC);
end Circuit2;
begin
end Behavioral;
Schematic circuit from Vivado
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity Circuit2Sim is
-- Port ( );
end Circuit2Sim;
COMPONENT Circuit2
PORT( A, B, C : IN STD_LOGIC;
X, Y, Z : OUT STD_LOGIC);
END COMPONENT;
signal A, B, C : std_logic;
signal X, Y, Z : std_logic;
begin
process
begin
-- Input: 000
A <= '0'; -- set initial values
B <= '0';
C <= '0';
-- Input: 001
C <= '1';
-- Input: 010
B <= '1';
C <= '0';
-- Input: 011
C <= '1';
-- Input: 100
A <= '1';
B <= '0';
C <= '0';
-- Input: 101
C <= '1';
-- Input: 110
B <= '1';
C <= '0';
WAIT FOR 100 ns; --change again
-- Input: 111
C <= '1';
end Behavioral;
Timing Diagram
Conclusions
The corresponding Boolean equations for even a simple task are not much simplified.
The simulator can be used with test bench code to test the design before programming
the device.