SlideShare a Scribd company logo
Digital Logic Design (EEEg4302)
Chapter 5: Combinational Logic
AASTU
Department of Electrical and
Computer Engineering
1
By Milkias H.
Outline
• Chapter 5 : Combinational Logic
• Introduction
• Basic Combinational Logic Circuits
• Combinational Logic using NAND and NOR Gates
• Functions of Combinational Logic
• Implementing Combinational Logic
• Binary Adder and Subtractor
• Magnitude Comparator
• Decoder and Encoders
• Multiplexers and Demultiplexers
2
Introduction
• Logic circuit for digital systems can be combinational or sequential.
• A combinational circuit consists of logic gates whose outputs at anytime are
determined from only the present combination of inputs.
• A combinational circuit performs an operation that can be specified logically by a set
of Boolean functions.
• In contrast, sequential circuits employ storage elements in addition to logic gates.
• The outputs of sequential circuits are a function of the input and the state of the
storage elements.
3
Basic Combinational Logic Circuits
• As you know, SOP expressions are implemented with an AND gate for each
product term and one OR gate for summing all of the product terms.
• This SOP implementation is called AND-OR logic and is the basic form for realizing
standard Boolean functions.
• Here, we will see the AND-OR and the AND-OR-Invert; the Exclusive-OR and
Exclusive-NOR which are a form of AND-OR logic.
4
Basic Combinational Logic Circuits
AND-OR logic
• An AND-OR circuit directly implements an SOP expression, assuming the complements
(if any) of the variables are available.
Example : for a 4- input AND-OR logic circuit, the output X is HIGH (1) if both inputs A and
B are HIGH(1) or both input C and input D are HIGH(1).
5
Basic Combinational Logic Circuits
AND-OR-Invert logic
• When the output of an AND-OR circuit is complimented (inverted),it results AND-OR-
Invert circuit. Since AND-OR logic directly implements SOP expressions. POS
expressions can be implemented with AND-OR-Invert Logic.
Example : for a 4- input AND-OR-Invert logic circuit, the output X is LOW(0) if both
inputs A and B are HIGH(1) or both input C and input D are HIGH(1).
6
Basic Combinational Logic Circuits
Exclusive-OR logic
• Although, because of its importance Exclusive-OR is considered as a type of logic gate
with its own unique symbol. It is actually a combination of 2 AND gates, 1 OR gate and
2 inverters.
X = A𝐵 + 𝐴B X = A ⨁ B
7
Basic Combinational Logic Circuits
Exclusive- NOR logic
• Implemented by simply inverting the output of an exclusive-OR.
X = A𝐵 + 𝐴B = 𝐴𝐵 + AB X = A⨀B
8
Combinational Logic using NAND and NOR Gates
• NAND and NOR gates can be used to implement a logic function.
• The NAND gate also exhibits an equivalent operation called the negative-OR 𝑨𝑩 =𝑨 + 𝑩 .
• The NOR gate also exhibits an equivalent operation called the negative-AND 𝑨 + 𝑩 =𝑨𝑩.
• Use of the appropriate symbols to represent the equivalent operation makes the “reading”
a logic diagram easier (bubble to bubble).
Example 1: NAND Logic for X=AB+CD
9
Combinational Logic using NAND and NOR Gates
Example 2: NOR Logic for X=(A+B)(C+D)
Exercise: 1. Implement the expression X = (𝑨 + 𝑩 + 𝑪)𝑫𝑬 by using NAND logic.
2. Implement the expression X = 𝑨𝑩𝑪 + 𝑫 + 𝑬 by using NOR logic.
10
Functions of Combinational Logic
• When logic gates are connected together to produce a specified output for certain
specified combinations of input variables with no storage involved; the resulting
circuit is in the category of Combinational logic.
• In combinational logic , the output level is at all times dependent on the combination
of input levels.
• A combinational circuit consists of an interconnection of logic gates.
• Combinational logic gates react to the values of the signals at their inputs and
produce the value of the output signal, transforming binary information from the
given input data to a required output data.
• A block diagram of a combinational circuit is shown in figure below. The n input binary
variables come from an external source; the m output variables are produced by the
internal combinational logic circuit and go to an external destination.
11
Implementing Combinational Logic
Design Procedure
• The design of combinational circuits starts from the specification of the design objectives
and is converted to a set of Boolean functions from which the logic diagram can be
obtained.
• The procedure involves the following steps;
I. Determine the required number of inputs and outputs and assign a symbol to each.
II. Derive the truth table that defines the required relationship between inputs and
outputs.
III. Obtain the simplified Boolean functions for each output as a function of the input
variables.
IV. Draw the logic diagram and verify the correctness of the design.
12
Binary Adder and Subtractor
• Digital computers perform a variety of information-processing tasks. Among the
functions encountered are the various arithmetic operations.
• The most basic arithmetic operation is the addition of two binary digits.
• An understanding of the basic adder operation is fundamental to the study of digital
systems.
• This simple addition consists of four possible elementary operations:
0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10.
• The first three operations produce a sum of one digit but when both augend and
addend bits are equal to 1, the binary sum consists of two digits. The higher
significant bit of this result is called a carry.
13
Binary Adder and Subtractor
• When the augend and addend numbers contain more significant digits, the carry
obtained from the addition of two bits is added to the next higher order pair of
significant bits.
• A combinational circuit that performs the addition of two bits is called a half adder.
• One that performs the addition of three bits (two significant bits and a previous
carry) is a full adder.
• The names of the circuits comes from the fact that two Half adders can be
employed to implement a full adder.
• The basic difference between a full-adder and a half-adder is that the full-adder
accepts an input carry.
14
Binary Adder and Subtractor
Half Adder
• From the explanation of a half adder, we find that this circuit needs two binary inputs
and two binary outputs.
• The input variables designate the augend and addend bits; the output variables
produce the sum and carry.
• We assign symbols X and Y to the two inputs and S (for sum) and C (for carry) to the
outputs.
• The truth table for the half adder is listed in the following Table .
15
Binary Adder and Subtractor
Half Adder
Implementation of Half Adder
16
Binary Adder and Subtractor
Full Adder
• A full adder is a combinational circuit that forms the arithmetic sum of three bits. It
consists of three inputs and two outputs.
• Two of the input variables, denoted by X and Y represent the two significant bits to
be added.
• The third input Z, represents the carry (Ci )from the previous lower significant
position.
• Two outputs are necessary because the arithmetic sum of three binary digits ranges
in value from 0 to 3 and binary representation of 2 or 3 needs two bits.
• The two outputs are designated by the symbols S for sum and C for carry.
17
Binary Adder and Subtractor
Full Adder
• The truth table of the full adder is listed in the following Table.
18
Binary Adder and Subtractor
Full Adder
Implementation of full adder in sum-of-products form
Implementation of a full adder with two half adders and an OR gate
19
Binary Adder and Subtractor
Parallel Binary Adders
• Addition of n-bit binary numbers requires the use of a full adder and the process of
addition proceeds on a bit-by-bit basis right to left beginning with the least
significant bit.
• After the least significant bit, addition at each position adds not only the respective
bits of the words but must also consider a possible carry bit from addition at the
previous position.
• Addition of n-bit numbers requires a chain of n full adders or a chain of one-half
adder and n-1 full adders. In the former case, the input carry to the least significant
position is fixed at 0.
• For Example: 4-bit parallel adder
20
Binary Adder and Subtractor
Parallel Binary Adders
Example: 4-bit parallel adder
• To demonstrate with a specific example, consider the two binary numbers A = 1011
and B = 0011. Their sum S = 1110 is formed with the four-bit adder as follows:
21
Binary Adder and Subtractor
Binary Subtractor
• The subtraction of binary numbers can be done most conveniently by means of
complements.
• Remember that the subtraction A - B can be done by taking the 2’s complement of B
and adding it to A .
• The 2’s complement can be obtained by taking the 1’s complement and adding 1 to
the least significant pair of bits.
• The 1’s complement can be implemented with inverters and a 1 can be added to the
sum through the input carry.
• The addition and subtraction operations can be combined into one circuit with one
common binary adder by including an exclusive-OR gate with each full adder.
22
Binary Adder and Subtractor
Binary Subtractor
• A four-bit Adder–Subtractor circuit is shown in the following Figure. The mode input
M controls the operation. When M = 0, the circuit is an adder and when M = 1, the
circuit becomes a Subtractor.
• Each exclusive-OR gate receives input M and one of the inputs of B . When M = 0, we
have B ⨁ 0 = B. The full adders receive the value of B , the input carry is 0, and the
circuit performs A plus B . When M = 1, we have B ⨁ 1 = B and C0 = 1.
• The B inputs are all complemented and a 1 is added through the input carry. The
circuit performs the operation A plus the 2’s complement of B.
23
Four-bit Adder–Subtractor
Magnitude Comparator
• The comparison of two numbers is an operation that determines whether one
number is greater than, less than, or equal to the other number.
• A magnitude comparator is a combinational circuit that compares two numbers A
and B and determines their relative magnitudes.
• The outcome of the comparison is specified by three binary variables that indicate
whether A >B, A = B or A < B.
• The circuit for comparing two n -bit numbers has 22n entries in the truth table and
becomes too bulky even with n = 3.
• Since a comparator circuit possesses a certain amount of regularity. Digital functions
that possess an inherent well-defined regularity can usually be designed by means of
an algorithm.
• The algorithm is a direct application of the procedure a person uses to compare the
relative magnitudes of two numbers.
24
Magnitude Comparator
• Example: Consider two numbers, A and B with four digits each. Write the coefficients
of the numbers in descending order of significance:
• Each subscripted letter represents one of the digits in the number. The two numbers
are equal if all pairs of significant digits are equal: A3 = B3, A2 = B2, A1 = B1, and
A0 = B0.It can be expressed logically with an exclusive-NOR function.
• The equality of the two numbers A and B is displayed in a combinational circuit by an
output binary variable that we designate by the symbol A = B .
25
Magnitude Comparator
• If the corresponding digit of A is 1 and that of B is 0, we conclude that A > B. If the
corresponding digit of A is 0 and that of B is 1, we have A < B. The sequential
comparison can be expressed logically by the two Boolean functions.
• The symbols (A > B) and (A < B) are binary output variables that are equal to 1 when
A > B and A < B, respectively.
• The unequal outputs can use the same gates that are needed to generate the equal
output.
26
Magnitude Comparator
The logic diagram of the four-bit magnitude comparator
27
Decoder
• Discrete quantities of information are represented in digital systems by binary codes.
• A binary code of n bits is capable of representing up to 2n distinct elements of coded
information.
• A decoder is a combinational circuit that converts binary information from n input
lines to a maximum of 2n unique output lines. If the n -bit coded information has
unused combinations, the decoder may have fewer than 2n outputs.
• Each combination of inputs will assert a unique output.
• The name decoder is also used in conjunction with other code converters such as a
BCD-to-seven-segment decoder.
• The decoders presented here are called n -to- m -line decoders, where m ≤ 2n. Their
purpose is to generate the 2n (or fewer) terms of n input variables.
• Decoder can be developed using AND logic gates.
28
n to m
Decoder
Decoder
Example: The three-to-eight-line (3 to 8) decoder circuit
• The three inputs are decoded into eight outputs, each representing one of the
product terms of the three input variables.
29
3 to 8
Decoder
The operation of the decoder may be clarified by the truth table listed in
the Table. For each possible input combination, there are seven outputs
that are equal to 0 and only one that is equal to 1.
Decoder
Decoder with an Enable Input
• A decoder with enable input can function as a Demultiplexer— a circuit that receives
information from a single line and directs it to one of 2n possible output lines.
30
2 to 4
Decoder
Enable
A two-to-four-line decoder with an enable input(Enable 0 or Active Low) constructed with NAND gates.
0
Decoder
Decoder with an Enable Input
• In general, enable inputs are a convenient feature for interconnecting two or more
standard components for the purpose of combining them into a similar function with
more inputs and outputs.
• Decoders with enable inputs can be connected together to form a larger decoder
circuit.
• Example: Two 3-to-8-line decoders with enable inputs connected to form a 4-to-16-line
decoder.
31
4 to 16
Decoder
Enable
4 x 16 decoder constructed with two 3 x 8 decoders
Decoder
BCD-to-Decimal Decoder (Application)
4-line-to-10-line decoder.
32
Decoder
BCD-to-7-Segement Decoder (Application)
4-line-to-7-line decoder.
33
Encoder
• An encoder is a digital circuit that performs the inverse operation of a decoder.
• An encoder has 2n (or fewer) input lines and n output lines.
• The output lines as an aggregate generate the binary code corresponding to the input
value.
• An encoder can be implemented with OR gates whose inputs are determined directly
from the truth table.
• It accepts an active level on one of its inputs representing a digit, such as a decimal or
octal digit and converts it to a coded output, such as BCD or binary.
• The process of converting from familiar symbols or numbers to a coded format is
called encoding.
34
Encoder
Example: Octal-to-Binary (8-to-3)Encoder(Application).
• It has eight inputs (one for each of the octal digits) and three outputs that generate
the corresponding binary number.
• Output z is equal to 1 when the input octal digit is 1, 3, 5or 7. Output y is 1 for octal
digits 2, 3, 6, or 7, and output x is 1 for digits 4, 5, 6, or 7. These conditions can be
expressed by the following Boolean output functions:
• The encoder can be implemented with three OR gates.
35
Encoder
Example: Decimal-to-BCD Encoder(Application).
• It has Ten inputs (one for each of the Decimal digits) and four outputs that generate
the corresponding BCD.
36
Multiplexer
• A multiplexer is a combinational circuit that selects binary information from one of
many input lines and directs it to a single output line.
• A multiplexer (MUX) is a data selection device that allows digital information from
several sources to be routed onto a single line for transmission over that lines to a
common destination.
• The selection of a particular input line is controlled by a set of selection lines.
Normally, there are 2n input lines and n selection lines whose bit combinations
determine which input is selected.
• A multiplexer acts like an electronic switch that selects one of many sources.
37
Multiplexer
Example 1: Two-to-one-line multiplexer [connects one of two 1-bit sources to a
common destination]
• The circuit has two data input lines (I0 & I1), one output line (Y) and one selection
line S . When S = 0, the upper AND gate is enabled and I0 has a path to the output.
When S = 1, the lower AND gate is enabled and I1 has a path to the output.
38
Multiplexer
Example 1: A four-to-one-line multiplexer
• Each of the four inputs, I0 through I3, is applied to one input of an AND gate.
Selection lines S1 and S0 are decoded to select a particular AND gate.
• The outputs of the AND gates are applied to a single OR gate that provides the one-
line output.
• The function table lists the input that is passed to the output for each combination
of the binary selection values.
39
Demultiplexer
• A Demultiplexer (DEMUX) basically reverse the multiplexing function.
• It takes digital information form one line and distributes it to a given number of
output lines.
• Data goes from one line to several lines.
• A multiplexer acts like an electronic switch that selects one of many sources.
• The demultiplexer is also known as a data distributer. As we have seen, decoders can
also be used as demultiplexers.
Example : one line to four line Demultiplexer.
40
Last slide
41

