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

Module 2 Combinational Logic Circuits

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)
22 views

Module 2 Combinational Logic Circuits

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/ 62

Module 2:

Combinational Logic Circuits

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Learning Objectives
❑ Understand the relationship between Boolean logic
and digital computer circuits.
❑ Learn how to design simple logic circuits.
❑ Understand how digital circuits work together to form
complex computer systems.

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Introduction:
❑ In the latter 19th century, ❑ Boolean Algebra has
George Boole suggested various applications
that logical thought  Digital circuit
could be represented  Google search
through mathematical  Database (SQL)
equations.  Programming
 ……
Logic Circuits and Switching
Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
An Example on Programming
while (((A && B) || (A && !B)) || !A)
{
// do something
}

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Boolean Algebra
 Boolean algebra is a mathematical system
for manipulating variables that can have
one of two values.
◼ In formal logic, these values are “true” and
“false”
◼ In digital systems, these values are
“on”/“off,” “high”/“low,” or “1”/”0”.
 Boolean expressions are created to
operate Boolean variables.
◼ Common Boolean operators include AND,
OR, and NOT. Logic Circuits and Switching
Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Boolean Algebra
 The function of Boolean operator
can be completely described
using a Truth Table.
 The truth tables of the Boolean
operators AND and OR are
shown on the right.
 The AND operator is also known
as the Boolean product “.”. The
OR operator is the Boolean sum
“+”. Logic Circuits and Switching
Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Boolean NOT
 The truth table of the
Boolean NOT operator is
shown on the right.
 The NOT operation is
most often designated by
an overbar “‾”.
◼ Some books use the prime
mark (‘) or the “elbow” (),
for instead.

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Boolean Function
 A Boolean function has:
• At least one Boolean variable,
• At least one Boolean operator, and
• At least one input from the set of {0,1}.
 It produces an output that is a member
of the set {0,1} – Either 0 or 1.

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Boolean Algebra
 Let’s look at a truth table for
the following Boolean
function shown on the
right. :

 To valuate the Boolean


function easier, the truth
table contains a extra
columns (shaded) to hold
the evaluations of partial
function. Logic Circuits and Switching
Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Rules Of Precedence
 Arithmetic has its rules of
precedence
◼ Like arithmetic, Boolean
operations follow the rules of
precedence (priority):
◼ NOT operator > AND
operator > OR operator .
 This explains why we chose
the shaded partial function
in that order in the table.
Rules Of Precedence
Logic Circuits and Switching
Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Boolean Algebra Laws
 Most Boolean algebra laws have either an AND
(product) form or an OR (sum) form.
We give the laws with both forms.
◼ Since the laws are always true, so X (and Y) could be
either 0 or 1

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Boolean Algebra Laws (‘Cont)
 The second group of Boolean laws
should be familiar to you from your
study of algebra:

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Boolean Algebra Laws (‘Cont)
The last group of Boolean laws are perhaps the most
useful.
If you have studied set theory or formal logic, these laws should
be familiar to you.
DeMorgan’s law
 DeMorgan’s law provides an easy way of finding the
negation (complement) of a Boolean function.
 DeMorgan’s law states:

 Example More Examples?


◼ I will come to school tomorrow if
(A) my car is working, and
(B) it won’t be snowing

= ◼ I won’t come to school tomorrow if


 (A) my car is not working, or
(B) it will snowing
DeMorgan’s Law
 DeMorgan’s law can be extended to any number of variables.
◼ Replace each variable by its negation (complement)
◼ Change all ANDs to ORs and all ORs to ANDs.
 Let’s say F (X, Y, Z) is the following, what is 𝐹
F

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Simplify Boolean function
Let’s use Boolean laws to simplify:

as follows:

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Logic simplification steps
 Apply De Morgan’s theorems
 Expanding out parenthesis
 Find the common factors
 Popular rules used:
X+XY=X X+X=X, XX=X
XYX+X+XY=X X+0=X, X+1=1 X0=0
Y=X+Y X1=X
Logic Circuits and Switching
Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
◼ Apply De Morgan’s theorem
WXYZ W+X+Y+Z

(A+B+C)D

AB+CD+EF
Logic Circuits and Switching
Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Boolean Algebra
Through our exercises in simplifying Boolean expressions, we
see that there are 1+ ways of stating the same Boolean
expression.
These “synonymous” forms are logically equivalent.
Logically equivalent expressions could produce confusions

