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

DLD Lecture Notes (Compatibility Mode)

This document discusses number systems and digital logic. It begins by defining analog and digital data, where analog data is continuous and digital data is discrete. It then discusses analog and digital systems, noting analog systems manipulate continuous values while digital systems use discrete values. The document also covers binary, octal, and hexadecimal number systems as well as how computers represent digits using binary. It provides examples of converting between decimal, binary, octal, and hexadecimal numbers.

Uploaded by

Mortuza
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)
102 views

DLD Lecture Notes (Compatibility Mode)

This document discusses number systems and digital logic. It begins by defining analog and digital data, where analog data is continuous and digital data is discrete. It then discusses analog and digital systems, noting analog systems manipulate continuous values while digital systems use discrete values. The document also covers binary, octal, and hexadecimal number systems as well as how computers represent digits using binary. It provides examples of converting between decimal, binary, octal, and hexadecimal numbers.

Uploaded by

Mortuza
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/ 149

Number Systems

EEE365
Digital Logic Design

Dr.Quazi Delwar Hossain


Chittagong University of Engineering and Technology
1St Cycle

Introduction to Number Systems & Codes

Digital & Analog systems, Numerical representation, Digital number systems,


Binary to Decimal conversions, Decimal to Binary conversions, Hexa-decimal
number systems, BCD code, The Gray code, Alphanumeric codes, Parity method
for error detection, Octal & Hexa-decimal numbers, Complements.
ANALOG AND DIGITAL

Data can be analog or digital


 Analog data refers to information that is continuous
 Analog data take on continuous values
 Analog signals can have an infinite number of values in a range

 Digital data refers to information that has discrete states


 Digital data take on discrete values
 Digital signals can have only a limited number of values

In data communications, we commonly use


periodic analog signals and non-periodic digital signals.
ANALOG & DIGITAL SYSTEMS

An Analog system contains devices that manipulate


physical quantities that are represented in analog form.

 In an analog system, the quantities can vary over a


continuous range of values.

 For example, the amplitude of the output signal to the


speaker in a radio receiver can have any value between zero
and its maximum limit.

 Other common analog systems are audio amplifiers,


magnetic tape recording and playback equipment and a
simple light dimmer switch.
Continue………………
A Digital system is a combination of devices designed to
manipulate logical information or physical quantities that
are represented in digital form; that is, the quantities can
take on only discrete values.
These devices are most often electronic, but they can
also be mechanical, magnetic or pneumatic.

Some of the more familiar digital systems include digital


computers, calculator, Digital audio and video equipment
and telephone system etc.
More over, a 1 can be encoded as a positive voltage and a
0 as zero voltage.
 A digital signal can have more than two levels.
 In this case, we can send more than 1 bit for each level.
ADC and DAC Converters
input analog input digital output digital
signals signals signals
Analog-to-Digital Digital-to-Analog
Digital System
Converter (ADC) Converter (DAC)

output analog
signals

• Analog-to-Digital Converter (ADC)


– Produces digitized version of analog signals
– Analog input => Digital output
• Digital-to-Analog Converter (DAC)
– Regenerate analog signal from digital form
– Digital input => Analog output
• Our focus is on digital systems only
– Both input and output to a digital system are digital signals
DIGITAL SYSTEMS
DIGITAL SYSTEM STRUCTURE
Analog Signal

Digital Signal
Advantages of Digital Techniques
 Very much easier to design.

 Information storage is easy.

 Accuracy and precision are easier to maintain throughout


the system.

 Operation can be programmed.

Less affected by noise.

More circuits can be fabricated on IC chips.

Limitations of Digital Techniques:

 The real world is analog

Processing digitized signals takes time.


How do Computers Represent Digits?

• Binary digits (0 and 1) are used instead of decimal digits


• Using electric voltage

Voltage Level
High = 1
– Used in processors and digital circuits
– High voltage = 1, Low voltage = 0 Unused
• Using electric charge
Low = 0
– Used in memory cells
– Charged memory cell = 1, discharged memory cell = 0
• Using magnetic field
– Used in magnetic disks, magnetic polarity indicates 1 or 0
• Using light
– Used in optical disks, surface pit indicates 1 or 0
Binary Numbers

• Each binary digit (called a bit) is either 1 or 0

• Bits have no inherent meaning, they can represent …


– Unsigned and signed integers

– Fractions
Most Least
– Characters Significant Bit Significant Bit

– Images, sound, etc. 7 6 5 4 3 2 1 0


1 0 0 1 1 1 0 1
27 26 25 24 23 22 21 20
• Bit Numbering
– Least significant bit (LSB) is rightmost (bit 0)

– Most significant bit (MSB) is leftmost (bit 7 in an 8-bit number)


Decimal Value of Binary Numbers

• Each bit represents a power of 2


• Every binary number is a sum of powers of 2
• Decimal Value = (dn-1 × 2n-1) + ... + (d1 × 21) + (d0 × 20)
• Binary (10011101)2 = 27 + 24 + 23 + 22 + 1 = 157