More Related Content

PPT
Boolean Algebra
PPT
decoder and encoder
PDF
Logic gate
PPTX
Chapter 4: Combinational Logic
PPTX
Logic gate
PPTX
Latches and flip flop
PPT
Sequential circuits
PPTX
flip flops
Boolean Algebra
decoder and encoder
Logic gate
Chapter 4: Combinational Logic
Logic gate
Latches and flip flop
Sequential circuits
flip flops

What's hot (20)

PPTX
Sequential Logic Circuits
PPTX
Parity Generator and Parity Checker
PPT
Multiplexers & Demultiplexers
PPT
Logic families
PDF
Ee 202 chapter 1 number and code system
PPTX
Flip flop conversions
PPTX
Registers
PPTX
Half & Full Adder
PPTX
Logic gates - AND, OR, NOT, NOR, NAND, XOR, XNOR Gates.
PPTX
Combinational circuit
PPT
Combinational circuits
PPTX
SHIFT REGISTERS
PPTX
full subtractor
PPTX
Chapter 2: Boolean Algebra and Logic Gates
PDF
Subtractor
PPTX
Counters
PPTX
JK flip flop in Digital electronics
PDF
Sop and pos
PPTX
Adder Presentation
PPT
multiplexers and demultiplexers
Sequential Logic Circuits
Parity Generator and Parity Checker
Multiplexers & Demultiplexers
Logic families
Ee 202 chapter 1 number and code system
Flip flop conversions
Registers
Half & Full Adder
Logic gates - AND, OR, NOT, NOR, NAND, XOR, XNOR Gates.
Combinational circuit
Combinational circuits
SHIFT REGISTERS
full subtractor
Chapter 2: Boolean Algebra and Logic Gates
Subtractor
Counters
JK flip flop in Digital electronics
Sop and pos
Adder Presentation
multiplexers and demultiplexers
Ad