=XZ
In order to eliminate the confusion, designers express
Boolean express in unified and standardized form, called
canonical form. Logic Circuits and Switching
Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Boolean Algebra
There are two canonical forms for Boolean expressions: sum-of-
products and product-of-sums.
Boolean product (x) AND logical conjunction
operator
Boolean sum (+) OR logical conjunction operator
In the sum-of-products form, ANDed variables are
ORed together.
For example:
In the product-of-sums form, ORed variables are
ANDed together:
For example:
Minterm and Maxterm
Some books uses sum-of-minterms form and
product-of-maxterms form
A minterm is a logical expression of n variables that
employs only the complement operator and the product
operator.
For example, abc, ab'c and abc'are 3 minterms for a Boolean
function of the three variables a, b, and c.
A maxterm is a logical expression of n variables that
employs only the complement operator and the sum
operator.
Logic Circuits and Switching
Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Create Canonical Form Via
Truth Table
It is easy to convert a function to
sum-of-products form from its truth
table.
We only interested in the
production of the inputs which
yields TRUE (=1).
We first highlight the lines that result
in 1.
Then, we group them together with
OR.

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Create Canonical Form Via Truth
Table (‘Cont)
Look at this example:

It may not the simplest form.


But, it is the standard sum-of-
products canonical form
Logic Circuits and Switching
Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Exercise
Convert ABC+A'BC+AB'C+A'B'C+ABC'
to its simplest form

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Exercise
Convert AB + C to the sum-of-products
form

AB+C
Logic Circuits and Switching
Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Boolean functions are implemented as digital circuits,
which called Logic Gates.
A logic gate is an electronic device that produces a
result based on input values.
A logic gate may contain multiple transistors, but, we
think them as one integrated unit.
Integrated circuits (IC) contain collections of gates, for
a particular purpose.

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
AND, OR, and NOT Gates
Three simplest gates are the AND, OR, and NOT
gates. “inversion
bubble”

Their symbol and their truth tables are listed above.


Logic Circuits and Switching
Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
NAND and NOR Gates
NAND and NOR are
two additional gates.
Their symbols and truth
tables are shown on the
right.
NAND = NOT AND
NOR = NOT OR

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
The Application of NAND and NOR Gates
NAND and NOR are
known as universal
gates! – gates of all
gates
They are inexpensive to
produce
More important: Any
Boolean function can be
constructed using only
NAND or only NOR
gates. Logic Circuits and Switching
Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Multiple Inputs and Outputs of Gates
The gates could have multiple inputs and/or multiple
outputs.
The second output can be provided as the complement
of the first output.
We’ll see more integrated circuits, which have multiple
inputs/outputs.

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
XOR Gates
Another very useful gate is the Exclusive OR (XOR) gate.
The output of the XOR operation is true (1) only when the
values of inputs are different.

The symbol for XOR is Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Parity generator / checker
Electrical noise in the transmission of
binary information can cause errors
Parity can detect these types of
errors
Parity systems
Odd parity
Even parity
Add a bit to the binary information
Logic Circuits and Switching
Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Even parity check
Even parity check
Example: input: A(7…0), Output: even_parity
bit
If there are even numbers of 1 in A, even_parity
= ‘0’,
If there are odd numbers of 1 in A,
even_parity = ‘1’
e.g., A = “10100001”,
even_parity = ‘1’
A = “10100011”,
Armie Q. Valencia
even_parity = ‘0’ Logic Circuits and Switching
Theory 1st Wave 1st Tri S.Y. 2425
Odd parity check
Odd parity check
Example: input: A(7…0), Output: odd_parity
bit
If there are odd numbers of 1 in A, odd_parity
= ‘0’,
If there are even numbers of 1 in A, odd_parity
= ‘1’
e.g., A = “10100001”,
odd_parity = ‘0’
A = “10100011”, Logic Circuits and Switching
Theory 1st Wave 1st Tri S.Y. 2425
Armie Q. Valencia
odd_parity = ‘1’
Odd-parity generator/checker system

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Error detection
Transmitting end: The parity generator creates
the parity bit.
Receiving end: The parity checker
determines if the parity is correct.
e.g., odd-parity check of 8-bit data
Data send: 10111101 + 1
Data received: 101011011
odd-parity check: The number of 1 is even→error
Logic Circuits and Switching
Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Parity check using XOR
N-1XOR gates can be cascaded to form a
circuit with N inputs and a single output
– even-parity circuit.
Example: N=8, Inputs=10111101, even-parity
output
=((10)(11))((11)(01))=0
Odd-parity check circuit: even-parity check
circuit ➔Inverted➔ Odd-parity check
Example: N=8, Inputs=10111101, odd-parity
output
=NOT(((10)(11))((11)(01)))=1
Binary comparators
A one-bit comparator is the same as the XOR
4-bit comparator

