3.4 Logic Gates
3.4 Logic Gates
L
O
G
I
C
G
A
T
E
Logic Gates
S
Hardware & Software
In your exam you are expected to understand and
L
O
define the functions of logic gates and draw truth
G
I
tables from given circuits and vice versa
C
G
A
T
E
S
Hardware & Software
What are Logic Gates?
L • Basic building blocks of any digital NOT Gate XOR Gate
O system
G
I • It is a circuit having one or more
C inputs and only one output
AND Gate NAND Gate
G
A • The combination of the gates
T create logic circuits that will allow
E a specific function to be carried
S out.
OR Gate
• There are 6 gates that you need to NOR Gate
know about for your exam. These
are:
NOT, AND, OR, NAND, NOR, XOR
Hardware & Software
NOT Gate
L The simplest gate is the NOT gate,
O also known as an inverter. It accepts
G a single input and outputs the
I opposite value.
C
1 0 1
Shorthand way of writing this is: 0
0 1 1
Y = A OR B (where 'A’ and ‘B’ are the 0
input and ‘Y' is the output) 0 0 0 0
Hardware & Software
XOR Gate
L The XOR gate takes two inputs and
O produces a single output
G
I If both inputs are 1 (true) then the
C output is 0 (false)
1 1
G 0 1
A If both inputs are 0 (false) then the 1 0
T output will be false
E
S
0 A B Y
If either of the two inputs are 1 (true) 1
then the output is true 1 1 1 0
1 0 1
Shorthand way of writing this is: 0
0 1 1
Y = A XOR B (where 'A’ and ‘B’ are the 0
input and ‘Y' is the output) 0 0 0 0
Hardware & Software
NAND Gate
The NAND gate takes two inputs and produces a
L single output
O
G
Combination of an AND & NOT (inverter) gate, so
I the output is the opposite of an AND gate
C
1 1
If both inputs are 1 (true) then the output is 0
G (false) 0 1
A 1 0
T
If both inputs are 0 (false) then the output will be 1
E
S
(true) 0 A B Y
1
1 1 1 0
If either of the two inputs are 1 (true) then the
output is 1 (true)
1 0 1
0
Shorthand way of writing this is: Y = A 0 1 1
NAND B (where 'A’ and ‘B’ are the input and ‘Y' is
1
the output) 0
0 0 1
Hardware & Software
NOR Gate
The NOR gate takes two inputs and produces a single
L output
O
G
Combination of an OR & NOT (inverter) gate, so the
I output is the opposite of an OR gate
C
1 1
If both inputs are 1 (true) then the output is true
G 0 0
A 1 0
T If either of the two inputs are 1 (true) then the
output is true
E
S
0 A B Y
If both inputs are false then the output will be false
0
1 1 1 0
L Tips
O 1. Label the inputs and outputs on the
G circuit diagram (if they have not
I
been labelled) A Y Z
C
2. Create a table with a column for B
each input and output
G
A
T 3. Label the columns (outputs labelled A B Y = A AND B
in the form of an expression) Z =ZNOT (A AND
= NOT Y B)
E
S 1 1 1 0
4. Place the combinations of different
zeros and ones in the input columns
1 0 0 1
Create and complete the truth table for the system above. [4]
Hardware & Software
Exam questions:
Three switches, A, B and C, each send values of 0 or 1 to a logic circuit. Value X is output from the logic circuit.
L
Output X has a value of 1 depending on the following conditions:
O
G
I Switch A sends value 1 AND Switch B sends value 0
C OR
Switch B sends value 1 AND Switch C sends value 0
G
A Draw a logic circuit to represent the conditions above. [5]
T
E Complete the truth table for the conditions given above. [4]
S
Hardware & Software
Exam questions:
L Draw the logic circuit diagrams from the following expressions: [4]
O • Z = (NOT A) OR (NOT B)
G
• Z = (A AND B) OR (A AND C)
I
C
G
A
T
A
E
S
Z
B
Hardware & Software
Exam questions:
L Draw the logic circuit diagrams from the following expressions: [4]
O • Z = (NOT A) OR (NOT B)
G
• Z = (A AND B) OR (A AND C)
I
C
G
A B
T
E
S A Z
C
Hardware & Software
A system controls the flow of vehicles through a barrier based on three lights, A, B and C.
When a light is red, the signal is zero. When a light is green, the signal is one.
The barrier will open when the output X is one.
The barrier opens if either:
L • light A is red and lights B and C are both green
O or (NOT A AND B AND C)
• light A is green and lights B and C are both red
X = 1 IF (A AND NOT B AND NOT C) OR
G
I Create a logic circuit
C Produce a truth table
A B C Output X A
G
A
T
1 1 1 0 B
E 1 1 0 0 X
S 1 0 1 0
1 0 0 1
0 1 1 1
0 1 0 0
0 0 1 0
0 0 0 0 [4] C [5]
Hardware & Software
A system controls the flow of vehicles through a barrier based on three lights, A, B and C.
When a light is red, the signal is zero. When a light is green, the signal is one.
The barrier will open when the output X is one.
The barrier opens if either:
L • light A is red and lights B and C are both green
O or (NOT A AND B AND C)
• light A is green and lights B and C are both red
X = 1 IF (A AND NOT B AND NOT C) OR
G
I Create a logic circuit
C Produce a truth table 1 1
A B C Output X A
G
A 0 1
T
1 1 1 0 B 1 1
E 1 1 0 0 X
S 1 0 1 0 1
1 0 0 1
0 1 1 1 0
0
0 1 0 0
0 0 1 0 0
0
0 0 0 0 [4] C [5]
Hardware & Software
A system controls the flow of vehicles through a barrier based on three lights, A, B and C.
When a light is red, the signal is zero. When a light is green, the signal is one.
The barrier will open when the output X is one.
The barrier opens if either:
L • light A is red and lights B and C are both green
O or (NOT A AND B AND C)
• light A is green and lights B and C are both red
X = 1 IF (A AND NOT B AND NOT C) OR
G
I Create a logic circuit
C Produce a truth table 0 0
A B C Output X A
G
A 1 0
T
1 1 1 0 B 0 1
E 1 1 0 0 X
S 1 0 1 0 0
1 0 0 1
0 1 1 1 1
1
0 1 0 0
0 0 1 0 1
1
0 0 0 0 [4] C [5]
Hardware & Software
Three switches, A, B and C, each send values of 0 or 1 to a logic circuit. Value X is output from the logic circuit.
Output X has a value of 1 depending on the following conditions:
A B C Output X
G
A 1 1 1 0
T 1 1
0
E 1 1 0 1 B X
S 1 0 1 1
1 0 0 1
0
0 1 0 1 0
0 1 1 0 1
0 0 1 0 C
0 0 0 0
Hardware & Software
Three switches, A, B and C, each send values of 0 or 1 to a logic circuit. Value X is output from the logic circuit.
Output X has a value of 1 depending on the following conditions:
A B C Output X
G
A 1 1 1 0
T 1 1
0
E 1 1 0 1 B X
S 1 0 1 1
1 0 0 1
0
0 1 0 1 1
0 1 1 0 0
0 0 1 0 C
0 0 0 0
Hardware & Software
Three switches, A, B and C, each send values of 0 or 1 to a logic circuit. Value X is output from the logic circuit.
Output X has a value of 1 depending on the following conditions:
A B C Output X
G
A 1 1 1 0
T 0 1
1
E 1 1 0 1 B X
S 1 0 1 1
1 0 0 1
1
0 1 0 1 1
0 1 1 0 0
0 0 1 0 C
0 0 0 0