Similar to Chapter 5_combinational logic (EEEg4302).pdf (20)

PPTX
UNIVERSAL PROPERTY.pptx
PPT
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational Circuits
PPT
Binary parallel adder, decimal adder
PPTX
DLD Lecture No 19 Binary adders.pptx
PDF
FYBSC IT Digital Electronics Unit III Chapter II Arithmetic Circuits
PPTX
Digital principal and computer organization
PPT
combinational-circuit (1).ppt
PDF
4. Combinational Logic Circuits not bad.pdf
PPTX
Lesson Week 1-2.pptx
PDF
DIGITAL PRINCIPLES AND SYSTEM DESIGN LAB MANUAL
PPTX
DIGITAL ELECTRONICS :UNIT-II-COMBINATIONAL CIRCUIT DESIGN
PPTX
Digital electronics-COMBINATIONAL CIRCUIT DESIGN
DOCX
Logic gates
PDF
_Digital_Electronics_II.pdf circuits and circuit diagrams
PPT
ABOUT THE DIGITAL ELECTRONIC TOPIC CIRCUIT DESIGN
PPTX
DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and BCD Add...
PPT
Digital Logic Design
PPT
9525.ppt
PPTX
18CSC203J_COA_Unit 2 final.pptx
PPTX
Combinational logic circuits design and implementation
UNIVERSAL PROPERTY.pptx
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational Circuits
Binary parallel adder, decimal adder
DLD Lecture No 19 Binary adders.pptx
FYBSC IT Digital Electronics Unit III Chapter II Arithmetic Circuits
Digital principal and computer organization
combinational-circuit (1).ppt
4. Combinational Logic Circuits not bad.pdf
Lesson Week 1-2.pptx
DIGITAL PRINCIPLES AND SYSTEM DESIGN LAB MANUAL
DIGITAL ELECTRONICS :UNIT-II-COMBINATIONAL CIRCUIT DESIGN
Digital electronics-COMBINATIONAL CIRCUIT DESIGN
Logic gates
_Digital_Electronics_II.pdf circuits and circuit diagrams
ABOUT THE DIGITAL ELECTRONIC TOPIC CIRCUIT DESIGN
DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and BCD Add...
Digital Logic Design
9525.ppt
18CSC203J_COA_Unit 2 final.pptx
Combinational logic circuits design and implementation
Ad

