Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

Chapter (10)

Logic Gates

Zin Mar Soe

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

The way of showing every outcome of a logic gate is


truth table.
1 and 1 → 1 , others “0”
5
OR Gates
• When using an OR logic gate, the output will be high voltage if
one of the input is high voltage.
• A logic statement for an OR gate is:
X=A OR B or X=A+B
• A cross sign (+) can be used to represent the word OR in a logic
statement.

6
Truth Table of OR Gates
Input Output
A B X
0 0 0
0 1 1
1 0 1
1 1 1

Include “1” → 1 , others “0”


7
NOT
• A Not logic gate will only have one input and one output.
• The output will be high voltage only if the input is low voltage.
X= NOT A or X=𝐴ҧ

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

Opposite of AND gate


1 and 1 → 0 , others “1”
10
NOR Gates
• The NOR logic gate is a combination of an OR gate followed by a
NOT gate.
• If either input is high voltage, the output will be low voltage.
• A logic statement for an AND gate is:
X=NOT(A OR B) or X= 𝐴 + 𝐵

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

Same include (1,1 or 0,0) → 0 , others “1”


14
Summary
Name of Logic Description

AND 1 and 1 → 1 , others “0”

OR Include “1” → 1 , others “0”

NAND 1 and 1 → 0 , others “1”

NOR Include “1” → 0 , others “1”

XOR Same include (1,1 or 0,0) → 0 , others “1”

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

(NOT A AND B) OR (A AND B)


17
INPUT OUTPUT
A B C X
0 0 0 1 NOT A AND NOT B AND NOT C
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 1 A AND NOT B AND NOT C
1 0 1 0
1 1 0 1 A AND B AND NOT C
1 1 1 0

(NOT A AND NOT B AND NOT C) OR (A AND NOT B AND NOT C)


OR (A AND B AND NOT C) 18

You might also like