7 6 5 4 3 2 1 0
1 0 0 1 1 1 0 1
27 26 25 24 23 22 21 20

Some common
powers of 2
Positional Number Systems
Different Representations of Natural Numbers

XXVII Roman numerals (not positional)


27 Radix-10 or decimal number (positional)
110112 Radix-2 or binary number (also positional)
Fixed-radix positional representation with n digits
Number N in radix r = (dn–1dn–2 . . . d1d0)r
Nr Value = dn–1×r n–1 + dn–2×r n–2 + … + d1×r + d0
Examples: (11011)2 = 1×24 + 1×23 + 0×22 + 1×2 + 1 = 27
(2107)8 = 2×83 + 1×82 + 0×8 + 7 = 1095
Other Number Systems
• Binary Number System: Radix = 2
– Only two digit values: 0 and 1
– Numbers are represented as 0s and 1s
• Octal Number System: Radix = 8
– Eight digit values: 0, 1, 2, …, 7
• Decimal Number System: Radix = 10
– Ten digit values: 0, 1, 2, …, 9
• Hexadecimal Number Systems: Radix = 16
– Sixteen digit values: 0, 1, 2, …, 9, A, B, …, F
– A = 10, B = 11, …, F = 15
• Octal and Hexadecimal numbers can be converted easily
to Binary and vice versa
Octal and Hexadecimal Numbers

Decimal Binary Octal Hex


• Octal = Radix 8 Radix 10 Radix 2 Radix 8 Radix 16
0 0000 0 0
• Only eight digits: 0 to 7 1 0001 1 1
2 0010 2 2
• Digits 8 and 9 not used 3 0011 3 3
4 0100 4 4
• Hexadecimal = Radix 16 5 0101 5 5
6 0110 6 6
• 16 digits: 0 to 9, A to F 7 0111 7 7
8 1000 10 8
• A=10, B=11, …, F=15 9 1001 11 9
10 1010 12 A
• First 16 decimal values 11 1011 13 B
(0 to15) and their values 12 1100 14 C
13 1101 15 D
in binary, octal and hex.
14 1110 16 E
Memorize table 15 1111 17 F
Binary, Octal, and Hexadecimal
 Binary, Octal, and Hexadecimal are related:
Radix 16 = 24 and Radix 8 = 23

 Hexadecimal digit = 4 bits and Octal digit = 3 bits

 Starting from least-significant bit, group each 4 bits into


a hex digit or each 3 bits into an octal digit
 Example: Convert 32-bit number into octal and hex

3 5 3 0 5 5 2 3 6 2 4 Octal
1 1 1 0 1 0 1 1 0 0 0 1 0 1 1 0 1 0 1 0 0 1 1 1 1 0 0 1 0 1 0 0 32-bit binary
E B 1 6 A 7 9 4 Hexadecimal
Conversion from Decimal to base r

The conversion is done as follows:


1) If the number has a radix point then separate the
number into an integer part and a fraction part, since the
two parts must be converted differently.
2) The conversion of a decimal integer part to a number in
base r is done by dividing the integer part and all
successive quotients by r and accumulating the
remainders.
3) The conversion of a decimal fraction part to a number
in base r is done by multiplying the fractional parts by r
and accumulating integers.
Convert Decimal to Binary

• Repeatedly divide the decimal integer by 2


• Each remainder is a binary digit in the translated value
• Example: Convert 3710 to Binary

least significant bit

37 = (100101)2

most significant bit

stop when quotient is zero


Convert Decimal to Binary
Convert Decimal to Octal

Convert decimal (153.513)10 to Octal

The Octal number is (231.406517)8


Converting Decimal to Hexadecimal
 Repeatedly divide the decimal integer by 16
 Each remainder is a hex digit in the translated value
 Example: convert 422 to hexadecimal

least significant digit

most significant digit

422 = (1A6)16 stop when


quotient is zero

 To convert decimal to octal divide by 8 instead of 16


Conversion from base r to Decimal
 The conversion of a number in base r to decimal number (base 10) is
done by expanding the number in power series and adding all the terms as
shown below:

Convert Binary (base 2) to Decimal (base 10)

Convert base 5 to Decimal (base 10)

Convert Octal (base 8) to Decimal (base 10)

Convert Hexadecimal (base 16) to Decimal (base 10)


Other Conversions
Second Cycle

Analysis & synthesis of digital logic circuits


Basic logic functions

OR operation with OR gates, AND operation with AND gates, NOR operation
with NOR gates, Describing logic circuits algebraically, Evaluating logic circuit
outputs, Implementing circuits from Boolean expressions, NOR gates & NAND
gates.

Boolean Algebra

Boolean theorems, Demorgan’s Theorems, Universality of NAND gates & NOR


gates
DIGITAL LOGIC GATES
Logic gates

 Boolean functions are implemented in digital computer


circuits called gates.
 A gate is an electronic device that produces a result
based on two or more input values.
– In reality, gates consist of one to six transistors, but
digital designers think of them as a single unit.
– Integrated circuits contain collections of gates suited
to a particular purpose.
Point’s Need To Understand

 Electronic gates require a power supply.

 Gate Input’s are driven by voltage having two nominal


values.

 The Output of a gate provides two nominal values of


voltage.

 There is always a Time Delay between an input being


applied and the output responding.
Different Types of Logic gates
Digital systems are said to be constructed by using
gates. These gates are --

 AND GATE
 OR GATE
 NOT GATE
 NAND GATE
 NOR GATE
 Ex-OR GATE
 Ex-NOR GATE
Truth Tables
 Used to describe the functional behavior of a Boolean
expression and/or Logic circuit.
 Each row in the truth table represents a unique combination
of the input variables.
− For n input variables, there are 2n rows.
 The output of the logic function is defined for each row.
 Each row is assigned a numerical value, with the rows listed
in ascending order.
 The order of the input variables defined in the logic
function is important.
AND Gate
 The AND gate is an electronic circuit that gives a high
output only if all its inputs are high.
A dot(.) is used to show the AND operation.

Truth table
Circuit Symbol
2 Input AND gate
A Z=A.B A B Z=A.B
0 0 0
B
0 1 0
AND 1 0 0
1 1 1
Summary of the AND gates

 The AND operation is performed the same as ordinary


multiplication of 1s and 0s.

 An AND gate is a logic circuit that performs the AND


operation on the circuit’s input.

An AND gate output will be 1 only for the case when all
inputs are 1; for all other cases, the output will be 0.

The expression Z=A.B is read as “Z equals A AND B.”


OR Gate
 The OR gate is an electronic circuit that gives a high
output. One or more of its inputs are high.

A plus (+) is used to show the OR operation.

Circuit Symbol Truth table

2 Input OR gate
A Z=A+B A B Z=A+B
B 0 0 0
0 1 1
OR 1 0 1
1 1 1
Summary of the OR gates

 The OR operation produces a result (output) of 1


whenever any input is a1. Otherwise the output is 0.

 An OR gate is a logic circuit that performs an OR


operation on the circuit’s input.

The expression Z=A+B is read as “Z equals A OR B.”


NOT Gate
 The NOT gate is an electronic circuit that produces an
inverted version of the input at its output.
 More commonly called an Inverter.

Circuit Symbol Truth table

NOT GATE
A A A A
0 1
1 0
NAND Gate

 The NAND gate which is to NOT - AND gate.

Truth table

2 Input NAND gate


Circuit Symbol
A B A.B
A 0 0 1
A.B
B 0 1 1
1 0 1
NAND
1 1 0
NOR Gate

 The NOR gate which is to NOT - OR gate.

Truth table

2 Input NOR gate


Circuit Symbol
A B A+B
A A+B 0 0 1
B 0 1 0
1 0 0
NOR
1 1 0
EX-OR Gate
 The Exclusive –OR gate is a circuit which will give a high
output.An encircled plus sign(⊕) is used to show the EX-OR
operation.
Truth table
Circuit Symbol
2 Input EXOR gate

A A⊕B A B A ⊕B
B 0 0 0
0 1 1
EX-OR 1 0 1
1 1 0
EX-NOR Gate
 The Exclusive –NOR gate is circuit does the opposite to the
EX-NOR gate. The symbol is an EX-NOR gate with a small
circle on the output. The small circle represents inversion.

Truth table

Circuit Symbol 2 Input EXNOR gate

A⊕B A B A ⊕B
A
0 0 1
B
0 1 0
EX-NOR 1 0 0
1 1 1
Universal Gates
 NAND and NOR are known as universal gates because
they are inexpensive to manufacture and any Boolean
function can be constructed using only NAND or only
NOR gates.
Boolean Expressions

 Boolean expressions are composed of


 Literals – variables and their complements
 Logical operations
 Examples
 F = A.B'.C + A'.B.C' + A.B.C + A'.B'.C'