1-bit comparator

◆ A n-bit comparator determines if two n-bit signal vectors


are equal:
EQ(X[1:n],Y[1:n])=(X1=Y1)(X2=Y2)….(Xn=Yn)
Logic Circuits and Switching
Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Two Types of Logic Circuits
Combinational Logic Circuit (CLC)
Good at designing computational
components in the CPU, such as ALU
Sequential Logic Circuit (SLC)
Good at designing memory components,
such as registers and memory

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Logic Gates
We use the combination of gates to implement
Boolean functions.
The circuit below implements the Boolean function:

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Combinational
Circuits
The circuit implements the Boolean function:

The major characteristics of this kind of circuits:


The circuit produces an output almost immediately
after the inputs are given.
This kind of circuits are called combinational
logic circuit (CLC).

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Simplify CLC via Boolean Algebra
As I have mentioned previously:
The simpler that we can express a Boolean function,
the smaller the circuit will be constructed.
Simpler circuits are cheaper → consume less
power → run faster than complex circuits.
We always want to reduce a Boolean function to its
simplest form.
It is important to simplify combinational logic circuit via
Boolean algebra laws
Logic Circuits and Switching
Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Simplify CLC via Boolean
Can we simplify
Algebra this circuit? If
yes, then how?

Look at this example

=
=

=
=

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Steps to Simplify a Complex Circuit
From this example, we know that the basic steps
to simplify a complex circuit is the following:
Step1: Express a logical circuit into a Boolean
expression
Step2: Simplify the Boolean expression as much as
possible
Step3: Re-express the simplified expression
back to a circuit.

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Example of Simplify a Logical Circuit
Simplify the following circuit

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Example of Simplify a Logical Circuit
Step1: Express a logical circuit into a
Boolean expression

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Example of Simplify a Logical Circuit
Step2: Simplify the Boolean expression as
much as possible

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Example of Simplify a Logical Circuit
Step3: Re-express the simplified expression
back to a circuit

Obviously, the simplified circuit is much


simpler than the original one

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Combinational Circuits: Half Adder
Combinational logic circuits
can be used to create many
useful devices.
Half Adder: Compute the
sum of two bits.
Let’s gain some insight of how
to construct a half adder by
looking at its truth table on the
right.

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Combinational Circuits: Half Adder (‘Cont)
It consists two gates:
a XOR gate -- the sum bit
a AND gate -- the carry bit

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Combinational Circuits: Full Adder
We can extend the half
adder to a full adder,
which includes an
additional carry bit (Carry
In)
The truth table for a full
adder is shown on the
right.

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Half Adder → Full Adder ?
How can we extend the
half adder to a full adder?

Hint: First calculate X + Y by a half adder, then


the sum adds the carry in bit, then……
The Full Adder

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Ripple-carry Adder
Just as we combined half adders to construct a full
adder, full adders can be connected in series.
The carry bit “ripples” from one adder to the next.
This configuration is called a ripple-carry adder.

This is the full adder for two 16 bits!


Logic Circuits and Switching
Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Decoder
Decoder is another important combinational circuit.
It is used to select a memory location according a
address in binary form
Application: given a memory address → Obtain its
memory content.
Address decoder with n inputs can select one out of
2n locations.

Logic Circuits and Switching


Armie Q. Valencia Address Theory 1st Wave 1st Tri S.Y. 2425
Memory
Lines
Decoder

Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
A 2-to-4 Decoder
This is a 2-to-4 decoder :
Memory
0
0

1 0

Address:
01
1

Only this piece of Logic Circuits and Switching


Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
memory will be
chosen/accessed
Logic Circuits and Switching
Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
68
74138 as a memory address decoder
Multiplexer
A multiplexer works just the opposite

Memory
to a decoder.
It selects a single value from
multiple inputs.
The chosen input for output is
determined by the value of the
1 0 Address
multiplexer’s control lines.
To select from n inputs, log2n
control lines are required.
Logic Circuits and Switching
Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
A four-line multiplexer

What is the logic equation for


the output Y =?
Logic Circuits and Switching
Armie Q. Valencia Theory 1st Wave 1st Tri S.Y. 2425
Combinational Circuits
This is a 4-to-1 multiplexer.

Logic Circuits and Switching


Theory 1st Wave 1st Tri S.Y. 2425
which input is transferred to the output?
A Simple Two-Bit ALU Logic Circuits and Switching
Theory 1st Wave 1st Tri S.Y. 2425
Armie Q. Valencia

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy