0% found this document useful (0 votes)
37 views25 pages

3.4 Logic Gates

Uploaded by

gumusb732
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views25 pages

3.4 Logic Gates

Uploaded by

gumusb732
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Hardware & Software

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

If the input is 1 (True) then the 1 0 0 1


G
A output is 0 (False).
T
E
S If the input is 0 (False) then the
output is 1 (Logic True)
A Y
Shorthand way of writing this is: 1 0
Y = NOT A (where 'A' is the input
and ‘Y' is the output).
0 1
Hardware & Software
AND Gate
L The AND gate takes two inputs and
O produces a single output
G
I If both inputs are 1 (true) then the
C output is true
1 1
G 1 0
A If either of the two inputs are 0 (false) 1 0
T then the output is false
E (If both inputs are false then the output will
S be false)
0 A B Y
0
1 1 1 1
Shorthand way of writing this is: 1 0 0
Y = A AND B (where 'A’ and ‘B’ are the 0
input and ‘Y' is the output) 0 1 0
0
0
0 0 0
Hardware & Software
OR Gate
L The OR gate takes two inputs and
O produces a single output
G
I If both inputs are 1 (true) then the
C output is true
1 1
G 1 1
A If either of the two inputs are 1 (true) 1 0
T then the output is true
E
S
0 A B Y
If both inputs are false then the output 1
will be false 1 1 1 1

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

Shorthand way of writing this is: Y = A OR 1 0 0


B (where 'A’ and ‘B’ are the input and ‘Y' is the 0
output) 0 1 0
1
0 0 0 1
Hardware & Software
Create a truth table for the given logic circuit

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

5. Workout the outputs for each 0 1 0 1


output column in order
0 0 0 1
Hardware & Software
Create a truth table for the given logic circuit
A Y
L Tips Z
B
O 1. Label the inputs and outputs on the
G circuit diagram (if they have not
been labelled) C
I
C A B C Y = A AND B Z = (A AND B)
2. Create a table with a column for
each input and output
OR C
G
1 1 1 1 1
A
T 3. Label the columns (outputs labelled 1 1 0 1 1
in the form of an expression)
E 1 0 1 0 1
S
4. Place the combinations of different 1 0 0 0 0
zeros and ones in the input columns
0 1 1 0 1
0 1 0 0 0
5. Workout the outputs for each
output column in order 0 0 1 0 1
0 0 0 0 0
Hardware & Software
Draw a logic circuit for the logic statement: Z = NOT (A AND B)

L Tips 1. Start with the AND gate as


O 1. Always do the brackets first! it is in brackets
G
I
C
4. Add the output
Z = NOT (A AND B)
G 2. Ensure that you add the
A 3. Draw the NOT gate inputs
T
E
S
A
Z
B
Hardware & Software
Draw a logic circuit for the logic statement: Z = NOT ((A AND B) OR NOT (C AND D))

L Tips 1. Start with the AND gate


5. Add the NOT gate
O 1. Always do the brackets first!
G
I
C Z = NOT ((A AND B) OR NOT (C AND D))
G
3. Add the NOT gate
A 4. Add the OR 2. Add the second
T gate AND gate
E A
S
B
Z
C
D
Hardware & Software
A system uses 3 switches A, B and C; a combination of switches determines whether an alarm,
X, sounds: If switch A or switch B are in the ON position and if switch C is in the OFF position
then a signal to sound an alarm, X is produced.
L
O Create a logic circuit If (A = 1 OR B = 1) AND (C = NOT 1) Then X = 1
G Produce a truth table
I The first part is two The output from the The third part is one
C inputs (A and B) joined first part and the input (C) which is put
A B C Output X
by an OR gate third part are joined through a NOT gate
G by an AND gate
A 1 1 1 0
T 1 1 0 1
E
S 1 0 1 0 1
1 0 0 1 A 1
1
1
0 1 1 0 B X
0 1 0 1
0 0 1 0 0 1
0 0 0 0
C
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
A system controls the flow of vehicles through a barrier based on three lights, A, B and C.
G When a light is red, the signal is zero. When a light is green, the signal is one.
A The barrier will open when the output X is one.
The barrier opens if either:
T
E • light A is red and lights B and C are both green
S or
• light A is green and lights B and C are both red

Design a logic circuit for the system. [5]

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:

Switch A sends value 1 AND Switch B sends value 0


L OR X = 1 IF (A AND NOT B) OR (B AND NOT C)
O Switch B sends value 1 AND Switch C sends value 0
G Create a logic circuit
I
C
Produce a truth table A
A B C Output X
G
A 1 1 1 0
T
E 1 1 0 1 B X
S 1 0 1 1
1 0 0 1
0 1 0 1
0 1 1 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:

Switch A sends value 1 AND Switch B sends value 0


L OR X = 1 IF (A AND NOT B) OR (B AND NOT C)
O Switch B sends value 1 AND Switch C sends value 0
G Create a logic circuit 1
I
C
Produce a truth table A 1

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:

Switch A sends value 1 AND Switch B sends value 0


L OR X = 1 IF (A AND NOT B) OR (B AND NOT C)
O Switch B sends value 1 AND Switch C sends value 0
G Create a logic circuit 1
I
C
Produce a truth table A 1

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:

Switch A sends value 1 AND Switch B sends value 0


L OR X = 1 IF (A AND NOT B) OR (B AND NOT C)
O Switch B sends value 1 AND Switch C sends value 0
G Create a logic circuit 0
I
C
Produce a truth table A 0

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

You might also like