literals logic operations

 F = (A+B+C').(A'+B'+C).(A+B+C)
 F = A.B'.C' + A.(B.C' + B'.C)
Boolean Expressions

 Boolean expressions are realized using a network


(or combination) of logic gates.
− Each logic gate implements one of the logic
operations in the Boolean expression
− Each input to a logic gate represents one of the
literals in the Boolean expression
A
B
literals logic operations

f
Boolean Expressions
 Boolean expressions are evaluated by
 Substituting a 0 or 1 for each literal.
 Calculating the logical value of the expression.

 A Truth Table specifies the value of the Boolean


expression for every combination of the variables
in the Boolean expression.

 For an n-variable Boolean expression, the truth


table has 2n rows (one for each combination).
Boolean Algebra

 George Boole developed an algebraic description for


processes involving logical thought and reasoning.
− Became known as Boolean Algebra
 Claude Shannon later demonstrated that Boolean
Algebra could be used to describe switching circuits.
− Switching circuits are circuits built from devices that
switch between two states (e.g. 0 and 1).
− Switching Algebra is a special case of Boolean
Algebra in which all variables take on just two
distinct values
 Boolean Algebra is a powerful tool for analyzing and
designing logic circuits.
Basic Laws and Theorems
Commutative Law A+B=B+A A.B = B.A
Associative Law A + (B + C) = (A + B) + C A . (B . C) = (A . B) . C
Distributive Law A.(B + C) = AB + AC A + (B . C) = (A + B) . (A + C)
Null Elements A+1=1 A.0=0
Identity A+0=A A.1=A
Idempotence A+A=A A.A=A
Complement A + A' = 1 A . A' = 0
Involution A'' = A
Absorption (Covering) A + AB = A A . (A + B) = A
Simplification A + A'B = A + B A . (A' + B) = A . B
DeMorgan's Rule (A + B)' = A'.B' (A . B)' = A' + B'
Logic Adjacency (Combining) AB + AB' = A (A + B) . (A + B') = A
Consensus AB + BC + A'C = AB + A'C (A + B) . (B + C) . (A' + C) = (A + B) . (A' + C)
DeMorgan's Laws

 Can be stated as follows:


− The complement of the product (AND) is the
sum (OR) of the complements.
 (X.Y)' = X' + Y'
− The complement of the sum (OR) is the
product (AND) of the complements.
 (X + Y)' = X' . Y'
 Easily generalized to n variables.
 Can be proven using a Truth table
Proving DeMorgan's Law

(X . Y)' = X' + Y'


DeMorgan's Theorems

x1
x1 x1
x2 x2
x2

(a) x1 x2 = x1 + x2

x1
x1 x1
x2 x2
x2

(b) x1 + x2 = x1 x2
Importance of Boolean Algebra
 Boolean Algebra is used to simplify Boolean expressions.
– Through application of the Laws and Theorems
discussed
 Simpler expressions lead to simpler circuit realization,
which, generally, reduces cost, area requirements, and
power consumption.
 The objective of the digital circuit designer is to design
and realize optimal digital circuits.
Algebraic Simplification
 Justification for simplifying Boolean expressions:
– Reduces the cost associated with realizing the
expression using logic gates.
– Reduces the area (i.e. silicon) required to
fabricate the switching function.
– Reduces the power consumption of the circuit.
 In general, there is no easy way to determine when a
Boolean expression has been simplified to a minimum
number of terms or minimum number of literals.
– No unique solution
Algebraic Simplification

 Boolean (or Switching) expressions can be


simplified using the following methods:
1. Multiplying out the expression.
2. Factoring the expression.
3. Combining terms of the expression.
4. Eliminating terms in the expression.
5. Eliminating literals in the expression
6. Adding redundant terms to the expression.
Examples
Minterms

 A minterm, for a function of n variables, is a


product term in which each of the n variables
appears once.
 Each variable in the minterm may appear in its
complemented or uncomplemented form.
 For a given row in the Truth table, the
corresponding minterm is formed by
− Including variable xi, if xi = 1 For all n variables
in the function F.

− Including the complement of xi, if xi = 0


Minterms
Maxterms
 A Maxterm, for a function of n variables, is a sum
term in which each of the n variables appears once.
 Each variable in the Maxterm may appear in its
complemented or uncomplemented form.
 For a given row in the Truth table, the
corresponding Maxterm is formed by
− Including the variable xi, if xi = 0
− Including the complement of xi, if xi = 1
Maxterms
Standard Forms for
Boolean Expressions

 Sum-of-Products (SOP)
− Derived from the Truth table for a function by
considering those rows for which F = 1.
− The logical sum (OR) of product (AND) terms.
− Realized using an AND-OR circuit.
 Product-of-Sums (POS)
− Derived from the Truth table for a function by
considering those rows for which F = 0.
− The logical product (AND) of sum (OR) terms.
− Realized using an OR-AND circuit.
Sum-of-Products
 Any function F can be represented by a sum of minterms,
where each minterm is ANDed with the corresponding
value of the output for F.
− F = ∑ (mi . fi)
 where mi is a minterm
Denotes the logical
sum operation  and fi is the corresponding functional
output
− Only the minterms for which fi = 1 appear in the
expression for function F.
− F = ∑ (mi) = ∑ m(i) shorthand notation
Sum-of-Products
AND sum

Y' + X'YZ' + XY

X.Y
OR

AND product term

Product Term = Logical ANDing of literals


Sum = Logical ORing of product terms
Sum-of-Products

 Use the Distributive Laws to multiply out a Boolean


expression.
 Results in the Sum-of-Products (SOP) form.

F = (A + B).(C + D).(E)
F = (A.C + A.D + B.C + B.D).(E)
Product terms are
F = A.C.E + A.D.E + B.C.E + B.D.E of single variables

not in SOP form H = A.B.(C + D) + ABE


Examples

Answe The function has three variables, A, B, and C. The first term A is missing
r: two variables; therefore:
Product-of-Sums (POS)
Product-of-Sums
 Any function F can be represented by a product of
