Cambridge - IGCSE - ComputerScience - Chapter (10) Boolean Logic
Cambridge - IGCSE - ComputerScience - Chapter (10) Boolean Logic
Logic Gates
1
Logic Gates
• A Logic gate is a basic foundation of a digital circuit.
• Digital circuit is a circuit where electronic signals are one of two values, high
voltage(1) or low voltage (0).
• The potential difference across an electrical component needed to make
electricity flow through it.
• Data and instructions are both stored and transmitted by digital computers
as the binary digits 0 and 1.
• Various tasks are performed in a computer by switching on a high voltage or
a low voltage through a digital circuit called logic gate.
• High voltage is represented by the binary digit 1 and low voltage is
represented by the binary 0.
• Each logic gate controls the flow of electronic signals in a predetermined
way.
• Each logic gate, except a NOT logic gate, will have two inputs and one
output.
2
Logic Gates
• Electronic circuits in computers, solid state drives and controlling
devices are made up of thousands of logic gates.
• Logic gates take binary inputs and produce a binary output.
• Several logic gates combined together form a logic circuit and these
circuits are designed to carry out a specific function.
• The checking of the output from a logic gate or logic circuit is done
using a truth table.
• Truth tables are used to trace the output from a logic gate or logic
circuit.
3
AND Gates
• When using an AND logic gate, the output will only be high voltage
if both inputs are high voltage.
• A logic statement for an AND gate is:
X=A AND B or X=A.B
• A dot (.) can be used to represent the word AND in a logic
statement.
4
Truth Table of AND Gates
Input Output
A B X
0 0 0
0 1 0
1 0 0
1 1 1
6
Truth Table of OR Gates
Input Output
A B X
0 0 0
0 1 1
1 0 1
1 1 1
Input Output
A X
1 0
0 1
8
NAND Gates
• The NAND logic gate is a combination of an AND gate followed by
a NOT gate.
• If both inputs are high voltage, the output will be low voltage.
• A logic statement for an AND gate is:
X=NOT(A AND B) or X= 𝐴. 𝐵
9
Truth Table of NAND Gates
Input Output
A B X
0 0 1
0 1 1
1 0 1
1 1 0
11
Truth Table of NOR Gates
Input Output
A B X
0 0 1
0 1 0
1 0 0
1 1 0
Opposite of OR gate
Include “1” → 0 , others “1”
12
XOR or EOR Gates
• A XOR or Exclusive OR gate has a slightly changed logic from an
OR gate.
• If both inputs are high voltage, the output will be low voltage.
X=(NOT A OR B) + (A AND Not B)
or X=𝐴 ⊕ 𝐵
13
Truth Table of XOR Gates
Input Output
A B X
0 0 0
0 1 1
1 0 1
1 1 0
NOT Opposite
15
INPUT OUTPUT
A B X
0 0 0
0 1 0
1 0 1 A AND NOT B
1 1 0
16
INPUT OUTPUT
A B X
0 0 0
0 1 1 NOT A AND B
1 0 0
1 1 1 A AND B