0% found this document useful (0 votes)
23 views

CT - Topic 4 - Basic Logic Gates

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

CT - Topic 4 - Basic Logic Gates

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

TOPIC 4: BASIC LOGIC GATES

COMPUTING FOR TECHNOLOGY – BTC1062 / ETC1062


UTHPALA SAMARATUNGA
TOPIC 4: CONTENT

◼ Basic Logic Gates


◼ Combinational Logics, Sequential Logics
◼ Truth Table, Boolean Expressions
BINARY LOGIC

◼ Deals with binary variables that take 2 discrete values (0 and 1), and with
logic operations
◼ Three basic logic operations:
o AND, OR, NOT

◼ Binary/logic variables are typically represented as letters: A,B,C,…,X,Y,Z


BINARY LOGIC FUNCTION
BASIC LOGIC GATES
LOGIC GATES

◼ All digital computers for the past 50 years have been


constructed using the same type of components.
◼ These components are called logic gates.
◼ Logic gates have been implemented in many different ways.
◼ Currently, logic gates are most commonly implemented using
electronic VLSI transistor logic.
LOGIC GATES: OVERVIEW

Functions of Gates can be


Binar Binary described by:
◼ Truth Table
y . Digital
Gate
Digita . Output
l
Input
Signal ◼ Boolean Function
Signal and Karnaugh Map
LOGIC GATES: OVERVIEW

Types of Basic Logic Blocks:


◼ Combinational Logic Block
o Logic Blocks whose output logic value
o Depends only on the input logic value
◼ Sequential Logic Block
o Logic Blocks whose output logic value
o Depends on the input values and the state (stored information) of the blocks
LOGIC GATES

All basic logic gates have the ability to accept either one or two
input signals (depending upon the type of gate) and generate one
output signal.
LOGIC GATES

◼ Input and Output signals are binary.


o Always in one of two possible states.
o Typically treated as:
• On / Off (electrically)
• 1/0
• True / False
◼ There is a delay between when a change happens at a logic gates inputs
and when the output changes, called gate switching time.
◼ The True or False view is most useful for thinking about the meaning of
the basic logic gates.
BASIC LOGIC GATES

The four basic logic gates are:


◼ AND
◼ OR
◼ XOR
◼ NOT
AND GATE

The Output signal from an AND gate is True (on, 1) if and only if both
Input signals are True (on, 1).
The Output signal from an AND gate is False (off, 0), otherwise.
OR GATE

The Output signal from an OR gate is True (on, 1) if either, or both, Input
signals are True (on, 1).
The Output signal from an OR gate is False (off, 0) if and only if both
Input signals are False (off, 0).
XOR GATE

The Output from an XOR (exclusive or) is True (on, 1) if and only if the Input
signals are different.
The Output from an XOR is False if the Input signals are either both True or both
False.
NOT GATE

The Output signal from a NOT gate is True (on, 1) if and only if the Input signal
is False.
The Output signal from a NOT gate is False (off, 0) if and only if the Input signal
is True.
NOT GATE COMBINED WITH OTHER GATES

We can combine NOT gate with OR, AND and XOR gates to create other
gates.
◼ NAND
◼ NOR
◼ XNOR
NAND GATE

NAND gate is a combination of the AND gate and the NOT gate.
NOR GATE

NOR gate is a combination of the OR gate and the NOT gate.


XNOR GATE

XNOR gate is a combination of the OR gate and the NOT gate.


XOR AND XNOR
TRUTH TABLES

Truth table: tabular form that uniquely represents the relationship between
the input variables of a function and its output
TRUTH TABLES

Q: Let a function F() depend on n variables. How many rows are


there in the truth table of F() ?

A: 2n rows, since there are 2n possible binary


patterns/combinations for the n variables
TRUTH TABLES

◼ Truth table: a unique representation of a Boolean function


◼ If two functions have identical truth tables, the functions are equivalent
(and vice-versa).
◼ Truth tables can be used to prove equality theorems.
◼ However, the size of a truth table grows exponentially with the number of
variables involved, hence unwieldy. This motivates the use of Boolean
Algebra.
DISCUSSION: MUTIPLE INPUT GATES (AND, NAND, NOR, XNOR)
LOGIC FUNCTION TO COMBINATIONAL LOGIC CIRCUIT

◼ Consider function F = A’ + B•C’ + A’•B’


◼ A combinational logic circuit can be constructed to implement
F, by appropriately connecting input signals and logic gates:
o Circuit input signals 🡪 from function variables (A, B, C)
o Circuit output signal 🡪 function output (F)
o Logic gates 🡪 from logic operations
LOGIC FUNCTION TO COMBINATIONAL LOGIC CIRCUIT

A F

B
QUESTIONS
QUESTION: WRITE DOWN THE OUTPUT OF THE FOLLOWING
CIRCUIT
ANSWER

x+y

(x+y).y
y
QUESTION: WRITE DOWN THE OUTPUT OF THE FOLLOWING
CIRCUIT
ANSWER

x .y x .y

y
QUESTION: DRAW THE CIRCUIT FOR THE FOLLOWING BOOLEAN
ALGEBRAIC EXPRESSION

F = X’ + Y
ANSWER

F = X’ + Y

x
ANSWER

F = X’ + Y

x+y
QUESTION: DRAW THE LOGIC CIRCUIT, OUTPUTS AND THE
TRUTH TABLE FOR THE BOOLEAN EXPRESSION

F = (x + y).(x.y)
ANSWER

F = (x + y).(x.y)

x+y

(x+y).(x.y)
x.y x.y
ANSWER

x y x+y x.y (x.y)' (x + y).(x.y)' F


1 1 1 1 0 0 0
1 0 1 0 1 1 1
0 1 1 0 1 1 1
0 0 0 0 1 0 0

Did you notice that the output of the logic circuit is similar to the output
of an XOR gate?
USAGE OF LOGIC GATES
HOW TO ADD BINARY NUMBERS

Consider adding two 1-bit binary numbers x and y


0+0=0 x y Carry Sum
0+1=1
0 0 0 0
1+0=1
1 + 1 = 10
0 1 0 1
Carry is x AND y 1 0 0 1
Sum is x XOR y 1 1 1 0
The circuit to compute this is called a half-adder
39
THE HALF-ADDER

40
USING HALF ADDERS

We can then use a half-adder to compute the sum of two Boolean numbers

1 0 0
1 1 0 0
+1 1 1 0
? 0 1 0

Do you see any problem here?

You might also like