Maxterms, where each Maxterm is ANDed with the
complement of the corresponding value of the
output for F.
− F = Π (Mi . f 'i)
 where Mi is a Maxterm
Denotes the logical  and f 'i is the complement of the
product operation
corresponding functional output
− Only the Maxterms for which fi = 0 appear
in the expression for function F.
− F = Π (Mi) = Π M(i) shorthand notation
Product-of-Sums

OR product term

X.(Y' + Z).(X' + Y + Z)

X' + Y + Z
AND

sum term
OR

Sum Term = Logical ORing of variables


Product = Logical ANDing of sum terms
Product-of-Sums

 Use the Distributive Laws to factor a Boolean


expression.
 Results in the Product-of-Sums (POS) form.

F = V.W.Y + V.W.Z + V.X.Y + V.X.Z


F = (V).(W.Y + W.Z + X.Y + X.Z)
Sum terms are
F = (V).(W + X).(Y + Z) of single variables

not in POS form H = (A+B).(C+D+E) + CE


SOP and POS
 Any function F may be implemented as either a Sum-of-
Products (SOP) expression or a Product-of-Sums (POS)
expression.
 Both forms of the function F can be realized using logic
gates that implement the basic logic operations.
 However, the two logic circuits realized for the function F
do not necessarily have the same cost.
 Objective: minimize the cost of the designed circuit
− Compare the cost of the SOP realization with
that of the POS realization
Converting between SOP and POS

 The sum-of-products (SOP) form of a Boolean


expression can be converted to its corresponding
product-of-sums (POS) form by factoring the
Boolean expression.

 The product-of-sums (POS) form of a Boolean


expression can be converted to its corresponding
sum-of-products (SOP) form by multiplying out
the Boolean expression.
Examples
Karnaugh Map
What are Karnaugh maps?

• Karnaugh maps provide an alternative way of


simplifying logic circuits.

• Instead of using Boolean algebra simplification


techniques, you can transfer logic values from a
Boolean statement or a truth table into a Karnaugh
map.

• The arrangement of 0's and 1's within the map helps


you to visualize the logic relationships between the
variables and leads directly to a simplified Boolean
statement.
Product of Sums Simplification (1/3)

• All previous examples are in sum-of-products form (F =


A’B’E’ + ACE + BD’E )
•  How to obtain the product-of-sum form
– Simplified F' in the form of sum of products
– Apply DeMorgan's theorem F = (F ')'
– F': sum of products => F : product of sums
Product of Sums Simplification (2/3)
Simplify F(A,B,C,D) = ∑(0,1,2,5,8,9,10) in product of sums

Minterms marked ‘0’s


represent F’

F=B’D’+B’C’+A’C’D
Combine ‘0’ terms for F’
F’ = ∑(3,4,6,7,11,12,13,14,15)
= AB + CD + BD’
By DeMorgan,
F = (A’+B’)(C’+D’)(B’+D)

sum of products  product of sums


Product of Sums Simplification (3/3)

F=B’D’+B’C’+A’C’D F = (A’+B’)(C’+D’)(B’+D)

Sum-of-Product (SOP) Product-of-Sum (POS)


Truth Table  MAP  Standard
Truth Table → Map → Standard forms
Ex. Table 3-2 (a) Combine 1’s

x y z F (a) SOP
0 0 0 0 F(x,y,z) = Σ (1,3,4,6)
0 0 1 1 = x’z + xz’
0 1 0 0
0 1 1 1
1 0 0 1 (b) Combine 0’s
1 0 1 0
(b) POS
1 1 0 1
1 1 1 0 F’(x,y,z) = Σ (0,2,5,7)
= xz + x’z’
F(x,y,z)=(x’+z’)(x+z)
don’t care!
• You don’t always need all 2n input combinations in an n-variable function.
– If you can guarantee that certain input combinations never occur.
– If some outputs aren’t used in the rest of the circuit.
• We mark don’t-care outputs in truth tables and K-maps with Xs.

x y z f(x,y,z)
0 0 0 0
0 0 1 1
0 1 0 X
0 1 1 0
1 0 0 0
1 0 1 1
1 1 0 X
1 1 1 1

• Within a K-map, each X can be considered as either 0 or 1. You should pick


the interpretation that allows for the most simplification.
Don’t Care Conditions
• A don’t care condition, marked by (X) in the truth table,
indicates a condition where the design doesn’t care if the
output is a (0) or a (1).
• A don’t care condition can be treated as a (0) or a (1) in a K-
Map.
• Treating a don’t care as a (0) means that you do not need to
group it.
• Treating a don’t care as a (1) allows you to make a grouping
larger, resulting in a simpler term in the SOP equation.
Don’t-care Conditions

• the function is NOT specified for the minterms