More from TamiratDejene1 (20)

PDF
Ch-3 lecture.pdf
PPTX
Chapter 2.pptx
PPT
Wireless LANs.ppt
PPT
Data Link Control.ppt
PPT
Congestion Control and QOS.ppt
PPT
Analog Transmission.ppt
PDF
Chapter 5 (Part I) - Pointers.pdf
PDF
Chapter 7 (Part I) - User Defined Datatypes.pdf
PDF
00-intro-to-classes.pdf
PDF
DLD Chapter-5.pdf
PDF
DLD Chapter-4.pdf
PDF
DLD Chapter-2.pdf
PDF
DLD Chapter-1.pdf
PDF
DLD_Chapter_1.pdf
PDF
Chapter 8_Shift Registers (EEEg4302)1.pdf
PDF
Chapter 7_Counters (EEEg4302).pdf
PDF
Chapter 3_Logic Gates (EEEg4302).pdf
PDF
Chapter 2_Number system (EEEg4302).pdf
PDF
Chapter 1_Introduction to digital design (EEEg4302).pdf
PDF
Chapter – 1 Intro to DBS.pdf
Ch-3 lecture.pdf
Chapter 2.pptx
Wireless LANs.ppt
Data Link Control.ppt
Congestion Control and QOS.ppt
Analog Transmission.ppt
Chapter 5 (Part I) - Pointers.pdf
Chapter 7 (Part I) - User Defined Datatypes.pdf
00-intro-to-classes.pdf
DLD Chapter-5.pdf
DLD Chapter-4.pdf
DLD Chapter-2.pdf
DLD Chapter-1.pdf
DLD_Chapter_1.pdf
Chapter 8_Shift Registers (EEEg4302)1.pdf
Chapter 7_Counters (EEEg4302).pdf
Chapter 3_Logic Gates (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdf
Chapter 1_Introduction to digital design (EEEg4302).pdf
Chapter – 1 Intro to DBS.pdf

Recently uploaded (20)

PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Cell Types and Its function , kingdom of life
PPTX
master seminar digital applications in india
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Insiders guide to clinical Medicine.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Institutional Correction lecture only . . .
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Final Presentation General Medicine 03-08-2024.pptx
Cell Types and Its function , kingdom of life
master seminar digital applications in india
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Sports Quiz easy sports quiz sports quiz
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Computing-Curriculum for Schools in Ghana
Microbial diseases, their pathogenesis and prophylaxis
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Renaissance Architecture: A Journey from Faith to Humanism
Abdominal Access Techniques with Prof. Dr. R K Mishra
O5-L3 Freight Transport Ops (International) V1.pdf
Insiders guide to clinical Medicine.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Institutional Correction lecture only . . .
Microbial disease of the cardiovascular and lymphatic systems
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...

Chapter 5_combinational logic (EEEg4302).pdf

  • 1. Digital Logic Design (EEEg4302) Chapter 5: Combinational Logic AASTU Department of Electrical and Computer Engineering 1 By Milkias H.
  • 2. Outline • Chapter 5 : Combinational Logic • Introduction • Basic Combinational Logic Circuits • Combinational Logic using NAND and NOR Gates • Functions of Combinational Logic • Implementing Combinational Logic • Binary Adder and Subtractor • Magnitude Comparator • Decoder and Encoders • Multiplexers and Demultiplexers 2
  • 3. Introduction • Logic circuit for digital systems can be combinational or sequential. • A combinational circuit consists of logic gates whose outputs at anytime are determined from only the present combination of inputs. • A combinational circuit performs an operation that can be specified logically by a set of Boolean functions. • In contrast, sequential circuits employ storage elements in addition to logic gates. • The outputs of sequential circuits are a function of the input and the state of the storage elements. 3
  • 4. Basic Combinational Logic Circuits • As you know, SOP expressions are implemented with an AND gate for each product term and one OR gate for summing all of the product terms. • This SOP implementation is called AND-OR logic and is the basic form for realizing standard Boolean functions. • Here, we will see the AND-OR and the AND-OR-Invert; the Exclusive-OR and Exclusive-NOR which are a form of AND-OR logic. 4
  • 5. Basic Combinational Logic Circuits AND-OR logic • An AND-OR circuit directly implements an SOP expression, assuming the complements (if any) of the variables are available. Example : for a 4- input AND-OR logic circuit, the output X is HIGH (1) if both inputs A and B are HIGH(1) or both input C and input D are HIGH(1). 5
  • 6. Basic Combinational Logic Circuits AND-OR-Invert logic • When the output of an AND-OR circuit is complimented (inverted),it results AND-OR- Invert circuit. Since AND-OR logic directly implements SOP expressions. POS expressions can be implemented with AND-OR-Invert Logic. Example : for a 4- input AND-OR-Invert logic circuit, the output X is LOW(0) if both inputs A and B are HIGH(1) or both input C and input D are HIGH(1). 6
  • 7. Basic Combinational Logic Circuits Exclusive-OR logic • Although, because of its importance Exclusive-OR is considered as a type of logic gate with its own unique symbol. It is actually a combination of 2 AND gates, 1 OR gate and 2 inverters. X = A𝐵 + 𝐴B X = A ⨁ B 7
  • 8. Basic Combinational Logic Circuits Exclusive- NOR logic • Implemented by simply inverting the output of an exclusive-OR. X = A𝐵 + 𝐴B = 𝐴𝐵 + AB X = A⨀B 8
  • 9. Combinational Logic using NAND and NOR Gates • NAND and NOR gates can be used to implement a logic function. • The NAND gate also exhibits an equivalent operation called the negative-OR 𝑨𝑩 =𝑨 + 𝑩 . • The NOR gate also exhibits an equivalent operation called the negative-AND 𝑨 + 𝑩 =𝑨𝑩. • Use of the appropriate symbols to represent the equivalent operation makes the “reading” a logic diagram easier (bubble to bubble). Example 1: NAND Logic for X=AB+CD 9
  • 10. Combinational Logic using NAND and NOR Gates Example 2: NOR Logic for X=(A+B)(C+D) Exercise: 1. Implement the expression X = (𝑨 + 𝑩 + 𝑪)𝑫𝑬 by using NAND logic. 2. Implement the expression X = 𝑨𝑩𝑪 + 𝑫 + 𝑬 by using NOR logic. 10
  • 11. Functions of Combinational Logic • When logic gates are connected together to produce a specified output for certain specified combinations of input variables with no storage involved; the resulting circuit is in the category of Combinational logic. • In combinational logic , the output level is at all times dependent on the combination of input levels. • A combinational circuit consists of an interconnection of logic gates. • Combinational logic gates react to the values of the signals at their inputs and produce the value of the output signal, transforming binary information from the given input data to a required output data. • A block diagram of a combinational circuit is shown in figure below. The n input binary variables come from an external source; the m output variables are produced by the internal combinational logic circuit and go to an external destination. 11
  • 12. Implementing Combinational Logic Design Procedure • The design of combinational circuits starts from the specification of the design objectives and is converted to a set of Boolean functions from which the logic diagram can be obtained. • The procedure involves the following steps; I. Determine the required number of inputs and outputs and assign a symbol to each. II. Derive the truth table that defines the required relationship between inputs and outputs. III. Obtain the simplified Boolean functions for each output as a function of the input variables. IV. Draw the logic diagram and verify the correctness of the design. 12
  • 13. Binary Adder and Subtractor • Digital computers perform a variety of information-processing tasks. Among the functions encountered are the various arithmetic operations. • The most basic arithmetic operation is the addition of two binary digits. • An understanding of the basic adder operation is fundamental to the study of digital systems. • This simple addition consists of four possible elementary operations: 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10. • The first three operations produce a sum of one digit but when both augend and addend bits are equal to 1, the binary sum consists of two digits. The higher significant bit of this result is called a carry. 13
  • 14. Binary Adder and Subtractor • When the augend and addend numbers contain more significant digits, the carry obtained from the addition of two bits is added to the next higher order pair of significant bits. • A combinational circuit that performs the addition of two bits is called a half adder. • One that performs the addition of three bits (two significant bits and a previous carry) is a full adder. • The names of the circuits comes from the fact that two Half adders can be employed to implement a full adder. • The basic difference between a full-adder and a half-adder is that the full-adder accepts an input carry. 14
  • 15. Binary Adder and Subtractor Half Adder • From the explanation of a half adder, we find that this circuit needs two binary inputs and two binary outputs. • The input variables designate the augend and addend bits; the output variables produce the sum and carry. • We assign symbols X and Y to the two inputs and S (for sum) and C (for carry) to the outputs. • The truth table for the half adder is listed in the following Table . 15
  • 16. Binary Adder and Subtractor Half Adder Implementation of Half Adder 16
  • 17. Binary Adder and Subtractor Full Adder • A full adder is a combinational circuit that forms the arithmetic sum of three bits. It consists of three inputs and two outputs. • Two of the input variables, denoted by X and Y represent the two significant bits to be added. • The third input Z, represents the carry (Ci )from the previous lower significant position. • Two outputs are necessary because the arithmetic sum of three binary digits ranges in value from 0 to 3 and binary representation of 2 or 3 needs two bits. • The two outputs are designated by the symbols S for sum and C for carry. 17
  • 18. Binary Adder and Subtractor Full Adder • The truth table of the full adder is listed in the following Table. 18
  • 19. Binary Adder and Subtractor Full Adder Implementation of full adder in sum-of-products form Implementation of a full adder with two half adders and an OR gate 19
  • 20. Binary Adder and Subtractor Parallel Binary Adders • Addition of n-bit binary numbers requires the use of a full adder and the process of addition proceeds on a bit-by-bit basis right to left beginning with the least significant bit. • After the least significant bit, addition at each position adds not only the respective bits of the words but must also consider a possible carry bit from addition at the previous position. • Addition of n-bit numbers requires a chain of n full adders or a chain of one-half adder and n-1 full adders. In the former case, the input carry to the least significant position is fixed at 0. • For Example: 4-bit parallel adder 20
  • 21. Binary Adder and Subtractor Parallel Binary Adders Example: 4-bit parallel adder • To demonstrate with a specific example, consider the two binary numbers A = 1011 and B = 0011. Their sum S = 1110 is formed with the four-bit adder as follows: 21
  • 22. Binary Adder and Subtractor Binary Subtractor • The subtraction of binary numbers can be done most conveniently by means of complements. • Remember that the subtraction A - B can be done by taking the 2’s complement of B and adding it to A . • The 2’s complement can be obtained by taking the 1’s complement and adding 1 to the least significant pair of bits. • The 1’s complement can be implemented with inverters and a 1 can be added to the sum through the input carry. • The addition and subtraction operations can be combined into one circuit with one common binary adder by including an exclusive-OR gate with each full adder. 22
  • 23. Binary Adder and Subtractor Binary Subtractor • A four-bit Adder–Subtractor circuit is shown in the following Figure. The mode input M controls the operation. When M = 0, the circuit is an adder and when M = 1, the circuit becomes a Subtractor. • Each exclusive-OR gate receives input M and one of the inputs of B . When M = 0, we have B ⨁ 0 = B. The full adders receive the value of B , the input carry is 0, and the circuit performs A plus B . When M = 1, we have B ⨁ 1 = B and C0 = 1. • The B inputs are all complemented and a 1 is added through the input carry. The circuit performs the operation A plus the 2’s complement of B. 23 Four-bit Adder–Subtractor
  • 24. Magnitude Comparator • The comparison of two numbers is an operation that determines whether one number is greater than, less than, or equal to the other number. • A magnitude comparator is a combinational circuit that compares two numbers A and B and determines their relative magnitudes. • The outcome of the comparison is specified by three binary variables that indicate whether A >B, A = B or A < B. • The circuit for comparing two n -bit numbers has 22n entries in the truth table and becomes too bulky even with n = 3. • Since a comparator circuit possesses a certain amount of regularity. Digital functions that possess an inherent well-defined regularity can usually be designed by means of an algorithm. • The algorithm is a direct application of the procedure a person uses to compare the relative magnitudes of two numbers. 24
  • 25. Magnitude Comparator • Example: Consider two numbers, A and B with four digits each. Write the coefficients of the numbers in descending order of significance: • Each subscripted letter represents one of the digits in the number. The two numbers are equal if all pairs of significant digits are equal: A3 = B3, A2 = B2, A1 = B1, and A0 = B0.It can be expressed logically with an exclusive-NOR function. • The equality of the two numbers A and B is displayed in a combinational circuit by an output binary variable that we designate by the symbol A = B . 25
  • 26. Magnitude Comparator • If the corresponding digit of A is 1 and that of B is 0, we conclude that A > B. If the corresponding digit of A is 0 and that of B is 1, we have A < B. The sequential comparison can be expressed logically by the two Boolean functions. • The symbols (A > B) and (A < B) are binary output variables that are equal to 1 when A > B and A < B, respectively. • The unequal outputs can use the same gates that are needed to generate the equal output. 26
  • 27. Magnitude Comparator The logic diagram of the four-bit magnitude comparator 27
  • 28. Decoder • Discrete quantities of information are represented in digital systems by binary codes. • A binary code of n bits is capable of representing up to 2n distinct elements of coded information. • A decoder is a combinational circuit that converts binary information from n input lines to a maximum of 2n unique output lines. If the n -bit coded information has unused combinations, the decoder may have fewer than 2n outputs. • Each combination of inputs will assert a unique output. • The name decoder is also used in conjunction with other code converters such as a BCD-to-seven-segment decoder. • The decoders presented here are called n -to- m -line decoders, where m ≤ 2n. Their purpose is to generate the 2n (or fewer) terms of n input variables. • Decoder can be developed using AND logic gates. 28 n to m Decoder
  • 29. Decoder Example: The three-to-eight-line (3 to 8) decoder circuit • The three inputs are decoded into eight outputs, each representing one of the product terms of the three input variables. 29 3 to 8 Decoder The operation of the decoder may be clarified by the truth table listed in the Table. For each possible input combination, there are seven outputs that are equal to 0 and only one that is equal to 1.
  • 30. Decoder Decoder with an Enable Input • A decoder with enable input can function as a Demultiplexer— a circuit that receives information from a single line and directs it to one of 2n possible output lines. 30 2 to 4 Decoder Enable A two-to-four-line decoder with an enable input(Enable 0 or Active Low) constructed with NAND gates. 0
  • 31. Decoder Decoder with an Enable Input • In general, enable inputs are a convenient feature for interconnecting two or more standard components for the purpose of combining them into a similar function with more inputs and outputs. • Decoders with enable inputs can be connected together to form a larger decoder circuit. • Example: Two 3-to-8-line decoders with enable inputs connected to form a 4-to-16-line decoder. 31 4 to 16 Decoder Enable 4 x 16 decoder constructed with two 3 x 8 decoders
  • 34. Encoder • An encoder is a digital circuit that performs the inverse operation of a decoder. • An encoder has 2n (or fewer) input lines and n output lines. • The output lines as an aggregate generate the binary code corresponding to the input value. • An encoder can be implemented with OR gates whose inputs are determined directly from the truth table. • It accepts an active level on one of its inputs representing a digit, such as a decimal or octal digit and converts it to a coded output, such as BCD or binary. • The process of converting from familiar symbols or numbers to a coded format is called encoding. 34
  • 35. Encoder Example: Octal-to-Binary (8-to-3)Encoder(Application). • It has eight inputs (one for each of the octal digits) and three outputs that generate the corresponding binary number. • Output z is equal to 1 when the input octal digit is 1, 3, 5or 7. Output y is 1 for octal digits 2, 3, 6, or 7, and output x is 1 for digits 4, 5, 6, or 7. These conditions can be expressed by the following Boolean output functions: • The encoder can be implemented with three OR gates. 35
  • 36. Encoder Example: Decimal-to-BCD Encoder(Application). • It has Ten inputs (one for each of the Decimal digits) and four outputs that generate the corresponding BCD. 36
  • 37. Multiplexer • A multiplexer is a combinational circuit that selects binary information from one of many input lines and directs it to a single output line. • A multiplexer (MUX) is a data selection device that allows digital information from several sources to be routed onto a single line for transmission over that lines to a common destination. • The selection of a particular input line is controlled by a set of selection lines. Normally, there are 2n input lines and n selection lines whose bit combinations determine which input is selected. • A multiplexer acts like an electronic switch that selects one of many sources. 37
  • 38. Multiplexer Example 1: Two-to-one-line multiplexer [connects one of two 1-bit sources to a common destination] • The circuit has two data input lines (I0 & I1), one output line (Y) and one selection line S . When S = 0, the upper AND gate is enabled and I0 has a path to the output. When S = 1, the lower AND gate is enabled and I1 has a path to the output. 38
  • 39. Multiplexer Example 1: A four-to-one-line multiplexer • Each of the four inputs, I0 through I3, is applied to one input of an AND gate. Selection lines S1 and S0 are decoded to select a particular AND gate. • The outputs of the AND gates are applied to a single OR gate that provides the one- line output. • The function table lists the input that is passed to the output for each combination of the binary selection values. 39
  • 40. Demultiplexer • A Demultiplexer (DEMUX) basically reverse the multiplexing function. • It takes digital information form one line and distributes it to a given number of output lines. • Data goes from one line to several lines. • A multiplexer acts like an electronic switch that selects one of many sources. • The demultiplexer is also known as a data distributer. As we have seen, decoders can also be used as demultiplexers. Example : one line to four line Demultiplexer. 40