• 6 combinations are unspecified in 4-bit BCD (1010-
1111)
• those don’t care inputs won’t occur in real circuit
• include the don’t-care minterms with either 1 or 0
– depends on which combination gives the simplest
expression (less gates ?lower cost ?)
Simplification with don’t care Conditions
Ex.3-9 Simplify F(w,x,y,z) = Σ(1,3,7,11,15)
which has the don’t care conditions d(w,x,y,z) = ∑ (0,2,5)

• Sum of products • Product of sums


Combine 1’s: F = yz + w’x’z Combine 0’s & some
Combine 1’s and some X’s X’s
F’ = z’ + wy’
(i) F = yz + w’x’ (ii) F = yz + w’z F = z(w’ + y)
Some You Group, Some You Don’t

This don’t care condition was treated as a (1).


C VC
This allowed the grouping of a single one to
AB X 0 become a grouping of two, resulting in a simpler
term.
AC AB 1 0

AB 0 0

AB X 0

There was no advantage in treating this


don’t care condition as a (1), thus it was
treated as a (0) and not grouped.
Example: Seven Segment Display
A B C D e
Input: digit encoded as 4 bits: ABCD 0 0 0 0 0 1
a 1 0 0 0 1 0
Table for e
f b 2 0 0 1 0 1
Assumption: Input
g represents a legal 3 0 0 1 1 0
e c digit (0-9) 4 0 1 0 0 0
5 0 1 0 1 0
d
6 0 1 1 0 1

CD 7 0 1 1 1 0
00 01 11 10
AB 8 1 0 0 0 1
00 1 0 0 1 9 1 0 0 1 0
X X
01 0 0 0 1
X X
11 X X X X X X

10 1 0 X X X X
X X
CD’ + B’D’
X X
Example: Seven Segment Display
A B C D a
a
0 0 0 0 0 1
f b
Table for a 1 0 0 0 1 0
g 2 0 0 1 0 1
e c
3 0 0 1 1 1

d 4 0 1 0 0 0
5 0 1 0 1 1
CD 6 0 1 1 0 1
00 01 11 10
AB
7 0 1 1 1 1
00 1 1 1 1 0 0 0 1
8
01 1 1 1 9 1 0 0 1 1
X X
11 X X X X
X X
10 1 1 X X X X
X X
A + C + BD + B’D’
X X
X X
BCD Display (1/6)
BCD Display (2/6)
BCD Display (3/6)
BCD Display (4/6)

a = w + y + x’z’ + xz
b = y’ + xz’
c = w + y’z’ + yz + x’z’
d = w + xy’ + yz’ + x’y
e = yz’ + x’z’ + w’x’y’
f = w + x + y’z’ + yz
g = x’z’ + yz’ + x’y + xy’z
BCD Display (5/6)
BCD Display (6/6)
NAND gate implementation
NAND & NOR Implementation (1/2)
• NAND / NOR
– basic gates used in all IC digital logic families
– Need conversion from AND/OR/NOT into
NAND/NOR
• Compare with AND/OR
– Digital circuits are frequently constructed with
NAND/NOR rather than with AND/OR gates.
– NAND and NOR gates are easier to fabricate with
electronic components than AND/OR
– Cheaper (lower cost) and faster (less delay)
NAND & NOR Implementation (2/2)

Real delay
depends on
the VLSI
process tech.

.35
.25
.18
.13 um
.09  90 nm
NAND
• A “universal” gate
– any digital system can be implemented with it
• AND, OR, NOT can be obtained from NAND gates
NAND
= x
0
y
0
(xy)’
1
0 1 1
1 0 1
1 1 0

One-input
NAND
x x’
0 1
1 0
Two Graphic Symbols for NAND Gate

• 2 equivalent graphic symbols for NAND gate


– either is acceptable
Two-Level Implementation with NAND
• Boolean function in sum of products form (AND-OR)
• DeMorgan’s theorem
F = AB + CD = ((AB)’(CD)’)’ // 2-level NAND
implementation
• “AND-OR” diagram → “NAND-NAND” (all NAND diagram)
AB

AB+CD
CD

(AB)’

= ((AB)’(CD)’)’
= (CD)’
= (AB)’’+(CD)’’
=AB+CD
2-Level NAND Implementation
Ex 3-10 Implement F(x,y,z)=∑(1,2,3,4,5,7)
with NAND gates
1. Simplify F(x,y,z) in sum of products by
means of “map”.
1
2. Draw a NAND gate for each product term 2
with at least 2 literals. 3

3. Draw a single NAND gate in the 2nd level


with inputs coming from outputs of 1st
level. 4

4. A term with a single literal requires an


inverter in the 1st level.

• If the single literal is complemented, it


can be connected directly to an input of
the 2nd level NAND gate.
4-Level NAND Circuits
• convert AND-OR into all-NAND by
– AND-OR  AND-invert - invert-OR
– insert an inverter if a bubble is not complemented by
another bubble in the same line

F = A(CD + B) + BC’
3-Level of Gating
Ex.2 F = (AB’ + A’B)(C+D’)
NOR Implementation
• A universal gate
• The dual of NAND
– All procedures/rules for NAND are dual of the
corresponding procedures/rules for NOR
NOR
• NOT OR AND implemented with NOR x y (x+y)’
0 0 1
0 1 0
1 0 0
1 1 0

One-input
NOR
x x’
0 1
1 0
Graphic Symbols for NOR Gate

• Two graphic symbols


2-level NOR Implementation

• Requirement
– the Boolean function in product of sums
• map  combining 0’s  complementing
• “OR-AND” diagram → all-NOR diagram
“NOR-NOR”
• Multilevel implementation – similar to
the one for NAND
2-level NOR Implementation

Example: F = (A + B)(C + D)E

Fig. 3.26
Implementing
F = (A + B)(C + D)E
3-level NOR Implementation

Example: F = (AB′ +A′B)(C + D′)

Fig. 3.27 Implementing F = (AB′ +A′B)(C + D′) with NOR gates


Different Implementations
AND-OR-INVERT Functions
• Implement the circuit with AND-NOR or NAND-AND
• AND-NOR = NAND-AND F = (AB+CD+E)’
Example of Function Implementations (1/2)
F’ = x’y + xy’ + z
• F = (x’y + xy’+ z)’

(combining 1’s)
(combining 0’s)
OR-AND-INVERT Functions
• Implement the circuit with OR-NAND or NOR-OR
• OR-NAND = NOR-OR F = [(A+B)(C+D)E)]’
Example of Function Implementations (2/2)
F = x’y’z’ + xyz’
F’=(x+y+z)(x’+y’+z) F = [(x+y+z)(x’+y’+z)]’

(combining 1’s)
(combining 0’s)
Three-Input Circuit
Mir has three girl friends. He want to design an alarm.

Ring the alarm when more than one girl come.


w= x'yz + xy'z+ xyz' + xyz
X Y Z W
0 0 0 0
z x y 00 01 11 10
input 0 0 1 0
0 1 0 0
0 1
0 1 1 1 output
1 0 0 0 1 1 1 1
1 0 1 1
1 1 0 1
z x y 00 01 11 10
1 1 1 1
simplification
0 1

w= xy + yz+ xz 1 1 1 1
Three-Input Circuit
X Y Z W z x y 00 01 11 10
0 0 0 0
input 0 0 1 0 1
0
0 1 0 0
0 1 1 1 output 1 1 1 1
1 0 0 0
1 0 1 1
w= xy + yz+ xz
1 1 0 1
1 1 1 1

x x xy

Low cost y o y yz o
Less delay
z z xz
Exclusive-OR (Ex-OR)
Ex-OR
x y x⊕y
• Exclusive-OR (Ex-OR) 0 0 0
0 1 1
x y = xy’ + x’y 1 0 1
1 1 0
• x=1 or y=1 but not both
• different inputs  output = 1 Ex-NOR
x y (x⊕y)’
• only one input equal to 1  output = 1 0 0 1
0 1 0
• Exclusive-NOR 1 0 0
1 1 1
(x ʘ y) = xy + x’y’
• same inputs (both=1 or both=0) ⇒ output = 1
• Ex-OR is the complement of Exclusive-NOR
[proof] (x y)’ = (xy’+x’y)’ = (x’+y)(x+y’)
= xy +x’y’
Properties of Ex-OR

x 0=x
Ex-OR
x 1 = x’ x y x⊕y
x x=0 0 0 0
0 1 1
x x’ = 1 1 0 1
x y’ = x’ y = (x y)’ 1 1 0

• x,y’ different? ≣ x,y same?


x y =y x
• x,y different? ≣ y,x different?
(x y) z = x (y z) = x y z
• an odd number of variables equal to 1  Ex-OR
function = 1
Implementation of Ex-OR
xy’
• Multiple-input exclusive-OR
– is difficult to fabricate.
• Even a two-input Ex-OR
– is usually constructed with other
x’y
types of gates
• Implementation
(a) 2 INV, 2 AND, 1 OR
(xy)’=(x’+y’)
(b) 4 NAND
• (xy)’ = (x’+y’)
• (x’+y’)x + (x’+y’)y = xy’+ x’y
Odd Function
• An odd function = 1 when an odd number of variables is
equal to 1
• The multiple-variable exclusive-OR operation is defined
as an odd function
• due to the requirement that an odd number of
variables be equal to 1  Ex-OR function = 1,
• 3-variable Ex-OR
• = sum of 4 minterms 001, 010, 100, 111
• Each of these binary numbers has an odd number
of 1’s
• n-variable Ex-OR
• = sum of 2n-1 minterms
• whose binary numbers have an odd number of 1’s
Even Function
• An even function = 1 when an even number (or none) of
variables is equal to 1.
• Complement of an odd function.
Three-Variable Ex-OR Function
F=A B C (odd)  G = (A B C)’ (even)
= (AB’+A’B)C’ + (AB+A’B’)C
= Σ(1,2,4,7)
Four-variable Ex-OR Function
• F=A B C D (odd)  G = (A B C D)’ (even)
Parity Generation & Checking
• Ex-OR functions are useful in
– Error-detection and correction circuits
• Parity generator
– the CKT that generates the parity bit in the transmitter.
• Parity checker
– the CKT that checks the parity in the receiver.
• a even parity bit: P = x⊕y⊕z
• even parity check: C = x⊕y⊕z⊕P
• C=1: an odd number of data bit error
• C=0: correct or an even # of data bit error
Parity Generation and Checking

Receiver When C=0, no error or


Transmitter
even errors

When C=1, odd errors!


Combinational Logic
Circuits
Design Procedure

 The problem is stated.

The number of available input variables and required output variables is


determined.

The input and output variables are assigned letter symbols.

The truth table that defines the required relationships between inputs and
outputs is derived.

The simplified Boolean function for each output is obtained.

The logic diagram is drawn.


Design Procedure

The practical design method would have to consider such constraints as ---

 Minimum number of gates

 Minimum number of inputs to a gate.

 Minimum propagation time of the signal through the circuit.

 Minimum number of interconnections and

 Limitations of the driving capabilities of each gate.


Combinational Circuits- Half Adder Circuit

• Combinational logic circuits


give us many useful devices.

• One of the simplest is the


half adder, which finds the
sum of two bits.

• We can gain some insight as


to the construction of a half
adder by looking at its truth
table, shown at the right.
Combinational Circuits - Half Adder Circuit

• As we see, the sum can be found using the XOR operation


and the carry using the AND operation.

Sum (S)=x’y + xy’


Carry (C)=xy
Combinational Circuits- Full Adder Circuit

• We can change our half


z
adder into to a full adder by
including gates for
processing the carry bit.

• The truth table for a full


adder is shown at the right.
Combinational Circuits- Full Adder
Circuit

• How can we change the


half adder shown below
to make it a full adder?
Combinational Circuits

• Just as combined half adders to make a full adder, full adders


can connected in series.
• The carry bit “ripples” from one adder to the next; hence, this
configuration is called a ripple-carry adder.

Today’s systems employ more efficient adders.


Combinational Circuits-Full Adder Circuit

• Here’s completed full adder.


Combinational Circuits- Half Subtractor Circuit

• Combinational logic circuits


give us many useful devices.

• Another simplest circuit is


the half-subtractor, which
finds the subtract of two bits.

• We can gain some insight as


to the construction of a half
subtractor by looking at its
truth table, shown at the
right.
Combinational Circuits - Half Subtractor
Circuit

• As we see, the sum can be found using the XOR operation


and the carry using the AND operation.

Difference (D)=x’y + xy’


Borrow (B)=x’y
Combinational Circuits-Full Subtractor
Circuit

 Here’s completed full subtractor.


Code Conversion
• BCD code to Excess-3 code
K-Maps for conversion
Circuit for conversion
Combinational MSI Circuits
• Decoders are another important type of combinational
circuit.
• Among other things, they are useful in selecting a
memory location according a binary value placed on the
address lines of a memory bus.
• Address decoders with n inputs can select any of 2n
locations.

This is a block
diagram for a
decoder.
3 x 8 Decoder

Truth table of a 3-to-8 line Decoder


3 x 8 Decoder
• This is what a 3-to-8 decoder looks like on the inside.
2 x 4 Decoder

• This is what a 2-to-4 decoder looks like on the inside.


Example
• Implement a full-adder circuit with a decoder and two or Gate.
From the truth table of the full-adder circuit , we obtain the functions
for this circuit in sum of minterms:

Truth Table for Full-Adder


Circuit
Circuit Diagram

A full-adder circuit with a decoder and two OR Gate.


2-to--4 line decoder with enable gate

• This is what a 2-to-4 decoder looks like on the inside.


Example

 Construction of 4 x 16 Decoder using two 3 x 8 Decoder


Encoder

An encoder is a digital circuit that performs the inverse operation of a decoder. An


encoder has 2n lines and n output lines.

The output lines generate the binary code corresponding to the input value.

Truth table of Octal-to –Binary Encoder


Octal-to- Binary Encoder
Output Boolean Function
Multiplexer

 A multiplexer does just the opposite


of a decoder.
 It selects a single output from
several inputs.
 The particular input chosen for
output is determined by the value of
the multiplexer’s control lines.
Block Diagram for a
 To be able to select among n inputs, Multiplexer.
log2n control lines are needed.
4 x 1 Multiplexer
• This is what a 4-to-1 multiplexer looks like on the inside.
S1 S0 Y
0 0 I0
0 1 I1
1 0 I2
1 1 I3
BCD Adder
Block Diagram of a BCD Adder
Combinational Circuits

• This shifter
moves the bits
of a nibble one
position to the
left or right.

 If S = 0, in which direction do the input bits shift?


De-multiplexer

A de-multiplexer is a circuit that receives information on a single line and transmit


this information on one of 2n possible output lines.

The selection of a specific output line is controlled by the bit values of n selection
lines.

Decoder with an Enable De-multiplexer

You might also like