SlideShare a Scribd company logo
1 of 251
Digital Electronics
Introduction
Kashif Janjua
Lecturer NSU
BS (EE), MS (ESE),
PhD (EE)(enrolled)
Grading Policy
2
Components Marks
Sessional 25
Mid Term Exam 25
Final Exam 50
Total 100
Digital Electronics
 Digital Logic is concerned with the
interconnection among digital components and
modules and is a term used to represent the
design and analysis of digital systems.
Digital systems
Digital systems are used in communication,
business transactions, traffic control, spacecraft
guidance, medical treatment, weather monitoring,
the Internet, and many other commercial,
industrial, and scientific enterprises
Digital Computers and Digital Systems
 Digital computers have made possible many
scientific, industrial and commercial advances
 The most striking property of a digital computer is its
generality
 It can follow a sequence of instructions, called a program,
that operates on given data
 Digital system manipulates discrete elements of
information
 Discrete elements of information are represented in
digital system by signals
Digital Computers and Digital Systems
 The signals in all present day electronic digital
systems have only two discrete values and are said
to be binary.
 Discrete quantities of information emerge either from
the nature of the process or may be purposely
quantized from a continuous process
 Any set that is restricted to a finite number of
elements contains discrete information.
Analog vs digital
An analog quantity is one having continuous values.
A digital quantity is one having a discrete set of values
Information Represented
10
 The signals in most present‐day electronic digital
systems use just two discrete values and are therefore
said to be binary.
 A binary digit is called a bit
 Information in computers is represented by groups of bits
called binary codes.
 (e.g., the number 7 is represented by 0111).
 A digital system is a system that manipulates discrete
elements of information represented internally in binary
form.
 Groups of bits can specify
 the instructions to be executed and
 the data to be processed
 Continuous data is converted into discrete data in order
to be presented to the computer
Structure - Top Level
Computer
Main
Memory
Input
Output
Systems
Interconnection
Peripherals
Communication
lines
Central
Processing
Unit
Computer
11
Structure - The CPU
Computer Arithmetic
and
Login Unit
Control
Unit
Internal CPU
Interconnection
Registers
CPU
I/O
Memory
System
Bus
CPU
12
Digital System
• A digital system is an interconnection of digital modules.
• To understand the operation of each digital module, it is
necessary to have a basic knowledge of digital circuits
and their logical function.
Course Outline
 Chapter 1:
 Binary systems for information representation in digital
components
 Binary Numbers
 Binary Codes
 Binary Logic
 Chapter 2:
 Boolean algebra
 Boolean gates
 Boolean functions
Course Outline
 Chapter 3:
 Map and tabulation methods for simplifying Boolean
function
 Chapter 4:
 Design and analysis of Combinational Circuit
 Adders
 Code converters
 Multilevel NAND and NOR combinational circuit
Course Outline
 Chapter 5:
 Parallel adders
 Decoders
 Multiplexers
 Read Only Memory (ROM)
 Programmable Logic Array (PLA)
 Chapter 6:
 Design and Analysis of clocked sequential Circuit
 Flip-flops
 State Diagram, State Table and State Equation
Course Outline
 Chapter 7:
 Registers
 Shift registers
 Counters
 Random Access Memory (RAM)
 Chapter 8 onwards (optional)
https://sites.google.com/view/bilawalrehman/ho
me
Number System
Chapter 1
Decimal Number System
 Base (also called radix) = 10
 10 digits { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }
 Digit Position
 Integer & fraction
 Digit Weight
 Weight = (Base) Position
 Magnitude
 Sum of “Digit x Weight”
 Formal Notation
1 0 -1
2 -2
5 1 2 7 4
10 1 0.1
100 0.01
500 10 2 0.7 0.04
d2*B2
+d1*B1
+d0*B0
+d-1*B-1
+d-2*B-2
(512.74)10
20
Decimal Number System
• A decimal number such as 7,392 represents a
quantity equal to 7 thousands, plus 3 hundreds,
plus 9 tens, plus 2 units.
• The thousands, hundreds, etc., are powers of 10
implied by the position of the coefficients (symbols)
in the number.
7 × 103 + 3 × 102 + 9 × 101 + 2 × 100
Binary Number System
• The binary system is a different number system.
• The coefficients of the binary number system have
only two possible values: 0 and 1.
• Each coefficient is multiplied by a power of the
radix, e.g., , and the results are added to obtain
the decimal equivalent of the number
𝑎𝑗
2𝑗
Binary Number System
 Base = 2
 2 digits { 0, 1 }, called binary digits or “bits”
 Weights
 Weight = (Base) Position
 Magnitude
 Sum of “Bit x Weight”
 Formal Notation
 Groups of bits 4 bits = Nibble
8 bits = Byte
1 0 -1
2 -2
2 1 1/2
4 1/4
1 0 1 0 1
1 *22
+0 *21
+1 *20
+0 *2-1
+1 *2-2
=(5.25)10
(101.01)2
23
Binary Number System
The decimal equivalent of the binary number 11010.11
is 26.75, as shown from the multiplication of the
coefficients by powers of 2:
1 × 24 + 1 × 23 + 0 × 22 + 1 × 21 + 0 × 20 + 1 × 2−1 + 1 × 2−2 = 26.75
There are many different number systems.
In general, a number expressed in a base‐r system
has coefficients multiplied by powers of r:
The coefficients range in value from 0 to r - 1.
aj
The Power of 2
n 2n
0 20=1
1 21=2
2 22=4
3 23=8
4 24=16
5 25=32
6 26=64
7 27=128
n 2n
8 28=256
9 29=512
10 210=1024
11 211=2048
12 212=4096
20 220=1M
30 230=1G
40 240=1T
Mega
Giga
Tera
Kilo
26
Octal Number System
 Base = 8
 8 digits { 0, 1, 2, 3, 4, 5, 6, 7 }
 Weights
 Weight = (Base) Position
 Magnitude
 Sum of “Digit x Weight”
 Formal Notation
1 0 -1
2 -2
8 1 1/8
64 1/64
5 1 2 7 4
5 *82
+1 *81
+2 *80
+7 *8-1
+4 *8-2
=(330.9375)10
(512.74)8
27
Hexadecimal Number System
 Base = 16
 16 digits { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F }
 Weights
 Weight = (Base) Position
 Magnitude
 Sum of “Digit x Weight”
 Formal Notation
1 0 -1
2 -2
1 E 5 7 A
1 *162
+14 *161
+5 *160
+7 *16-1
+10 *16-2
=(485.4765625)10
(1E5.7A)16
28
Decimal (Integer) to Binary Conversion
 Divide the number by the ‘Base’ (=2)
 Take the remainder (either 0 or 1) as a coefficient
 Take the quotient and repeat the division
Example: (13)10
Quotient Remainder Coefficient
Answer: (13)10 = (a3 a2 a1 a0)2 = (1101)2
MSB LSB
13/ 2 = 6 1 a0 = 1
6 / 2 = 3 0 a1 = 0
3 / 2 = 1 1 a2 = 1
1 / 2 = 0 1 a3 = 1
29
Examples
Convert decimal 41 to binary
41
2 20 1
2 10 0
2 5 0
2 2 1
2 1 0
(101001)2
Examples
Convert decimal 51 to binary
51
Examples
2 0.3125 0.625 0.625 0
2 0.625 1.25 0.25 1
2 0.25 0.50 0.50 0
2 0.50 1.00 00 1
Integer Fraction
Coefficient
(0.0101)2
Examples
2 0.578 1.156 0.156 1
2 0.156 0.312 0.312 0
2 0.312 0.624 0.624 0
2 0.624 1.248 0.248 1
2 0.248 0.496 0.496 0
2 0.496 0.992 0.992 0
2 0.992 1.984 0.984 1
2 0.984 1.968 0.968 1
Integer Fraction
Coefficient
(0.10010011…)2
Examples
Convert decimal number into binary 45.5
Octal to Decimal Conversion
Decimal to Octal Conversion
Example: (175)10
Quotient Remainder Coefficient
Answer: (175)10 = (a2 a1 a0)8 = (257)8
175 / 8 = 21 7 a0 = 7
21 / 8 = 2 5 a1 = 5
2 / 8 = 0 2 a2 = 2
Example: (0.3125)10
Integer Fraction Coefficient
Answer: (0.3125)10 = (0.a-1 a-2 a-3)8 = (0.24)8
0.3125 * 8 = 2 . 5
0.5 * 8 = 4 . 0 a-2 = 4
a-1 = 2
36
Examples
Convert (359)10 into Octal
(547)8
Examples
Binary − Octal Conversion
 8 = 23
 Each group of 3 bits represents
an octal digit
Octal Binary
0 0 0 0
1 0 0 1
2 0 1 0
3 0 1 1
4 1 0 0
5 1 0 1
6 1 1 0
7 1 1 1
Example:
( 1 0 1 1 0 . 0 1 )2
( 2 6 . 2 )8
Assume Zeros
Works both ways (Binary to Octal & Octal to Binary)
39
Binary − Hexadecimal Conversion
 16 = 24
 Each group of 4 bits represents a
hexadecimal digit
Hex Binary
0 0 0 0 0
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 1 0 0 1
A 1 0 1 0
B 1 0 1 1
C 1 1 0 0
D 1 1 0 1
E 1 1 1 0
F 1 1 1 1
Example:
( 1 0 1 1 0 . 0 1 )2
( 1 6 . 4 )16
Assume Zeros
Works both ways (Binary to Hex & Hex to Binary)
40
Example
 (10110001010011.111100000110)2 = (?) 8
 (10110001101011.11110010)2 = (?)16
Decimal Binary Octal Hex
00 0000 00 0
01 0001 01 1
02 0010 02 2
03 0011 03 3
04 0100 04 4
05 0101 05 5
06 0110 06 6
07 0111 07 7
08 1000 10 8
09 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
Octal − Hexadecimal Conversion
 Convert to Binary as an intermediate step
Example:
( 0 1 0 1 1 0 . 0 1 0 )2
( 1 6 . 4 )16
Assume Zeros
Works both ways (Octal to Hex & Hex to Octal)
( 2 6 . 2 )8
Assume Zeros
42
Decimal, Binary, Octal and Hexadecimal
Decimal Binary Octal Hex
00 0000 00 0
01 0001 01 1
02 0010 02 2
03 0011 03 3
04 0100 04 4
05 0101 05 5
06 0110 06 6
07 0111 07 7
08 1000 10 8
09 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
43
signed /unsigned numbers
• Positive integers (including zero) can be represented as unsigned
numbers.
• For negative integers, we need a notation.
• In ordinary arithmetic, a negative number is indicated by a minus sign
and a positive number by a plus sign.
• Because of hardware limitations, computers must represent everything
with binary digits.
• It is customary to represent the sign with a bit placed in the leftmost
position of the number.
• The convention is to make the sign bit 0 for positive and 1 for negative.
signed /unsigned numbers
• The user determines whether the number is signed or unsigned.
• If the binary number is signed, then the leftmost bit represents the sign
and the rest of the bits represent the number.
• If the binary number is assumed to be unsigned, then the leftmost bit is
the most significant bit of the number.
• the string of bits 01001 can be considered as 9 (unsigned binary) or as
+9 (signed binary) because the leftmost bit is 0.
• The string of bits 11001 represents the binary equivalent of 25 when
considered as an unsigned number and the binary equivalent of -9 when
considered as a signed number.
• This is because the 1 that is in the leftmost position designates a
negative and the other four bits represent binary 9.
signed /unsigned numbers
• signed‐magnitude convention
• Signed complement system
• In this system, a negative number is indicated by its complement.
• the 2’s complement is the most common.
signed‐magnitude representation: 10001001
signed‐1’s‐complement representation: 11110110
signed‐2’s‐complement representation: 11110111
signed /unsigned numbers
• In signed‐magnitude, -9 is obtained from +9 by changing only the sign bit
in the leftmost position from 0 to 1.
• In signed‐1’s-complement, -9 is obtained by complementing all the
• bits of +9, including the sign bit.
• The signed‐2’s‐complement representation of -9 is obtained by taking the
2’s complement of the positive number, including the sign bit.
(+9)
00001001
signed‐magnitude representation: 10001001
signed‐1’s‐complement representation: 11110110
signed‐2’s‐complement representation: 11110111
Arithmetic Addition
• The addition of two numbers in the signed‐magnitude system follows the
rules of ordinary arithmetic.
• If the signs are the same, we add the two magnitudes and give the sum
the common sign.
• If the signs are different, we subtract the smaller magnitude from the
larger and give the difference the sign of the larger magnitude.
• For example, (+25) + (-37) = -(37 - 25) = -12 is done by subtracting the
smaller magnitude, 25, from the larger magnitude, 37, and appending the
sign of 37 to the result.
Arithmetic Addition
The addition of two signed binary numbers with negative numbers
represented in signed‐ 2’s‐complement form is obtained from the addition of
the two numbers, including their sign bits. A carry out of the sign‐bit position
is discarded.
Note that negative numbers must be initially in 2’s‐complement form and that if
the sum obtained after the addition is negative, it is in 2’s‐complement form.
Arithmetic Addition
In each of the four cases, the
operation performed is addition
with the sign bit included. Any
carry out of the sign‐bit position
is discarded, and negative
results are automatically in
2’s‐complement form.
Arithmetic Subtraction
Subtraction of two signed binary numbers when negative numbers are in
2’s‐complement form is simple and can be stated as follows:
Take the 2’s complement of the subtrahend (including the sign bit) and add
it to the minuend (including the sign bit). A carry out of the sign‐bit position is
discarded.
It is worth noting that binary numbers in the signed‐complement system are added and subtracted by
the same basic addition and subtraction rules as unsigned numbers.
Addition Rules
 0 + 0 = 00 ( 0 with a 0 carry )
 0 + 1 = 01 ( 1 with a 0 carry )
 1 + 0 = 01 ( 1 with a 0 carry )
 1 + 1 = 10 ( 0 with a 1 carry )
Addition Rules w/Carries
 0+0+0 = 00 (0 WITH 0 CARRY)
 0+0+1 = 01 (1 WITH 0 CARRY)
 0+1+1 = 10 (0 WITH 1 CARRY)
 1+1+1 = 11 (1 WITH 1 CARRY)
Binary Addition
 Column Addition
1 0 1
1
1
1
1
1
1
1 0
+
0
0
0
0 1 1
1
≥ (2)10
1
1
1
1
1
1
= 61
= 23
= 84
55
Binary Subtraction
 Borrow a “Base” when needed
0 0 1
1
1
0
1
1
1
1 0
−
0
1
0
1 1 1
0
= (10)2
2
2
2 2
1
0
0
0
1
= 77
= 23
= 54
56
Complements
Complements are used in digital computers to simplify the subtraction
operation and for logical manipulation.
• There are two types of complements for each base‐r system:
• the radix complement (r’s complement)
• the diminished radix complement (r - 1)’s complement
r’s Complement
•Given a number N in base r having n digits,
•the r’s complement of N is defined as
rn - N for N!= 0 and 0 for N = 0
•For decimal numbers the
base or r = 10,
•so the 10’s complement of N
is 10n-N.
•100000……. - N
Digit
n
Digit
n-1
Next
digit
Next
digit
First
digit
0 0 0 0 0
-
1
10’s complement Examples (DECIMAL)
Find the 10’s complement of
546700 and 12389
The 10’s complement of 546700
is 1000000 - 546700= 453300
and the 10’s complement of
12389 is
100000 - 12389 = 87611.
5 4 6 7 0
- 0
0 0 0 0 0 0
4 5 3 3 0 0
1 2 3 8
- 9
1 0 0 0 0 0
8 7 6 1 1
1
10’s complement Examples (fractional part)
rn - N
100 - N
Find 10s complement of 0.327
1-0.327 = 0.673
For binary numbers, r = 2,
r’s complement is the 2’s complement.
The 2’s complement of N is 2n - N.
2’s complement (BINARY)
Digit
n
Digit
n-1
Next
digit
Next
digit
First
digit
0 0 0 0 0
-
1
rn - N
2’s complement Example (integer part)
The 2’s complement of
1011001 is 0100111
The 2’s complement of
0001111 is 1110001
0 1 1 0 0
- 1
0 0 0 0 0 0
1 0 0 1 1 1
0 0 1 1 1
- 1
1 1 0 0 0 1
1
0
0
0
1
1
0 0 0 0 0 0
0
1
2n - N
2’s complement Example (fractional part)
 The 2’s complement of (0.0110)2
2’s complement Example (fractional part)
 The 2’s complement of (0.0110)2
20 - N
 0.1010
Complements of numbers
(r-1 )’s Complement
•Given a number N in base r having n digits,
•the (r- 1)’s complement of N is defined as
(rn – r -m - N ) (rn – 1) - N
where n = num. of digits in integer part
and m = num. of digit in fractional part
•For decimal numbers the r = 10
and r- 1= 9,
•so the 9’s complement of N
(integer part only ) is (10n-1)-N
•99999……. - N
Digit
n
Digit
n-1
Next
digit
Next
digit
First
digit
9 9 9 9 9
-
Find the 9’s complement of 546700 and 12389
The 9’s complement of 546700 is
999999 - 546700= 453299
and the 9’s complement of 12389 is
99999- 12389 = 87610.
9’s complement Examples (DECIMAL)
5 4 6 7 0
- 0
9 9 9 9 9 9
4 5 3 2 9 9
1 2 3 8
- 9
9 9 9 9 9
8 7 6 1 0
9’s complement Examples (DECIMAL)
 9s complement of 0.3267
(rn – r -m - N )
where n = num. of digits in integer part
and m = num. of digit in fractional part
9’s complement Examples (DECIMAL)
 9s complement of 0.3267
(rn – r -m - N )
where n = num. of digits in integer part
and m = num. of digit in fractional part
0.673
2
l’s complement (BINARY)
 For binary numbers, r = 2 and r - 1 = 1,
 r-1’s complement is the l’s complement.
 The l’s complement of N is (2n - 1) - N.
Digit
n
Digit
n-1
Next
digit
Next
digit
First
digit
1 1 1 1 1
Bit n-1 Bit n-2 ……. Bit 1 Bit 0
-
l’s complement (BINARY)
Find r-1 complement for binary number N with four binary digits.
r-1 complement for binary means 2-1 complement or 1’s complement.
n = 4, we have 24 = (10000)2 and 24 - 1 = (1111)2.
The l’s complement of N is (24 - 1) - N. = (1111) - N
(rn – r -m - N )
where n = num. of digits in integer part
and m = num. of digit in fractional part
The complement 1’s of
1011001 is 0100110
0 1 1 0 0
- 1
1 1 1 1 1 1
1 0 0 1 1 0
0 0 1 1 1
- 1
1 1 1 1 1 1
1 1 0 0 0 0
1
1
0
The 1’s complement of
0001111 is 1110000
0
1
1
l’s complement (BINARY)
Fast Methods for 2’s Complement
Method 1:
The 2’s complement of binary number is obtained by adding 1 to the
l’s complement value.
Example:
1’s complement of 101100 is 010011 (invert the 0’s and 1’s)
2’s complement of 101100 is 010011 + 1 = 010100
Fast Methods for 2’s Complement
Method 2:
The 2’s complement can be formed by leaving all least significant 0’s
and the first 1 unchanged, and then replacing l’s by 0’s and 0’s by l’s
in all other higher significant bits.
Example:
The 2’s complement of 1101100 is
0010100
Leave the two low-order 0’s and the first 1 unchanged, and then
replacing 1’s by 0’s and 0’s by 1’s in the four most significant bits.
Examples
 Finding the 2’s complement of (01100101)2
 Method 1 – Simply complement each bit and then
add 1 to the result.
(01100101)2
[N] = 2’s complement = 1’s complement (10011010)2 +1
=(10011011)2
 Method 2 – Starting with the least significant bit,
copy all the bits up to and including the first 1 bit
and then complement the remaining bits.
N = 0 1 1 0 0 1 0 1
[N] = 1 0 0 1 1 0 1 1
Subtraction of Unsigned Numbers
using r’s complement
Subtract N from M : M – N
1. Add M to the r’s complement of N
2. Inspect the result obtained in step 1 for an end
carry
a. If an end carry occurs, discard it.
b. If an end carry does not occur, take the r’s
complement of the sum obtained in step 1 and
place a negative sign.
Example 1 (Decimal unsigned numbers),
perform the subtraction 72532 - 13250 = 59282.
M > N : “Case 1” “Do not take complement of sum
and discard carry”
The 10’s complement of 13250 is 86750.
Therefore:
M = 72532
10’s complement of N =+86750
Sum= 159282
Discard end carry 105= - 100000
Answer = 59282 no complement
Example 2 (Decimal unsigned numbers),
Now consider an example with M <N.
The subtraction 13250 - 72532 produces negative 59282. Using
the procedure with complements, we have
M = 13250
10’s complement of N = +27468
Sum = 40718
Take 10’s complement of Sum = 100000
-40718
The number is : 59282
Place negative sign in front of the number: -59282
Example 1 (Binary unsigned numbers)
Subtraction of Unsigned Numbers
using (r -1)’s complement
Subtract N from M : M – N
1. Add M to the (r-1)’s complement of N
2. Inspect the result obtained in step 1 for an end
carry
a. If an end carry occurs, add 1 to the least
significant digit(end-around carry)
b. If an end carry does not occur, take the (r-1)’s
complement of the sum obtained in step 1 and
place a negative sign.
Examples (Decimal unsigned numbers)
 M = 72532 N = 3250
Examples (Binary unsigned numbers)
 M = 1010100 N = 1000100
Comparison
 1’s complement
1. Easier to implement
2. Needs two additions
for subtraction
procedure
 2’s complement
1. Harder to implement
2. Needs one additions
for subtraction
procedure
Combinational Logical Circuits
Binary Logic and Gates, Boolean Algebra
Overview
Chapter 2 - Part 1
84
 Part 1 – Gate Circuits and Boolean Equations
 Binary Logic and Gates
 Boolean Algebra
 Standard Forms
 Part 2 – Circuit Optimization
 Two-Level Optimization
 Map Manipulation
 Practical Optimization (Espresso)
 Multi-Level Circuit Optimization
 Part 3 – Additional Gates and Circuits
 Other Gate Types
 Exclusive-OR Operator and Gates
 High-Impedance Outputs
Binary Logic and Gates
Chapter 2 - Part 1
85
 Binary variables take on one of two values.
 Logical operators operate on binary values
and binary variables.
 Basic logical operators are the logic
functions AND, OR and NOT.
 Logic gates implement logic functions.
 Boolean Algebra: a useful mathematical
system for specifying and transforming
logic functions.
 We study Boolean algebra as a foundation
for designing and analyzing digital
systems!
Binary Variables
Chapter 2 - Part 1
86
 Recall that the two binary values have
different names:
 True/False
 On/Off
 Yes/No
 1/0
 We use 1 and 0 to denote the two values.
 Variable identifier examples:
 A, B, y, z, or X1 for now
 RESET, START_IT, or ADD1 later
Logical Operations
Chapter 2 - Part 1
87
 The three basic logical operations are:
 AND
 OR
 NOT
 AND is denoted by a dot (·).
 OR is denoted by a plus (+).
 NOT is denoted by an overbar ( ¯ ), a single
quote mark (') after, or (~) before the variable.
Notation Examples
Chapter 2 - Part 1
88
 Examples:
 is read “Y is equal to A AND B.”
 is read “z is equal to x OR y.”
 is read “X is equal to NOT A.”
 Note: The statement:
1 + 1 = 2 (read “one plus one equals two”)
is not the same as
1 + 1 = 1 (read “1 or 1 equals 1”).
= B
A
Y 
y
x
z +
=
A
X =
Operator Definitions
Chapter 2 - Part 1
89
 Operations are defined on the
values "0" and "1" for each
operator:
AND
0 · 0 = 0
0 · 1 = 0
1 · 0 = 0
1 · 1 = 1
OR
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 1
NOT
1
0 =
0
1=
Logic Function Implementation
Chapter 2 - Part 1
90
 Using Switches
 For inputs:
 logic 1 is switch closed
 logic 0 is switch open
 For outputs:
 logic 1 is light on
 logic 0 is light off.
Switches in series => AND
Switches in parallel => OR
Logic Function Implementation
(Continued)
Chapter 2 - Part 1
91
 Example: Logic Using Switches
 Light is on (L = 1) for
L(A, B, C, D) =
and off (L = 0), otherwise.
B
A
D
C
Logic Gate Symbols and Behavior
Chapter 2 - Part 1
92
 Logic gates have special symbols:
 And waveform behavior in time as follows:
(b) Timing diagram
X 0 0 1 1
Y 0 1 0 1
X · Y
(AND) 0 0 0 1
X 1 Y
(OR) 0 1 1 1
(NOT) X 1 1 0 0
(a) Graphic symbols
OR gate
X
Y
Z = X + Y
X
Y
Z = X · Y
AND gate
X Z = X
NOT gate or
inverter
Gate Delay
Chapter 2 - Part 1
93
 In actual physical gates, if one or more input
changes causes the output to change, the output
change does not occur instantaneously.
 The delay between an input change(s) and the
resulting output change is the gate delay denoted by
tG:
tG tG
Input
Output
Time (ns)
0
0
1
1
0 0.5 1 1.5
tG = 0.3 ns
Truth Tables
Chapter 2 - Part 1
94
 Truth table - a tabular listing of the values of a function
for all possible combinations of values on its arguments
 Example: Truth tables for the basic logic operations:
0
1
1
0
X
NOT
X
Z =
1
1
1
0
0
1
0
1
0
0
0
0
Z = X.Y
Y
X
AND OR
X Y Z = X+Y
0 0 0
0 1 1
1 0 1
1 1 1
Logic Diagrams and Expressions
Chapter 2 - Part 1
95
 Boolean equations, truth tables and logic diagrams describe the same
function!
 Truth tables are unique; expressions and logic diagrams are not. This
gives flexibility in implementing functions.
X
Y F
Z
Logic Diagram
Equation
Z
Y
X
F +
=
Truth Table
1
1 1 1
1
1 1 0
1
1 0 1
1
1 0 0
0
0 1 1
0
0 1 0
1
0 0 1
0
0 0 0
X Y Z Z
Y
X
F 
+
=
Boolean Algebra
Chapter 2 - Part 1
96
1.
3.
5.
7.
9.
11.
13.
15.
17.
Commutative
Associative
Distributive
DeMorgan’s
2.
4.
6.
8.
X . 1 X
=
X . 0 0
=
X . X X
=
0
=
X . X
 An algebraic structure defined on a set of at least two elements,
B, together with three binary operators (denoted +, · and ) that
satisfies the following basic identities:
10.
12.
14.
16.
X + Y Y + X
=
(X + Y) Z
+ X + (Y Z)
+
=
X(Y + Z) XY XZ
+
=
X + Y X . Y
=
XY YX
=
(XY) Z X(Y Z)
=
X + YZ (X + Y) (X + Z)
=
X . Y X + Y
=
X + 0 X
=
+
X 1 1
=
X + X X
=
1
=
X + X
X = X
Boolean algebra
• Boolean algebra is the mathematics of digital logic.
• A basic knowledge of Boolean algebra is indispensable
to the study and analysis of logic circuits
The most common postulates used to formulate various
algebraic structures are as follows:
Closure. Associative law. Commutative law. Identity element.
Inverse. Distributive law.
Boolean algebra
Closure. A set S is closed with respect to a binary operator
if, for every pair of elements of S, the binary operator
specifies a rule for obtaining a unique element
of S.
Associative law. A binary operator * on a set S is said to be
associative whenever
Boolean algebra
Commutative law. A binary operator * on a set S is said to
be commutative whenever
Identity element. A set S is said to have an identity element
with respect to a binary operation * on S if there exists an
element e in S with the property that
Boolean algebra
Inverse. A set S having the identity element e with respect
to a binary operator * is said to have an inverse whenever,
for every x ϵ S, there exists an element y ϵ S such that
Distributive law. If (*) and (.) are two binary operators on a
set S, (*) is said to be distributive over (.) whenever
Boolean Operator Precedence
Chapter 2 - Part 1
101
 The order of evaluation in a Boolean
expression is:
1. Parentheses
2. NOT
3. AND
4. OR
 Consequence: Parentheses appear
around OR expressions
 Example: F = A(B + C)(C + D)
AXIOMATIC DEFINITION OF BOOLEAN
ALGEBRA
• In 1854, George Boole developed an algebraic system
now called Boolean algebra.
• In 1938, Claude E. Shannon introduced a two‐valued
Boolean algebra called switching algebra.
• For the formal definition of Boolean algebra, we shall
employ the postulates formulated by E. V. Huntington in
1904.
Boolean algebra is an algebraic structure defined by a set
of elements, together with two binary operators, (+) and (.) ,
provided that the following (Huntington) postulates are
satisfied:
Huntington postulates
1) (a) The structure is closed with respect to the operator
(+).
(b) The structure is closed with respect to the operator
(.) .
2) (a) The element 0 is an identity element with respect to
+; that is, x + 0 =0 + x = x.
(b) The element 1 is an identity element with respect to
(.) ; that is, x . 1 = 1 . x = x.
3) (a) The structure is commutative with respect to +; that
is, x + y = y + x.
(b) The structure is commutative with respect to . ; that
is, x . y = y . x.
Huntington postulates
4) (a) The operator . is distributive over +; that is, x . (y + z)
= (x . y) + (x . z).
(b) The operator + is distributive over . ; that is, x + (y . z) =
(x + y) . (x + z).
5) For every element x ϵ B, there exists an element x’ ϵ B
(called the complement of x) such that (a) x + x’ = 1 and (b)
x . x’ = 0.
6) There exist at least two elements x, y ϵ B such that x y.
Two‐Valued Boolean Algebra
A two‐valued Boolean algebra is defined on a set of two
elements, B = {0, 1}, with rules for the two binary operators
+ and . as shown in the following operator tables
Huntington postulates for Two‐Valued
Boolean Algebra
Huntington postulates for Two‐Valued
Boolean Algebra
Huntington postulates for Two‐Valued
Boolean Algebra
Duality
If the dual of an algebraic expression is desired, we simply
interchange OR and AND operators and replace 1’s by 0’s
and 0’s by 1’s.
Basic Theorems
Six theorems of Boolean algebra
Boolean Functions
Dr. Bilawal Rehman
Huntington postulates
2) (a) x + 0 =0 + x = x.
(b) x . 1 = 1 . x = x.
3) (a) x + y = y + x.
(b) x . y = y . x.
4) (a) x . (y + z) = (x . y) + (x . z).
(b) x + (y . z) = (x + y) . (x + z).
5) (a) x + x’ = 1
(b) x . x’ = 0.
THEOREM 1(a): x + x = x.
THEOREM 1(b): x . x = x.
THEOREM 2(a): x + 1 = 1.
THEOREM 6(a): x + xy = x.
BOOLEAN FUNCTIONS
• Boolean algebra is an algebra that deals with binary variables
and logic operations.
• A Boolean function described by an algebraic expression
consists of binary variables, the constants 0 and 1, and the
logic operation symbols.
• For a given value of the binary variables, the function can be
equal to either 1 or 0.
F1 = x + y’z
F1 = x + y’z
Boolean Function
Boolean Function
2) (a) x + 0 =0 + x = x.
(b) x . 1 = 1 . x = x.
3) (a) x + y = y + x.
(b) x . y = y . x.
4) (a) x . (y + z) = (x . y) + (x . z).
(b) x + (y . z) = (x + y) . (x + z).
5) (a) x + x’ = 1
(b) x . x’ = 0.
three terms and eight literals
Algebraic Manipulation
A literal is a single variable within a term
The manipulation of Boolean algebra consists mostly of reducing
an expression for the purpose of obtaining a simpler circuit.
Simplification by Theorem & Postulate
consensu
s theorem
Complement of a Function
• The complement of a function F is F’ and is obtained from an
interchange of 0’s for 1’s and 1’s for 0’s in the value of F.
• The complement of a function may be derived algebraically
through DeMorgan’s theorems
The three‐variable form of
the first DeMorgan’s
theorem
Complement of a Function
• The generalized form of DeMorgan’s theorems states that the
complement of a function is obtained by interchanging AND
and OR operators and complementing each literal.
Complement of a Function
Complement of a Function
CANONICAL FORMS
Minterms
• A binary variable may appear either in its normal form (x) or in its
complement form (x’).
• Now consider two binary variables x and y combined with an AND
operation.
• Since each variable may appear in either form, there are four possible
combinations: x’y’, x’y, xy’, and xy.
• Each of these four AND terms is called a minterm, or a standard product.
• n variables can be combined to form 2𝑛 minterms
CANONICAL FORMS
Each minterm is obtained from an AND term of the n variables, with each
variable being primed if the corresponding bit of the binary number is a 0
and unprimed if a 1
A symbol for each minterm is of the form 𝑚𝑗, where the subscript j denotes
the decimal equivalent of the binary number of the minterm designated.
Maxterms
In a similar fashion, n variables forming an OR term, with each variable
being primed or unprimed, provide 2𝑛
possible combinations, called
maxterms, or standard sums
CANONICAL FORMS
It is important to note that (1) each maxterm is obtained from an OR term of
the n variables, with each variable being unprimed if the corresponding bit is
a 0 and primed if a 1, and (2) each maxterm is the complement of its
corresponding minterm and vice versa.
A Boolean function can be expressed algebraically from a given
truth table by forming a minterm for each combination of the
variables that produces a 1 in the function and then taking the
OR of all those terms.
Minterms and Maxterms
 Minterms:
 AND term with every variable in normal or complemented form.
 n variables can be combined to form 2n minterms.
 0 => complement and 1 => normal
 Maxterms:
 OR term with every variable in normal or complemented form.
 n variables can be combined to form 2n maxterms.
 1 => complement and 0 => normal
Maxterms and Minterms
 Examples: Two variable minterms and
maxterms.
 The index above is important for
describing which variables in the terms
are true and which are complemented.
Index Minterm Maxterm
0 x y x + y
1 x y x + y
2 x y x + y
3 x y x + y
Index Examples – Four
Variables
Chapter 2 - Part 1
132
Index Binary Minterm Maxterm
i Pattern mi Mi
0 0000
1 0001
3 0011
5 0101
7 0111
10 1010
13 1101
15 1111
d
c
b
a d
c
b
a +
+
+
d
c
b
a
d
c
b
a +
+
+
d
c
b
a d
c
b
a +
+
+
d
c
b
a +
+
+
d
c
b
a d
c
b
a +
+
+
d
b
a
d
c
b
a d
c
b
a +
+
+
?
?
?
?
c
CANONICAL FORMS
i m
M = i i
i M
m =
Function Representation by Canonical
Forms
 Sum of Minterms (SOM)
 Form a minterm for each combination of the variables (input) which produces a 1 in truth
table, and then taking the OR of all those minterms.
x y z F1 F2
0 0 0 0 0
0 0 1 1 0
0 1 0 0 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
Minterm Function Example
 Example: Find F1 = m1 + m4 + m7
 F1 = x y z + x y z + x y z
x y z index F1
0 0 0 0 0
0 0 1 1 1
0 1 0 2 0
0 1 1 3 0
1 0 0 4 1
1 0 1 5 0
1 1 0 6 0
1 1 1 7 1
Minterm Function Example
 F(A, B, C, D, E) = m2 + m9 + m17 +
m23
 F(A, B, C, D, E) =
CANONICAL FORMS
Any Boolean function can be expressed as a
sum of minterms (with “sum” meaning the
ORing of terms).
Function Representation by Canonical
Forms
 Product of Maxterms (POM)
 Form a maxterm for each combination of the variables (input) which produces a 0 in truth
table, and then taking the AND of all those maxterms.
x y z F1 F2
0 0 0 0 0
0 0 1 1 0
0 1 0 0 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
F1 = (x+y+z). (x+y’+z).
(x+y’+z’). (x’+y+z’). (x’+y’+z)
F2 = = (x+y+z). (x+y+z’).
(x+y’+z). (x’+y+z)
Maxterm Function Example
 Example: Implement F1 in maxterms:
F1 = M0 · M2 · M3 · M5 · M6
)
z
y
z)·(x
y
·(x
z)
y
(x
F1 +
+
+
+
+
+
=
z)
y
x
)·(
z
y
x
·( +
+
+
+
x y z index F1
0 0 0 0 0
0 0 1 1 1
0 1 0 2 0
0 1 1 3 0
1 0 0 4 1
1 0 1 5 0
1 1 0 6 0
1 1 1 7 1
Maxterm Function Example
F2 = = (x+y+z). (x+y+z’). (x+y’+z). (x’+y+z)
• Example: Implement F1 in maxterms:
F1 = M0 · M2 · M3 · M5 · M6
)
z
y
z)·(x
y
·(x
z)
y
(x
F1 +
+
+
+
+
+
=
z)
y
x
)·(
z
y
x
·( +
+
+
+
F2 = M( ) · M ( ) · M ( ) · M ( )
?
Maxterm Function Example

 F(A, B,C,D) =
14
11
8
3 M
M
M
M
)
D
,
C
,
B
,
A
(
F 


=
CANONICAL FORMS
Now consider the complement of a Boolean function
CANONICAL FORMS
Any Boolean function can be expressed as a product of maxterms (with
“product” meaning the ANDing of terms). The procedure for obtaining the
product of maxterms directly from the truth table is as follows: Form a
maxterm for each combination of the variables that produces a 0 in the
function, and then form the AND of all those maxterms.
Boolean functions expressed as a sum of minterms or product of
maxterms are said to be in canonical form .
A Boolean function can be expressed algebraically from a given
truth table by forming a minterm for each combination of the
variables that produces a 1 in the function and then taking the
OR of all those terms.
Sum of Minterms
The minterms whose sum defines the Boolean function are those
which give the 1’s of the function in a truth table.
n variables -> 22𝑛
functions
• Any Boolean function can be expressed as a Sum of
Minterms.
• For the function table, the minterms used are the
terms corresponding to the 1's
• For expressions, expand all terms first to explicitly
list all minterms. Do this by “ANDing” any term
missing a variable v with a term ( v + v ).
• Example: Implement f = x + x’ . Y’ as a sum of
minterms.
First expand terms: f =x .(y + y’) + x’ . Y’
Then distribute terms: x . y + x . Y’ + x’ . Y’
Express as sum of minterms: f = m3 + m2 + m0
Another SOM Example
 Example:
 There are three variables, A, B, and C which we
take to be the standard order.
 Expanding the terms with missing variables:
 Collect terms (removing all but one of duplicate
terms):
 Express as SOM:
C
B
A
F +
=
Shorthand SOM Form
 From the previous example, we started with:
 We ended up with:
F = m1+m4+m5+m6+m7
 This can be denoted in the formal shorthand:
 Note that we explicitly show the standard
variables in order and drop the “m” designators.
)
7
,
6
,
5
,
4
,
1
(
)
C
,
B
,
A
(
F m

=
C
B
A
F +
=
Product of Maxterms (POM)
 Any Boolean Function can be expressed as a Product of Maxterms
(POM).
 For the function table, the maxterms used are the terms
corresponding to the 0's.
 For an expression, expand all terms first to explicitly list all
maxterms. Do this by first applying the second distributive law ,
“ORing” terms missing variable v with a term equal to
and then applying the distributive law again.
 Example: Convert to product of maxterms:
Apply the distributive law:
Add missing variable z:
Express as POM: f = M2 · M3
y
x
x
)
z
,
y
,
x
(
f +
=
y
x
)
y
(x
1
)
y
)(x
x
(x
y
x
x +
=
+

=
+
+
=
+
( )
z
y
x
)
z
y
x
(
z
z
y
x +
+
+
+
=

+
+
v
v
Product of Maxterms
Express Boolean function F = xy + x’z into POM form
Product of Maxterms
A functions of n binary variables can be also expressed as a product
of maxterms.
Conversion between Canonical Forms
 To convert between sum-of-minterms (SOM) and product-of-maxterms
(POM) form (or vice-versa) we follow these steps:
 Find the function complement by swapping terms in
the list with terms not in the list.
 Change from products to sums, or vice versa.
 Example: Given F as before:
 Form the Complement:
 Then use the other form with the same indices – this forms the
complement again, giving the other form of the original function:
)
7
,
5
,
3
,
1
(
)
z
,
y
,
x
(
F m

=
)
6
,
4
,
2
,
0
(
)
z
,
y
,
x
(
F m

=
)
6
,
4
,
2
,
0
(
)
z
,
y
,
x
(
F M

=
Conversion between Canonical Forms
F(A, B, C) =∑ (1, 4, 5, 6, 7)
F’(A, B, C) = ∑(0, 2, 3) = m0 + m2 + m3
F = (m0 + m2 + m3)’ = m0’ m2’ m3’ = M0M2M3 = ∏(0, 2, 3)
To convert from one canonical form to another, interchange the symbols
∑ and ∏ and list those numbers missing from the original form.
Function Complements
 The complement of a function expressed as a
sum of minterms is constructed by selecting the
minterms missing in the sum-of-minterms
canonical forms.
 Alternatively, the complement of a function
expressed by a Sum of Minterms form is simply
the Product of Maxterms with the same indices.
 Example: Given
)
7
,
5
,
3
,
1
(
)
z
,
y
,
x
(
F m

=
)
6
,
4
,
2
,
0
(
)
z
,
y
,
x
(
F m

=
)
7
,
5
,
3
,
1
(
)
z
,
y
,
x
(
F M

=
Function
F = xy + x’z
F(x, y, z) = ∑(1, 3, 6, 7)
F(x, y, z) = ∏(0, 2, 4, 5)
Standard Forms
• The two canonical forms of Boolean algebra are basic forms that one
obtains from reading a given function from the truth table.
• These forms are very seldom the ones with the least number of literals,
because each minterm or maxterm must contain, by definition, all the
variables, either complemented or uncomplemented
• Another way to express Boolean functions is in standard form.
• In this configuration, the terms that form the function may contain one,
two, or any number of literals.
• There are two types of standard forms: the sum of products and
products of sums.
Standard Forms
It is assumed that the input variables are
directly available in their complements,
so inverters are not included in the
diagram. This circuit configuration is
referred
to as a two‐level implementation.
Standard Forms
A product of sums is a Boolean expression containing OR terms, called sum
terms.
A Boolean function may be expressed in
a nonstandard form
OTHER LOGIC OPERATIONS
• AND
• OR
Two Variables
functions for n binary variables
2
2 n
The AND and OR functions are only 2 of a total of 16 possible functions
formed with two binary variables
OTHER LOGIC OPERATIONS
2
2 n
The 16 functions listed can be subdivided into three categories:
1. Two functions that produce a constant 0 or 1.
2. Four functions with unary operations: complement and transfer.
3. Ten functions with binary operators that define eight different operations:
AND, OR, NAND, NOR, exclusive‐OR, equivalence, inhibition, and implication.
DIGITAL LOGIC GATES
DIGITAL LOGIC GATES
DIGITAL LOGIC GATES
DIGITAL LOGIC GATES
DIGITAL LOGIC GATES
Multiple‐input
Positive and Negative Logic
Choosing the high‐level H to represent logic 1 defines a positive logic
system. Choosing the low‐level L to represent logic 1 defines a
negative logic system.
Demonstration of positive and negative
logic
Demonstration of positive and negative
logic
polarity indicator
Thus, the same physical gate can operate either as a positive‐logic AND gate or as a
negative‐logic OR gate.
 A Simplification Example:

 Writing the minterm expression:
F = A B C + A B C + A B C + ABC + ABC
 Simplifying:
F =
 Simplified F contains 3 literals compared to 15
in minterm F
Standard Sum-of-Products (SOP)
)
7
,
6
,
5
,
4
,
1
(
m
)
C
,
B
,
A
(
F 
=
Chapter 2 - Part 1
171
Implementation of SOP
Expression
 The two implementations for F are shown
below – it is quite apparent which is simpler!
F
A
B
C
A
B
C
A
B
C
A
B
C
A
B
C F
B
C
A
Chapter 2 - Part 1
172
SOP and POS Observations
 The previous examples show that:
 Canonical Forms (Sum-of-minterms, Product-of-
Maxterms), or other standard forms (SOP, POS)
differ in complexity
 Boolean algebra can be used to manipulate
equations into simpler forms.
 Simpler equations lead to simpler two-level
implementations
 Questions:
 How can we attain a “simplest” expression?
 Is there only one minimum cost circuit?
 The next part will deal with these issues.
Chapter 2 - Part 1
173
Karnaugh Maps (K-map)
 A K-map is a collection of squares
 Each square represents a minterm
 The collection of squares is a graphical
representation of a Boolean function
 Adjacent squares differ in the value of one
variable
 Alternative algebraic expressions for the same
function are derived by recognizing patterns of
squares
 The K-map can be viewed as
 A reorganized version of the truth table
Chapter 2 - Part 1
174
Some Uses of K-Maps
 Provide a means for:
 Finding optimum or near optimum
 SOP and POS standard forms, and
 two-level AND/OR and OR/AND circuit implementations
for functions with small numbers of variables
 Visualizing concepts related to manipulating
Boolean expressions, and
 Demonstrating concepts used by computer-aided
design programs to simplify large circuits
Chapter 2 - Part 1
175
Two Variable Maps
 A 2-variable Karnaugh Map:
 Note that minterm m0 and
minterm m1 are “adjacent”
and differ in the value of the
variable y
 Similarly, minterm m0 and
minterm m2 differ in the x variable.
 Also, m1 and m3 differ in the x variable as well.
 Finally, m2 and m3 differ in the value of the
variable y
y = 0 y = 1
x = 0
m0 = m1 =
x = 1 m2 = m3 =
y
x y
x
y
x y
x
Chapter 2 - Part 1
176
K-Map and Truth Tables
 The K-Map is just a different form of the truth table.
 Example – Two variable function:
 We choose a,b,c and d from the set {0,1} to
implement a particular function, F(x,y).
Function Table K-Map
Input
Values
(x,y)
Function
Value
F(x,y)
0 0 a
0 1 b
1 0 c
1 1 d
y = 0 y = 1
x = 0 a b
x = 1 c d
Chapter 2 - Part 1
177
K-Map Function Representation
 Example:
For function F(x,y), the two adjacent cells
containing 1’s can be combined using the
Minimization Theorem:
F = x y = 0y = 1
x = 0 0 0
x = 1 1 1
y
x
y
x
)
y
x
(
F +
=
Chapter 2 - Part 1
178
K-Map Function Representation
 Example: G(x,y) =
x y+x y+x y
G = x+y y = 0 y = 1
x = 0 0 1
x = 1 1 1
Chapter 2 - Part 1
179
Three Variable Maps
 A three-variable K-map:
 Where each minterm corresponds to the product
terms:
 Note that if the binary value for an index differs in
one bit position, the minterms are adjacent on the
K-Map
yz=00 yz=01 yz=11 yz=10
x=0 m0 m1 m3 m2
x=1 m4 m5 m7 m6
yz=00 yz=01 yz=11 yz=10
x=0
x=1
z
y
x z
y
x z
y
x z
y
x
z
y
x z
y
x z
y
x z
y
x
Chapter 2 - Part 1
180
181
Any two adjacent squares in the map differ by only one variable
Thus, any two minterms in adjacent squares (vertically
or horizontally, but not diagonally, adjacent) that are
ORed together will cause a removal of the dissimilar
variable.
Alternative Map Labeling
 Map use largely involves:
 Entering values into the map, and
 Reading off product terms from the
map.
 Alternate labelings are useful:
y
z
x
1
0 2
4
3
5 6
7
x
y
z
z
y
y z
z
1
0 2
4
3
5 6
7
x
0
1
00 01 11 10
x
Chapter 2 - Part 1
182
Example Functions
 By convention, we represent the minterms of F by
a "1" in the map and leave the minterms of blank
 Example:
 Example:
 Learn the locations of the 8
indices based on the variable
order shown (x, most significant
and z, least significant) on the
map boundaries
y
x
1
0 2
4
3
5 6
7
1
1
1
1
z
x
y
1
0 2
4
3
5 6
71 1
1
1
z
(2,3,4,5)
z)
y,
F(x, m

=
(3,4,6,7)
c)
b,
G(a, m

=
F
Chapter 2 - Part 1
183
Combining Squares
By combining squares, we reduce number of
literals in a product term, reducing the literal
cost, thereby reducing the other two cost
criteria
 On a 3-variable K-Map:
 One square represents a minterm with three
variables
 Two adjacent squares represent a product term
with two variables
 Four “adjacent” terms represent a product term
with one variable
 Eight “adjacent” terms is the function of all
ones (no variables) = 1.
Chapter 2 - Part 1
184
Example: Combining Squares
 Example: Let
 Applying the Minimization Theorem three
times:
 Thus the four terms that form a 2 × 2 square
correspond to the term "y".
y
=
z
y
yz+
=
z
y
x
z
y
x
z
y
x
z
y
x
)
z
,
y
,
x
(
F +
+
+
=
x
y
1
0 2
4
3
5 6
71 1
1
1
z
m(2,3,6,7)
F 
=
Chapter 2 - Part 1
185
Three-Variable Maps
 Reduced literal product terms for SOP
standard forms correspond to rectangles on
K-maps containing cell counts that are
powers of 2.
 Rectangles of 2 cells represent 2 adjacent
minterms; of 4 cells represent 4 minterms
that form a “pairwise adjacent” ring.
 Rectangles can contain non-adjacent cells
as illustrated by the “pairwise adjacent” ring
above.
Chapter 2 - Part 1
186
Three-Variable Maps
 Example Shapes of 2-cell Rectangles:
 Read off the product terms for the rectangles
shown
y
0 1 3 2
5 6
4 7
x
z
Chapter 2 - Part 1
187
Three-Variable Maps
 Example Shapes of 4-cell Rectangles:
 Read off the product terms for the rectangles
shown
y
0 1 3 2
5 6
4 7
x
z
Chapter 2 - Part 1
188
Three Variable Maps
z)
y,
F(x, =
y
1
1
x
z
1 1
1
z
z
y
x
+
y
x
 K-Maps can be used to simplify Boolean functions by
systematic methods. Terms are selected to cover
the
“1s”in the map.
 Example: Simplify
)
(1,2,3,5,7
z)
y,
F(x, m

=
Chapter 2 - Part 1
189
Three-Variable Map Simplification
 Use a K-map to find an optimum SOP equation
for
,7)
(0,1,2,4,6
Z)
Y,
F(X, m

=
Chapter 2 - Part 1
190
3 variable K-map look
191
Example 3.1
Chapter 2 - Part 1
192
F (x, y, z) = (2, 3, 4, 5)

Example 3.1
Chapter 2 - Part 1
193
Example 3.2
Chapter 2 - Part 1
194
F (x, y, z) = (3, 4, 6, 7)

Example 3.2
Chapter 2 - Part 1
195
Example 3.3
Chapter 2 - Part 1
196
F (x, y, z) = (0, 2, 4, 5, 6)

Example 3.3
Chapter 2 - Part 1
197
Example 3.4
Chapter 2 - Part 1
198
Example 3.4
Chapter 2 - Part 1
199
Digital Logic Design
4 Variable K-MAP
FOUR-VARIABLE K-MAP
16 minterms
rows and columns → only one digit changing value between two
adjacent rows or columns
The map minimization of four-variable Boolean functions is similar to the
method used to minimize three-variable functions.
One square represents one minterm, giving a term with four literals.
Two adjacent squares represent a term with three literals.
Four adjacent squares represent a term with two literals.
Eight adjacent squares represent a term with one literal.
Sixteen adjacent squares produce a function that is always equal to 1.
FOUR-VARIABLE K-MAP
EXAMPLE 3.5
F (w, x, y, z) = (0, 1, 2, 4, 5, 6, 8, 9, 12, 13, 14)

EXAMPLE 3.6
F = A’B’C’ + B’CD’ + A’BCD’ +
AB’C’
F = B’D’ +B’C’ +A’CD’
Prime Implicants
In choosing adjacent squares in a map, we must ensure that
(1) all the minterms of the function are covered when we combine the
squares,
(2) the number of terms in the expression is minimized, and
(3) there are no redundant terms (i.e., minterms already covered by other
terms).
A prime implicant is a product term obtained by combining the maximum
possible number of adjacent squares in the map.
If a minterm in a square is covered by only one prime
implicant, that prime implicant is said to be essential
The prime implicants of a function can be obtained from the map by
combining all possible maximum numbers of squares
F(A, B, C, D) = (0, 2, 3, 5, 7, 8, 9, 10, 11, 13, 15)

Five-Variable Map
A five-variable map needs 32 squares and a six-variable map needs 64 squares
EXAMPLE 3.7
Simplify the following Boolean function into (a) sum-of-products form and
(b) product-of-sums form:
F (A, B, C, D) = (0, 1, 2, 5, 8, 9, 10)

Combining the squares with 1’s gives the simplified function in sum-of-
products form:
F = B’D’ + B’C’ + A’C’D
If the squares marked with 0’s are combined, as shown in the diagram, we
obtain the simplified complemented function:
F’ = AB + CD + BD’
Applying DeMorgan’s
theorem we obtain the
simplified function in
productof-
sums form:
F = (A’ + B’) (C’ + D’) (B’ + D)
F (x, y, z) = (1, 3, 4, 6)

F (x, y, z) = (0, 2, 5, 7)

For the sum of products, we combine the 1’s to obtain
For the product of sums, we combine the 0’s to obtain the simplified
complemented function
F = x’z + xz’
F’ = xz + x’z’
F = (x’ + z’)(x + z)
DON’T-CARE CONDITIONS
Incompletely Specified Functions .
Functions that have unspecified outputs for some input
combinations
In most applications, we simply don’t care what
value is assumed by the function for the
unspecified minterms.
For this reason, it is customary to call the
unspecified minterms of a function don’t-care
conditions .
DON’T-CARE CONDITIONS
These don’t-care conditions can be used on a map to provide further
simplification of the Boolean expression.
A don’t-care minterm is a combination of variables whose logical value is
not specified.
Such a minterm cannot be marked with a 1 in the map, because it would
require that the function always be a 1 for such a combination.
Likewise, putting a 0 on the square requires the function to be 0.
To distinguish the don’t-care condition from 1’s and 0’s, an X is used.
DON’T-CARE CONDITIONS
An X inside a square in the map indicates that we don’t care whether the
value of 0 or 1 is assigned to F for the particular minterm.
In choosing adjacent squares to simplify the function in a map, the don’t-
care minterms may be assumed to be either 0 or 1.
When simplifying the function, we can choose to include each don’t-care
minterm with either the 1’s or the 0’s, depending on which combination
gives the simplest expression.
EXAMPLE 3.8
F (w, x, y, z) = (1, 3, 7, 11, 15)
d (w, x, y, z) = (0, 2, 5)


NAND AND NOR IMPLEMENTATION
Digital circuits are frequently constructed with NAND or NOR
gates rather than with AND and OR gates.
NAND and NOR gates are easier to fabricate with electronic
components and are the basic gates used in all IC digital logic
families.
NAND Circuits
The NAND gate is said to be a universal gate because any logic circuit can
be implemented with it.
To show that any Boolean function can be implemented with NAND gates,
we need only show that the logical operations of AND, OR, and complement
can be obtained with NAND gates alone.
NAND Circuits
The complement operation is obtained from a one-input NAND gate that
behaves exactly like an inverter.
The AND operation requires two NAND gates. The first produces the NAND
operation and the second inverts the logical sense of the signal.
The OR operation is achieved through a NAND gate with additional inverters
in each input.
NAND Circuits
A convenient way to implement a Boolean function with NAND
gates is to obtain the simplified Boolean function in terms of
Boolean operators and then convert the function to NAND logic.
The conversion of an algebraic expression from AND, OR, and complement
to NAND can be done by simple circuit manipulation techniques that change
AND–OR diagrams to NAND diagrams.
NAND Circuits
NAND Symbol
NAND Circuits
The implementation of Boolean functions with NAND gates requires
that the functions be in sum-of-products form.
A
B
C
D
G(A,B,C,D) = A*B + C*D
G(A,B,C,D)
F = AB + CD
F = AB + CD
A
B
C
D
F
AB
CD
A
B
C
D
F
A
B
C
D
F
EXAMPLE 3.9
F = xy’ + x’y + z
( )
, , 1, 2, 3, 4,
( ) 5, 7
F x y z = 
F = xy’ + x’y + z
x
y
x
y
z
F
x
y
x
y
z
F
x
y
x
y
z
F
x
y
x
y
z
F
Multilevel NAND Circuits
NOR Implementation
The NOR gate is another universal gate that can be used to implement any
Boolean function.
The NOR operation is the dual of the NAND operation
The complement operation is obtained from a one input NOR gate that
behaves exactly like an inverter
The OR operation requires two NOR gates, and the
AND operation is obtained with a NOR gate that has inverters in each input
NOR Implementation
NOR Implementation
EXCLUSIVE-OR FUNCTION
The exclusive-OR (XOR), is a logical operation that performs the following
Boolean operation:
EXCLUSIVE-OR FUNCTION
It is particularly useful in arithmetic operations and error detection and
correction circuits.
Odd Function
Exclusive-OR
Operation Is
Defined As An Odd
Function
Odd Function
In general, an n -variable exclusive-OR function is an odd function defined
as the logical sum of the minterms whose binary numerical values
have an odd number of 1’s.
The complement of an odd function is an even function
2 2
n
Odd/Even Function
Odd/Even Function
Parity Generation and Checking
• Exclusive-OR functions are very useful in systems requiring error
detection and correction codes.
• A parity bit is used for the purpose of detecting errors during the
transmission of binary information.
• A parity bit is an extra bit included with a binary message to make the
number of 1’s either odd or even.
• The message, including the parity bit, is transmitted and then checked at
the receiving end for errors.
• An error is detected if the checked parity does not correspond with the
one transmitted.
• The circuit that generates the parity bit in the transmitter is called a parity
generator. The circuit that checks the parity in the receiver is called a
parity
• checker.
Even Parity Generator
Even Parity Checker
The three bits in the message,
together with the parity bit, are
transmitted to their destination,
where they are applied to a parity-
checker circuit to check for possible
errors in the transmission.
Even Parity Checker
• The information was transmitted
with even parity, the four bits
received must have an even number
of 1’s.
• An error occurs during the
transmission if the four bits received
have an odd number of 1’s,
indicating that one bit has changed
in value during transmission.

More Related Content

Similar to DLD-Introduction.pptx

Module 1 number systems and code1
Module 1  number systems and code1Module 1  number systems and code1
Module 1 number systems and code1Deepak John
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effectsPeriyanayagiS
 
Chapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbersChapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbersMohammad Bashartullah
 
digital-systems-and-binary-numbers1.pptx
digital-systems-and-binary-numbers1.pptxdigital-systems-and-binary-numbers1.pptx
digital-systems-and-binary-numbers1.pptxRameshK531901
 
Computers numbering systems
Computers   numbering systemsComputers   numbering systems
Computers numbering systemssld1950
 
Unit 1 PDF.pptx
Unit 1 PDF.pptxUnit 1 PDF.pptx
Unit 1 PDF.pptxChandraV13
 
Video lectures
Video lecturesVideo lectures
Video lecturesEdhole.com
 
Digital Fundamental Learning for the Students
Digital Fundamental Learning for the StudentsDigital Fundamental Learning for the Students
Digital Fundamental Learning for the Studentsshaival
 
Digital Electronics Notes
Digital Electronics Notes Digital Electronics Notes
Digital Electronics Notes Srikrishna Thota
 
Unit-6 Computer Arithmetic.ppsx
Unit-6 Computer Arithmetic.ppsxUnit-6 Computer Arithmetic.ppsx
Unit-6 Computer Arithmetic.ppsxtest227270
 
Number systems and conversions
Number systems and conversionsNumber systems and conversions
Number systems and conversionsSusantha Herath
 

Similar to DLD-Introduction.pptx (20)

Module 1 number systems and code1
Module 1  number systems and code1Module 1  number systems and code1
Module 1 number systems and code1
 
Alu1
Alu1Alu1
Alu1
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effects
 
Chapter 3.pptx
Chapter 3.pptxChapter 3.pptx
Chapter 3.pptx
 
Digital Electronics Notes.pdf
Digital Electronics Notes.pdfDigital Electronics Notes.pdf
Digital Electronics Notes.pdf
 
Chapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbersChapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbers
 
Unit-1.pptx
Unit-1.pptxUnit-1.pptx
Unit-1.pptx
 
digital-systems-and-binary-numbers1.pptx
digital-systems-and-binary-numbers1.pptxdigital-systems-and-binary-numbers1.pptx
digital-systems-and-binary-numbers1.pptx
 
Digital Logic
Digital LogicDigital Logic
Digital Logic
 
Computers numbering systems
Computers   numbering systemsComputers   numbering systems
Computers numbering systems
 
Unit 1 PDF.pptx
Unit 1 PDF.pptxUnit 1 PDF.pptx
Unit 1 PDF.pptx
 
Video lectures
Video lecturesVideo lectures
Video lectures
 
Mba ebooks
Mba ebooksMba ebooks
Mba ebooks
 
Complement.pdf
Complement.pdfComplement.pdf
Complement.pdf
 
Digital Fundamental Learning for the Students
Digital Fundamental Learning for the StudentsDigital Fundamental Learning for the Students
Digital Fundamental Learning for the Students
 
Digital Electronics Notes
Digital Electronics Notes Digital Electronics Notes
Digital Electronics Notes
 
Unit-6 Computer Arithmetic.ppsx
Unit-6 Computer Arithmetic.ppsxUnit-6 Computer Arithmetic.ppsx
Unit-6 Computer Arithmetic.ppsx
 
DCF QNA edited
DCF QNA editedDCF QNA edited
DCF QNA edited
 
Chapter 1: Binary System
 Chapter 1: Binary System Chapter 1: Binary System
Chapter 1: Binary System
 
Number systems and conversions
Number systems and conversionsNumber systems and conversions
Number systems and conversions
 

Recently uploaded

existing product research b2 Sunderland Culture
existing product research b2 Sunderland Cultureexisting product research b2 Sunderland Culture
existing product research b2 Sunderland CultureChloeMeadows1
 
RBS学位证,鹿特丹商学院毕业证书1:1制作
RBS学位证,鹿特丹商学院毕业证书1:1制作RBS学位证,鹿特丹商学院毕业证书1:1制作
RBS学位证,鹿特丹商学院毕业证书1:1制作f3774p8b
 
Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCR
Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCRReal Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCR
Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCRdollysharma2066
 
萨斯喀彻温大学毕业证学位证成绩单-购买流程
萨斯喀彻温大学毕业证学位证成绩单-购买流程萨斯喀彻温大学毕业证学位证成绩单-购买流程
萨斯喀彻温大学毕业证学位证成绩单-购买流程1k98h0e1
 
NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...Amil Baba Dawood bangali
 
(办理学位证)多伦多大学毕业证成绩单原版一比一
(办理学位证)多伦多大学毕业证成绩单原版一比一(办理学位证)多伦多大学毕业证成绩单原版一比一
(办理学位证)多伦多大学毕业证成绩单原版一比一C SSS
 
Hifi Babe North Delhi Call Girl Service Fun Tonight
Hifi Babe North Delhi Call Girl Service Fun TonightHifi Babe North Delhi Call Girl Service Fun Tonight
Hifi Babe North Delhi Call Girl Service Fun TonightKomal Khan
 
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证gwhohjj
 
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degreeyuu sss
 
NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...
NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...
NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...Amil baba
 
Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作
Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作
Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作f3774p8b
 
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...Amil Baba Dawood bangali
 
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...Amil baba
 
Call Girls In Munirka>༒9599632723 Incall_OutCall Available
Call Girls In Munirka>༒9599632723 Incall_OutCall AvailableCall Girls In Munirka>༒9599632723 Incall_OutCall Available
Call Girls In Munirka>༒9599632723 Incall_OutCall AvailableCall Girls in Delhi
 
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)861c7ca49a02
 
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...ttt fff
 
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一(办理学位证)韩国汉阳大学毕业证成绩单原版一比一
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一C SSS
 
Hindu amil baba kala jadu expert in pakistan islamabad lahore karachi atar ...
Hindu amil baba kala jadu expert  in pakistan islamabad lahore karachi atar  ...Hindu amil baba kala jadu expert  in pakistan islamabad lahore karachi atar  ...
Hindu amil baba kala jadu expert in pakistan islamabad lahore karachi atar ...amilabibi1
 

Recently uploaded (20)

existing product research b2 Sunderland Culture
existing product research b2 Sunderland Cultureexisting product research b2 Sunderland Culture
existing product research b2 Sunderland Culture
 
RBS学位证,鹿特丹商学院毕业证书1:1制作
RBS学位证,鹿特丹商学院毕业证书1:1制作RBS学位证,鹿特丹商学院毕业证书1:1制作
RBS学位证,鹿特丹商学院毕业证书1:1制作
 
Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCR
Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCRReal Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCR
Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCR
 
萨斯喀彻温大学毕业证学位证成绩单-购买流程
萨斯喀彻温大学毕业证学位证成绩单-购买流程萨斯喀彻温大学毕业证学位证成绩单-购买流程
萨斯喀彻温大学毕业证学位证成绩单-购买流程
 
young call girls in Gtb Nagar,🔝 9953056974 🔝 escort Service
young call girls in Gtb Nagar,🔝 9953056974 🔝 escort Serviceyoung call girls in Gtb Nagar,🔝 9953056974 🔝 escort Service
young call girls in Gtb Nagar,🔝 9953056974 🔝 escort Service
 
NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uk England Northern ...
 
(办理学位证)多伦多大学毕业证成绩单原版一比一
(办理学位证)多伦多大学毕业证成绩单原版一比一(办理学位证)多伦多大学毕业证成绩单原版一比一
(办理学位证)多伦多大学毕业证成绩单原版一比一
 
Hifi Babe North Delhi Call Girl Service Fun Tonight
Hifi Babe North Delhi Call Girl Service Fun TonightHifi Babe North Delhi Call Girl Service Fun Tonight
Hifi Babe North Delhi Call Girl Service Fun Tonight
 
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证
原版1:1复刻斯坦福大学毕业证Stanford毕业证留信学历认证
 
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
 
NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...
NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...
NO1 Qualified Best Black Magic Specialist Near Me Spiritual Healer Powerful L...
 
Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作
Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作
Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作
 
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
 
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...
 
Call Girls In Munirka>༒9599632723 Incall_OutCall Available
Call Girls In Munirka>༒9599632723 Incall_OutCall AvailableCall Girls In Munirka>༒9599632723 Incall_OutCall Available
Call Girls In Munirka>༒9599632723 Incall_OutCall Available
 
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
 
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...
毕业文凭制作#回国入职#diploma#degree美国威斯康星大学麦迪逊分校毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#d...
 
young call girls in Khanpur,🔝 9953056974 🔝 escort Service
young call girls in  Khanpur,🔝 9953056974 🔝 escort Serviceyoung call girls in  Khanpur,🔝 9953056974 🔝 escort Service
young call girls in Khanpur,🔝 9953056974 🔝 escort Service
 
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一(办理学位证)韩国汉阳大学毕业证成绩单原版一比一
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一
 
Hindu amil baba kala jadu expert in pakistan islamabad lahore karachi atar ...
Hindu amil baba kala jadu expert  in pakistan islamabad lahore karachi atar  ...Hindu amil baba kala jadu expert  in pakistan islamabad lahore karachi atar  ...
Hindu amil baba kala jadu expert in pakistan islamabad lahore karachi atar ...
 

DLD-Introduction.pptx

  • 1. Digital Electronics Introduction Kashif Janjua Lecturer NSU BS (EE), MS (ESE), PhD (EE)(enrolled)
  • 2. Grading Policy 2 Components Marks Sessional 25 Mid Term Exam 25 Final Exam 50 Total 100
  • 3. Digital Electronics  Digital Logic is concerned with the interconnection among digital components and modules and is a term used to represent the design and analysis of digital systems.
  • 4. Digital systems Digital systems are used in communication, business transactions, traffic control, spacecraft guidance, medical treatment, weather monitoring, the Internet, and many other commercial, industrial, and scientific enterprises
  • 5. Digital Computers and Digital Systems  Digital computers have made possible many scientific, industrial and commercial advances  The most striking property of a digital computer is its generality  It can follow a sequence of instructions, called a program, that operates on given data  Digital system manipulates discrete elements of information  Discrete elements of information are represented in digital system by signals
  • 6. Digital Computers and Digital Systems  The signals in all present day electronic digital systems have only two discrete values and are said to be binary.  Discrete quantities of information emerge either from the nature of the process or may be purposely quantized from a continuous process  Any set that is restricted to a finite number of elements contains discrete information.
  • 7. Analog vs digital An analog quantity is one having continuous values. A digital quantity is one having a discrete set of values
  • 8.
  • 9.
  • 10. Information Represented 10  The signals in most present‐day electronic digital systems use just two discrete values and are therefore said to be binary.  A binary digit is called a bit  Information in computers is represented by groups of bits called binary codes.  (e.g., the number 7 is represented by 0111).  A digital system is a system that manipulates discrete elements of information represented internally in binary form.  Groups of bits can specify  the instructions to be executed and  the data to be processed  Continuous data is converted into discrete data in order to be presented to the computer
  • 11. Structure - Top Level Computer Main Memory Input Output Systems Interconnection Peripherals Communication lines Central Processing Unit Computer 11
  • 12. Structure - The CPU Computer Arithmetic and Login Unit Control Unit Internal CPU Interconnection Registers CPU I/O Memory System Bus CPU 12
  • 13. Digital System • A digital system is an interconnection of digital modules. • To understand the operation of each digital module, it is necessary to have a basic knowledge of digital circuits and their logical function.
  • 14. Course Outline  Chapter 1:  Binary systems for information representation in digital components  Binary Numbers  Binary Codes  Binary Logic  Chapter 2:  Boolean algebra  Boolean gates  Boolean functions
  • 15. Course Outline  Chapter 3:  Map and tabulation methods for simplifying Boolean function  Chapter 4:  Design and analysis of Combinational Circuit  Adders  Code converters  Multilevel NAND and NOR combinational circuit
  • 16. Course Outline  Chapter 5:  Parallel adders  Decoders  Multiplexers  Read Only Memory (ROM)  Programmable Logic Array (PLA)  Chapter 6:  Design and Analysis of clocked sequential Circuit  Flip-flops  State Diagram, State Table and State Equation
  • 17. Course Outline  Chapter 7:  Registers  Shift registers  Counters  Random Access Memory (RAM)  Chapter 8 onwards (optional)
  • 20. Decimal Number System  Base (also called radix) = 10  10 digits { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }  Digit Position  Integer & fraction  Digit Weight  Weight = (Base) Position  Magnitude  Sum of “Digit x Weight”  Formal Notation 1 0 -1 2 -2 5 1 2 7 4 10 1 0.1 100 0.01 500 10 2 0.7 0.04 d2*B2 +d1*B1 +d0*B0 +d-1*B-1 +d-2*B-2 (512.74)10 20
  • 21. Decimal Number System • A decimal number such as 7,392 represents a quantity equal to 7 thousands, plus 3 hundreds, plus 9 tens, plus 2 units. • The thousands, hundreds, etc., are powers of 10 implied by the position of the coefficients (symbols) in the number. 7 × 103 + 3 × 102 + 9 × 101 + 2 × 100
  • 22. Binary Number System • The binary system is a different number system. • The coefficients of the binary number system have only two possible values: 0 and 1. • Each coefficient is multiplied by a power of the radix, e.g., , and the results are added to obtain the decimal equivalent of the number 𝑎𝑗 2𝑗
  • 23. Binary Number System  Base = 2  2 digits { 0, 1 }, called binary digits or “bits”  Weights  Weight = (Base) Position  Magnitude  Sum of “Bit x Weight”  Formal Notation  Groups of bits 4 bits = Nibble 8 bits = Byte 1 0 -1 2 -2 2 1 1/2 4 1/4 1 0 1 0 1 1 *22 +0 *21 +1 *20 +0 *2-1 +1 *2-2 =(5.25)10 (101.01)2 23
  • 24. Binary Number System The decimal equivalent of the binary number 11010.11 is 26.75, as shown from the multiplication of the coefficients by powers of 2: 1 × 24 + 1 × 23 + 0 × 22 + 1 × 21 + 0 × 20 + 1 × 2−1 + 1 × 2−2 = 26.75 There are many different number systems. In general, a number expressed in a base‐r system has coefficients multiplied by powers of r:
  • 25. The coefficients range in value from 0 to r - 1. aj
  • 26. The Power of 2 n 2n 0 20=1 1 21=2 2 22=4 3 23=8 4 24=16 5 25=32 6 26=64 7 27=128 n 2n 8 28=256 9 29=512 10 210=1024 11 211=2048 12 212=4096 20 220=1M 30 230=1G 40 240=1T Mega Giga Tera Kilo 26
  • 27. Octal Number System  Base = 8  8 digits { 0, 1, 2, 3, 4, 5, 6, 7 }  Weights  Weight = (Base) Position  Magnitude  Sum of “Digit x Weight”  Formal Notation 1 0 -1 2 -2 8 1 1/8 64 1/64 5 1 2 7 4 5 *82 +1 *81 +2 *80 +7 *8-1 +4 *8-2 =(330.9375)10 (512.74)8 27
  • 28. Hexadecimal Number System  Base = 16  16 digits { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F }  Weights  Weight = (Base) Position  Magnitude  Sum of “Digit x Weight”  Formal Notation 1 0 -1 2 -2 1 E 5 7 A 1 *162 +14 *161 +5 *160 +7 *16-1 +10 *16-2 =(485.4765625)10 (1E5.7A)16 28
  • 29. Decimal (Integer) to Binary Conversion  Divide the number by the ‘Base’ (=2)  Take the remainder (either 0 or 1) as a coefficient  Take the quotient and repeat the division Example: (13)10 Quotient Remainder Coefficient Answer: (13)10 = (a3 a2 a1 a0)2 = (1101)2 MSB LSB 13/ 2 = 6 1 a0 = 1 6 / 2 = 3 0 a1 = 0 3 / 2 = 1 1 a2 = 1 1 / 2 = 0 1 a3 = 1 29
  • 30. Examples Convert decimal 41 to binary 41 2 20 1 2 10 0 2 5 0 2 2 1 2 1 0 (101001)2
  • 32. Examples 2 0.3125 0.625 0.625 0 2 0.625 1.25 0.25 1 2 0.25 0.50 0.50 0 2 0.50 1.00 00 1 Integer Fraction Coefficient (0.0101)2
  • 33. Examples 2 0.578 1.156 0.156 1 2 0.156 0.312 0.312 0 2 0.312 0.624 0.624 0 2 0.624 1.248 0.248 1 2 0.248 0.496 0.496 0 2 0.496 0.992 0.992 0 2 0.992 1.984 0.984 1 2 0.984 1.968 0.968 1 Integer Fraction Coefficient (0.10010011…)2
  • 35. Octal to Decimal Conversion
  • 36. Decimal to Octal Conversion Example: (175)10 Quotient Remainder Coefficient Answer: (175)10 = (a2 a1 a0)8 = (257)8 175 / 8 = 21 7 a0 = 7 21 / 8 = 2 5 a1 = 5 2 / 8 = 0 2 a2 = 2 Example: (0.3125)10 Integer Fraction Coefficient Answer: (0.3125)10 = (0.a-1 a-2 a-3)8 = (0.24)8 0.3125 * 8 = 2 . 5 0.5 * 8 = 4 . 0 a-2 = 4 a-1 = 2 36
  • 39. Binary − Octal Conversion  8 = 23  Each group of 3 bits represents an octal digit Octal Binary 0 0 0 0 1 0 0 1 2 0 1 0 3 0 1 1 4 1 0 0 5 1 0 1 6 1 1 0 7 1 1 1 Example: ( 1 0 1 1 0 . 0 1 )2 ( 2 6 . 2 )8 Assume Zeros Works both ways (Binary to Octal & Octal to Binary) 39
  • 40. Binary − Hexadecimal Conversion  16 = 24  Each group of 4 bits represents a hexadecimal digit Hex Binary 0 0 0 0 0 1 0 0 0 1 2 0 0 1 0 3 0 0 1 1 4 0 1 0 0 5 0 1 0 1 6 0 1 1 0 7 0 1 1 1 8 1 0 0 0 9 1 0 0 1 A 1 0 1 0 B 1 0 1 1 C 1 1 0 0 D 1 1 0 1 E 1 1 1 0 F 1 1 1 1 Example: ( 1 0 1 1 0 . 0 1 )2 ( 1 6 . 4 )16 Assume Zeros Works both ways (Binary to Hex & Hex to Binary) 40
  • 41. Example  (10110001010011.111100000110)2 = (?) 8  (10110001101011.11110010)2 = (?)16 Decimal Binary Octal Hex 00 0000 00 0 01 0001 01 1 02 0010 02 2 03 0011 03 3 04 0100 04 4 05 0101 05 5 06 0110 06 6 07 0111 07 7 08 1000 10 8 09 1001 11 9 10 1010 12 A 11 1011 13 B 12 1100 14 C 13 1101 15 D 14 1110 16 E 15 1111 17 F
  • 42. Octal − Hexadecimal Conversion  Convert to Binary as an intermediate step Example: ( 0 1 0 1 1 0 . 0 1 0 )2 ( 1 6 . 4 )16 Assume Zeros Works both ways (Octal to Hex & Hex to Octal) ( 2 6 . 2 )8 Assume Zeros 42
  • 43. Decimal, Binary, Octal and Hexadecimal Decimal Binary Octal Hex 00 0000 00 0 01 0001 01 1 02 0010 02 2 03 0011 03 3 04 0100 04 4 05 0101 05 5 06 0110 06 6 07 0111 07 7 08 1000 10 8 09 1001 11 9 10 1010 12 A 11 1011 13 B 12 1100 14 C 13 1101 15 D 14 1110 16 E 15 1111 17 F 43
  • 44. signed /unsigned numbers • Positive integers (including zero) can be represented as unsigned numbers. • For negative integers, we need a notation. • In ordinary arithmetic, a negative number is indicated by a minus sign and a positive number by a plus sign. • Because of hardware limitations, computers must represent everything with binary digits. • It is customary to represent the sign with a bit placed in the leftmost position of the number. • The convention is to make the sign bit 0 for positive and 1 for negative.
  • 45. signed /unsigned numbers • The user determines whether the number is signed or unsigned. • If the binary number is signed, then the leftmost bit represents the sign and the rest of the bits represent the number. • If the binary number is assumed to be unsigned, then the leftmost bit is the most significant bit of the number. • the string of bits 01001 can be considered as 9 (unsigned binary) or as +9 (signed binary) because the leftmost bit is 0. • The string of bits 11001 represents the binary equivalent of 25 when considered as an unsigned number and the binary equivalent of -9 when considered as a signed number. • This is because the 1 that is in the leftmost position designates a negative and the other four bits represent binary 9.
  • 46. signed /unsigned numbers • signed‐magnitude convention • Signed complement system • In this system, a negative number is indicated by its complement. • the 2’s complement is the most common. signed‐magnitude representation: 10001001 signed‐1’s‐complement representation: 11110110 signed‐2’s‐complement representation: 11110111
  • 47. signed /unsigned numbers • In signed‐magnitude, -9 is obtained from +9 by changing only the sign bit in the leftmost position from 0 to 1. • In signed‐1’s-complement, -9 is obtained by complementing all the • bits of +9, including the sign bit. • The signed‐2’s‐complement representation of -9 is obtained by taking the 2’s complement of the positive number, including the sign bit. (+9) 00001001 signed‐magnitude representation: 10001001 signed‐1’s‐complement representation: 11110110 signed‐2’s‐complement representation: 11110111
  • 48.
  • 49. Arithmetic Addition • The addition of two numbers in the signed‐magnitude system follows the rules of ordinary arithmetic. • If the signs are the same, we add the two magnitudes and give the sum the common sign. • If the signs are different, we subtract the smaller magnitude from the larger and give the difference the sign of the larger magnitude. • For example, (+25) + (-37) = -(37 - 25) = -12 is done by subtracting the smaller magnitude, 25, from the larger magnitude, 37, and appending the sign of 37 to the result.
  • 50. Arithmetic Addition The addition of two signed binary numbers with negative numbers represented in signed‐ 2’s‐complement form is obtained from the addition of the two numbers, including their sign bits. A carry out of the sign‐bit position is discarded. Note that negative numbers must be initially in 2’s‐complement form and that if the sum obtained after the addition is negative, it is in 2’s‐complement form.
  • 51. Arithmetic Addition In each of the four cases, the operation performed is addition with the sign bit included. Any carry out of the sign‐bit position is discarded, and negative results are automatically in 2’s‐complement form.
  • 52. Arithmetic Subtraction Subtraction of two signed binary numbers when negative numbers are in 2’s‐complement form is simple and can be stated as follows: Take the 2’s complement of the subtrahend (including the sign bit) and add it to the minuend (including the sign bit). A carry out of the sign‐bit position is discarded. It is worth noting that binary numbers in the signed‐complement system are added and subtracted by the same basic addition and subtraction rules as unsigned numbers.
  • 53. Addition Rules  0 + 0 = 00 ( 0 with a 0 carry )  0 + 1 = 01 ( 1 with a 0 carry )  1 + 0 = 01 ( 1 with a 0 carry )  1 + 1 = 10 ( 0 with a 1 carry )
  • 54. Addition Rules w/Carries  0+0+0 = 00 (0 WITH 0 CARRY)  0+0+1 = 01 (1 WITH 0 CARRY)  0+1+1 = 10 (0 WITH 1 CARRY)  1+1+1 = 11 (1 WITH 1 CARRY)
  • 55. Binary Addition  Column Addition 1 0 1 1 1 1 1 1 1 1 0 + 0 0 0 0 1 1 1 ≥ (2)10 1 1 1 1 1 1 = 61 = 23 = 84 55
  • 56. Binary Subtraction  Borrow a “Base” when needed 0 0 1 1 1 0 1 1 1 1 0 − 0 1 0 1 1 1 0 = (10)2 2 2 2 2 1 0 0 0 1 = 77 = 23 = 54 56
  • 57. Complements Complements are used in digital computers to simplify the subtraction operation and for logical manipulation. • There are two types of complements for each base‐r system: • the radix complement (r’s complement) • the diminished radix complement (r - 1)’s complement
  • 58. r’s Complement •Given a number N in base r having n digits, •the r’s complement of N is defined as rn - N for N!= 0 and 0 for N = 0 •For decimal numbers the base or r = 10, •so the 10’s complement of N is 10n-N. •100000……. - N Digit n Digit n-1 Next digit Next digit First digit 0 0 0 0 0 - 1
  • 59. 10’s complement Examples (DECIMAL) Find the 10’s complement of 546700 and 12389 The 10’s complement of 546700 is 1000000 - 546700= 453300 and the 10’s complement of 12389 is 100000 - 12389 = 87611. 5 4 6 7 0 - 0 0 0 0 0 0 0 4 5 3 3 0 0 1 2 3 8 - 9 1 0 0 0 0 0 8 7 6 1 1 1
  • 60. 10’s complement Examples (fractional part) rn - N 100 - N Find 10s complement of 0.327 1-0.327 = 0.673
  • 61. For binary numbers, r = 2, r’s complement is the 2’s complement. The 2’s complement of N is 2n - N. 2’s complement (BINARY) Digit n Digit n-1 Next digit Next digit First digit 0 0 0 0 0 - 1 rn - N
  • 62. 2’s complement Example (integer part) The 2’s complement of 1011001 is 0100111 The 2’s complement of 0001111 is 1110001 0 1 1 0 0 - 1 0 0 0 0 0 0 1 0 0 1 1 1 0 0 1 1 1 - 1 1 1 0 0 0 1 1 0 0 0 1 1 0 0 0 0 0 0 0 1 2n - N
  • 63. 2’s complement Example (fractional part)  The 2’s complement of (0.0110)2
  • 64. 2’s complement Example (fractional part)  The 2’s complement of (0.0110)2 20 - N  0.1010
  • 65. Complements of numbers (r-1 )’s Complement •Given a number N in base r having n digits, •the (r- 1)’s complement of N is defined as (rn – r -m - N ) (rn – 1) - N where n = num. of digits in integer part and m = num. of digit in fractional part •For decimal numbers the r = 10 and r- 1= 9, •so the 9’s complement of N (integer part only ) is (10n-1)-N •99999……. - N Digit n Digit n-1 Next digit Next digit First digit 9 9 9 9 9 -
  • 66. Find the 9’s complement of 546700 and 12389 The 9’s complement of 546700 is 999999 - 546700= 453299 and the 9’s complement of 12389 is 99999- 12389 = 87610. 9’s complement Examples (DECIMAL) 5 4 6 7 0 - 0 9 9 9 9 9 9 4 5 3 2 9 9 1 2 3 8 - 9 9 9 9 9 9 8 7 6 1 0
  • 67. 9’s complement Examples (DECIMAL)  9s complement of 0.3267 (rn – r -m - N ) where n = num. of digits in integer part and m = num. of digit in fractional part
  • 68. 9’s complement Examples (DECIMAL)  9s complement of 0.3267 (rn – r -m - N ) where n = num. of digits in integer part and m = num. of digit in fractional part 0.673 2
  • 69. l’s complement (BINARY)  For binary numbers, r = 2 and r - 1 = 1,  r-1’s complement is the l’s complement.  The l’s complement of N is (2n - 1) - N. Digit n Digit n-1 Next digit Next digit First digit 1 1 1 1 1 Bit n-1 Bit n-2 ……. Bit 1 Bit 0 -
  • 70. l’s complement (BINARY) Find r-1 complement for binary number N with four binary digits. r-1 complement for binary means 2-1 complement or 1’s complement. n = 4, we have 24 = (10000)2 and 24 - 1 = (1111)2. The l’s complement of N is (24 - 1) - N. = (1111) - N (rn – r -m - N ) where n = num. of digits in integer part and m = num. of digit in fractional part
  • 71. The complement 1’s of 1011001 is 0100110 0 1 1 0 0 - 1 1 1 1 1 1 1 1 0 0 1 1 0 0 0 1 1 1 - 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 0 The 1’s complement of 0001111 is 1110000 0 1 1 l’s complement (BINARY)
  • 72. Fast Methods for 2’s Complement Method 1: The 2’s complement of binary number is obtained by adding 1 to the l’s complement value. Example: 1’s complement of 101100 is 010011 (invert the 0’s and 1’s) 2’s complement of 101100 is 010011 + 1 = 010100
  • 73. Fast Methods for 2’s Complement Method 2: The 2’s complement can be formed by leaving all least significant 0’s and the first 1 unchanged, and then replacing l’s by 0’s and 0’s by l’s in all other higher significant bits. Example: The 2’s complement of 1101100 is 0010100 Leave the two low-order 0’s and the first 1 unchanged, and then replacing 1’s by 0’s and 0’s by 1’s in the four most significant bits.
  • 74. Examples  Finding the 2’s complement of (01100101)2  Method 1 – Simply complement each bit and then add 1 to the result. (01100101)2 [N] = 2’s complement = 1’s complement (10011010)2 +1 =(10011011)2  Method 2 – Starting with the least significant bit, copy all the bits up to and including the first 1 bit and then complement the remaining bits. N = 0 1 1 0 0 1 0 1 [N] = 1 0 0 1 1 0 1 1
  • 75. Subtraction of Unsigned Numbers using r’s complement Subtract N from M : M – N 1. Add M to the r’s complement of N 2. Inspect the result obtained in step 1 for an end carry a. If an end carry occurs, discard it. b. If an end carry does not occur, take the r’s complement of the sum obtained in step 1 and place a negative sign.
  • 76. Example 1 (Decimal unsigned numbers), perform the subtraction 72532 - 13250 = 59282. M > N : “Case 1” “Do not take complement of sum and discard carry” The 10’s complement of 13250 is 86750. Therefore: M = 72532 10’s complement of N =+86750 Sum= 159282 Discard end carry 105= - 100000 Answer = 59282 no complement
  • 77. Example 2 (Decimal unsigned numbers), Now consider an example with M <N. The subtraction 13250 - 72532 produces negative 59282. Using the procedure with complements, we have M = 13250 10’s complement of N = +27468 Sum = 40718 Take 10’s complement of Sum = 100000 -40718 The number is : 59282 Place negative sign in front of the number: -59282
  • 78. Example 1 (Binary unsigned numbers)
  • 79. Subtraction of Unsigned Numbers using (r -1)’s complement Subtract N from M : M – N 1. Add M to the (r-1)’s complement of N 2. Inspect the result obtained in step 1 for an end carry a. If an end carry occurs, add 1 to the least significant digit(end-around carry) b. If an end carry does not occur, take the (r-1)’s complement of the sum obtained in step 1 and place a negative sign.
  • 80. Examples (Decimal unsigned numbers)  M = 72532 N = 3250
  • 81. Examples (Binary unsigned numbers)  M = 1010100 N = 1000100
  • 82. Comparison  1’s complement 1. Easier to implement 2. Needs two additions for subtraction procedure  2’s complement 1. Harder to implement 2. Needs one additions for subtraction procedure
  • 83. Combinational Logical Circuits Binary Logic and Gates, Boolean Algebra
  • 84. Overview Chapter 2 - Part 1 84  Part 1 – Gate Circuits and Boolean Equations  Binary Logic and Gates  Boolean Algebra  Standard Forms  Part 2 – Circuit Optimization  Two-Level Optimization  Map Manipulation  Practical Optimization (Espresso)  Multi-Level Circuit Optimization  Part 3 – Additional Gates and Circuits  Other Gate Types  Exclusive-OR Operator and Gates  High-Impedance Outputs
  • 85. Binary Logic and Gates Chapter 2 - Part 1 85  Binary variables take on one of two values.  Logical operators operate on binary values and binary variables.  Basic logical operators are the logic functions AND, OR and NOT.  Logic gates implement logic functions.  Boolean Algebra: a useful mathematical system for specifying and transforming logic functions.  We study Boolean algebra as a foundation for designing and analyzing digital systems!
  • 86. Binary Variables Chapter 2 - Part 1 86  Recall that the two binary values have different names:  True/False  On/Off  Yes/No  1/0  We use 1 and 0 to denote the two values.  Variable identifier examples:  A, B, y, z, or X1 for now  RESET, START_IT, or ADD1 later
  • 87. Logical Operations Chapter 2 - Part 1 87  The three basic logical operations are:  AND  OR  NOT  AND is denoted by a dot (·).  OR is denoted by a plus (+).  NOT is denoted by an overbar ( ¯ ), a single quote mark (') after, or (~) before the variable.
  • 88. Notation Examples Chapter 2 - Part 1 88  Examples:  is read “Y is equal to A AND B.”  is read “z is equal to x OR y.”  is read “X is equal to NOT A.”  Note: The statement: 1 + 1 = 2 (read “one plus one equals two”) is not the same as 1 + 1 = 1 (read “1 or 1 equals 1”). = B A Y  y x z + = A X =
  • 89. Operator Definitions Chapter 2 - Part 1 89  Operations are defined on the values "0" and "1" for each operator: AND 0 · 0 = 0 0 · 1 = 0 1 · 0 = 0 1 · 1 = 1 OR 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 1 NOT 1 0 = 0 1=
  • 90. Logic Function Implementation Chapter 2 - Part 1 90  Using Switches  For inputs:  logic 1 is switch closed  logic 0 is switch open  For outputs:  logic 1 is light on  logic 0 is light off. Switches in series => AND Switches in parallel => OR
  • 91. Logic Function Implementation (Continued) Chapter 2 - Part 1 91  Example: Logic Using Switches  Light is on (L = 1) for L(A, B, C, D) = and off (L = 0), otherwise. B A D C
  • 92. Logic Gate Symbols and Behavior Chapter 2 - Part 1 92  Logic gates have special symbols:  And waveform behavior in time as follows: (b) Timing diagram X 0 0 1 1 Y 0 1 0 1 X · Y (AND) 0 0 0 1 X 1 Y (OR) 0 1 1 1 (NOT) X 1 1 0 0 (a) Graphic symbols OR gate X Y Z = X + Y X Y Z = X · Y AND gate X Z = X NOT gate or inverter
  • 93. Gate Delay Chapter 2 - Part 1 93  In actual physical gates, if one or more input changes causes the output to change, the output change does not occur instantaneously.  The delay between an input change(s) and the resulting output change is the gate delay denoted by tG: tG tG Input Output Time (ns) 0 0 1 1 0 0.5 1 1.5 tG = 0.3 ns
  • 94. Truth Tables Chapter 2 - Part 1 94  Truth table - a tabular listing of the values of a function for all possible combinations of values on its arguments  Example: Truth tables for the basic logic operations: 0 1 1 0 X NOT X Z = 1 1 1 0 0 1 0 1 0 0 0 0 Z = X.Y Y X AND OR X Y Z = X+Y 0 0 0 0 1 1 1 0 1 1 1 1
  • 95. Logic Diagrams and Expressions Chapter 2 - Part 1 95  Boolean equations, truth tables and logic diagrams describe the same function!  Truth tables are unique; expressions and logic diagrams are not. This gives flexibility in implementing functions. X Y F Z Logic Diagram Equation Z Y X F + = Truth Table 1 1 1 1 1 1 1 0 1 1 0 1 1 1 0 0 0 0 1 1 0 0 1 0 1 0 0 1 0 0 0 0 X Y Z Z Y X F  + =
  • 96. Boolean Algebra Chapter 2 - Part 1 96 1. 3. 5. 7. 9. 11. 13. 15. 17. Commutative Associative Distributive DeMorgan’s 2. 4. 6. 8. X . 1 X = X . 0 0 = X . X X = 0 = X . X  An algebraic structure defined on a set of at least two elements, B, together with three binary operators (denoted +, · and ) that satisfies the following basic identities: 10. 12. 14. 16. X + Y Y + X = (X + Y) Z + X + (Y Z) + = X(Y + Z) XY XZ + = X + Y X . Y = XY YX = (XY) Z X(Y Z) = X + YZ (X + Y) (X + Z) = X . Y X + Y = X + 0 X = + X 1 1 = X + X X = 1 = X + X X = X
  • 97. Boolean algebra • Boolean algebra is the mathematics of digital logic. • A basic knowledge of Boolean algebra is indispensable to the study and analysis of logic circuits The most common postulates used to formulate various algebraic structures are as follows: Closure. Associative law. Commutative law. Identity element. Inverse. Distributive law.
  • 98. Boolean algebra Closure. A set S is closed with respect to a binary operator if, for every pair of elements of S, the binary operator specifies a rule for obtaining a unique element of S. Associative law. A binary operator * on a set S is said to be associative whenever
  • 99. Boolean algebra Commutative law. A binary operator * on a set S is said to be commutative whenever Identity element. A set S is said to have an identity element with respect to a binary operation * on S if there exists an element e in S with the property that
  • 100. Boolean algebra Inverse. A set S having the identity element e with respect to a binary operator * is said to have an inverse whenever, for every x ϵ S, there exists an element y ϵ S such that Distributive law. If (*) and (.) are two binary operators on a set S, (*) is said to be distributive over (.) whenever
  • 101. Boolean Operator Precedence Chapter 2 - Part 1 101  The order of evaluation in a Boolean expression is: 1. Parentheses 2. NOT 3. AND 4. OR  Consequence: Parentheses appear around OR expressions  Example: F = A(B + C)(C + D)
  • 102. AXIOMATIC DEFINITION OF BOOLEAN ALGEBRA • In 1854, George Boole developed an algebraic system now called Boolean algebra. • In 1938, Claude E. Shannon introduced a two‐valued Boolean algebra called switching algebra. • For the formal definition of Boolean algebra, we shall employ the postulates formulated by E. V. Huntington in 1904. Boolean algebra is an algebraic structure defined by a set of elements, together with two binary operators, (+) and (.) , provided that the following (Huntington) postulates are satisfied:
  • 103. Huntington postulates 1) (a) The structure is closed with respect to the operator (+). (b) The structure is closed with respect to the operator (.) . 2) (a) The element 0 is an identity element with respect to +; that is, x + 0 =0 + x = x. (b) The element 1 is an identity element with respect to (.) ; that is, x . 1 = 1 . x = x. 3) (a) The structure is commutative with respect to +; that is, x + y = y + x. (b) The structure is commutative with respect to . ; that is, x . y = y . x.
  • 104. Huntington postulates 4) (a) The operator . is distributive over +; that is, x . (y + z) = (x . y) + (x . z). (b) The operator + is distributive over . ; that is, x + (y . z) = (x + y) . (x + z). 5) For every element x ϵ B, there exists an element x’ ϵ B (called the complement of x) such that (a) x + x’ = 1 and (b) x . x’ = 0. 6) There exist at least two elements x, y ϵ B such that x y.
  • 105. Two‐Valued Boolean Algebra A two‐valued Boolean algebra is defined on a set of two elements, B = {0, 1}, with rules for the two binary operators + and . as shown in the following operator tables
  • 106. Huntington postulates for Two‐Valued Boolean Algebra
  • 107. Huntington postulates for Two‐Valued Boolean Algebra
  • 108. Huntington postulates for Two‐Valued Boolean Algebra
  • 109. Duality If the dual of an algebraic expression is desired, we simply interchange OR and AND operators and replace 1’s by 0’s and 0’s by 1’s.
  • 110. Basic Theorems Six theorems of Boolean algebra
  • 112. Huntington postulates 2) (a) x + 0 =0 + x = x. (b) x . 1 = 1 . x = x. 3) (a) x + y = y + x. (b) x . y = y . x. 4) (a) x . (y + z) = (x . y) + (x . z). (b) x + (y . z) = (x + y) . (x + z). 5) (a) x + x’ = 1 (b) x . x’ = 0.
  • 113. THEOREM 1(a): x + x = x.
  • 114. THEOREM 1(b): x . x = x.
  • 115. THEOREM 2(a): x + 1 = 1.
  • 116. THEOREM 6(a): x + xy = x.
  • 117. BOOLEAN FUNCTIONS • Boolean algebra is an algebra that deals with binary variables and logic operations. • A Boolean function described by an algebraic expression consists of binary variables, the constants 0 and 1, and the logic operation symbols. • For a given value of the binary variables, the function can be equal to either 1 or 0. F1 = x + y’z
  • 118. F1 = x + y’z
  • 120. Boolean Function 2) (a) x + 0 =0 + x = x. (b) x . 1 = 1 . x = x. 3) (a) x + y = y + x. (b) x . y = y . x. 4) (a) x . (y + z) = (x . y) + (x . z). (b) x + (y . z) = (x + y) . (x + z). 5) (a) x + x’ = 1 (b) x . x’ = 0. three terms and eight literals
  • 121. Algebraic Manipulation A literal is a single variable within a term The manipulation of Boolean algebra consists mostly of reducing an expression for the purpose of obtaining a simpler circuit.
  • 122. Simplification by Theorem & Postulate consensu s theorem
  • 123. Complement of a Function • The complement of a function F is F’ and is obtained from an interchange of 0’s for 1’s and 1’s for 0’s in the value of F. • The complement of a function may be derived algebraically through DeMorgan’s theorems The three‐variable form of the first DeMorgan’s theorem
  • 124. Complement of a Function • The generalized form of DeMorgan’s theorems states that the complement of a function is obtained by interchanging AND and OR operators and complementing each literal.
  • 125. Complement of a Function
  • 126. Complement of a Function
  • 127. CANONICAL FORMS Minterms • A binary variable may appear either in its normal form (x) or in its complement form (x’). • Now consider two binary variables x and y combined with an AND operation. • Since each variable may appear in either form, there are four possible combinations: x’y’, x’y, xy’, and xy. • Each of these four AND terms is called a minterm, or a standard product. • n variables can be combined to form 2𝑛 minterms
  • 128. CANONICAL FORMS Each minterm is obtained from an AND term of the n variables, with each variable being primed if the corresponding bit of the binary number is a 0 and unprimed if a 1 A symbol for each minterm is of the form 𝑚𝑗, where the subscript j denotes the decimal equivalent of the binary number of the minterm designated. Maxterms In a similar fashion, n variables forming an OR term, with each variable being primed or unprimed, provide 2𝑛 possible combinations, called maxterms, or standard sums
  • 129. CANONICAL FORMS It is important to note that (1) each maxterm is obtained from an OR term of the n variables, with each variable being unprimed if the corresponding bit is a 0 and primed if a 1, and (2) each maxterm is the complement of its corresponding minterm and vice versa. A Boolean function can be expressed algebraically from a given truth table by forming a minterm for each combination of the variables that produces a 1 in the function and then taking the OR of all those terms.
  • 130. Minterms and Maxterms  Minterms:  AND term with every variable in normal or complemented form.  n variables can be combined to form 2n minterms.  0 => complement and 1 => normal  Maxterms:  OR term with every variable in normal or complemented form.  n variables can be combined to form 2n maxterms.  1 => complement and 0 => normal
  • 131. Maxterms and Minterms  Examples: Two variable minterms and maxterms.  The index above is important for describing which variables in the terms are true and which are complemented. Index Minterm Maxterm 0 x y x + y 1 x y x + y 2 x y x + y 3 x y x + y
  • 132. Index Examples – Four Variables Chapter 2 - Part 1 132 Index Binary Minterm Maxterm i Pattern mi Mi 0 0000 1 0001 3 0011 5 0101 7 0111 10 1010 13 1101 15 1111 d c b a d c b a + + + d c b a d c b a + + + d c b a d c b a + + + d c b a + + + d c b a d c b a + + + d b a d c b a d c b a + + + ? ? ? ? c
  • 133. CANONICAL FORMS i m M = i i i M m =
  • 134. Function Representation by Canonical Forms  Sum of Minterms (SOM)  Form a minterm for each combination of the variables (input) which produces a 1 in truth table, and then taking the OR of all those minterms. x y z F1 F2 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1
  • 135. Minterm Function Example  Example: Find F1 = m1 + m4 + m7  F1 = x y z + x y z + x y z x y z index F1 0 0 0 0 0 0 0 1 1 1 0 1 0 2 0 0 1 1 3 0 1 0 0 4 1 1 0 1 5 0 1 1 0 6 0 1 1 1 7 1
  • 136. Minterm Function Example  F(A, B, C, D, E) = m2 + m9 + m17 + m23  F(A, B, C, D, E) =
  • 137. CANONICAL FORMS Any Boolean function can be expressed as a sum of minterms (with “sum” meaning the ORing of terms).
  • 138. Function Representation by Canonical Forms  Product of Maxterms (POM)  Form a maxterm for each combination of the variables (input) which produces a 0 in truth table, and then taking the AND of all those maxterms. x y z F1 F2 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 F1 = (x+y+z). (x+y’+z). (x+y’+z’). (x’+y+z’). (x’+y’+z) F2 = = (x+y+z). (x+y+z’). (x+y’+z). (x’+y+z)
  • 139. Maxterm Function Example  Example: Implement F1 in maxterms: F1 = M0 · M2 · M3 · M5 · M6 ) z y z)·(x y ·(x z) y (x F1 + + + + + + = z) y x )·( z y x ·( + + + + x y z index F1 0 0 0 0 0 0 0 1 1 1 0 1 0 2 0 0 1 1 3 0 1 0 0 4 1 1 0 1 5 0 1 1 0 6 0 1 1 1 7 1
  • 140. Maxterm Function Example F2 = = (x+y+z). (x+y+z’). (x+y’+z). (x’+y+z) • Example: Implement F1 in maxterms: F1 = M0 · M2 · M3 · M5 · M6 ) z y z)·(x y ·(x z) y (x F1 + + + + + + = z) y x )·( z y x ·( + + + + F2 = M( ) · M ( ) · M ( ) · M ( ) ?
  • 141. Maxterm Function Example   F(A, B,C,D) = 14 11 8 3 M M M M ) D , C , B , A ( F    =
  • 142. CANONICAL FORMS Now consider the complement of a Boolean function
  • 143. CANONICAL FORMS Any Boolean function can be expressed as a product of maxterms (with “product” meaning the ANDing of terms). The procedure for obtaining the product of maxterms directly from the truth table is as follows: Form a maxterm for each combination of the variables that produces a 0 in the function, and then form the AND of all those maxterms. Boolean functions expressed as a sum of minterms or product of maxterms are said to be in canonical form . A Boolean function can be expressed algebraically from a given truth table by forming a minterm for each combination of the variables that produces a 1 in the function and then taking the OR of all those terms.
  • 144. Sum of Minterms The minterms whose sum defines the Boolean function are those which give the 1’s of the function in a truth table. n variables -> 22𝑛 functions • Any Boolean function can be expressed as a Sum of Minterms. • For the function table, the minterms used are the terms corresponding to the 1's • For expressions, expand all terms first to explicitly list all minterms. Do this by “ANDing” any term missing a variable v with a term ( v + v ). • Example: Implement f = x + x’ . Y’ as a sum of minterms. First expand terms: f =x .(y + y’) + x’ . Y’ Then distribute terms: x . y + x . Y’ + x’ . Y’ Express as sum of minterms: f = m3 + m2 + m0
  • 145. Another SOM Example  Example:  There are three variables, A, B, and C which we take to be the standard order.  Expanding the terms with missing variables:  Collect terms (removing all but one of duplicate terms):  Express as SOM: C B A F + =
  • 146. Shorthand SOM Form  From the previous example, we started with:  We ended up with: F = m1+m4+m5+m6+m7  This can be denoted in the formal shorthand:  Note that we explicitly show the standard variables in order and drop the “m” designators. ) 7 , 6 , 5 , 4 , 1 ( ) C , B , A ( F m  = C B A F + =
  • 147.
  • 148. Product of Maxterms (POM)  Any Boolean Function can be expressed as a Product of Maxterms (POM).  For the function table, the maxterms used are the terms corresponding to the 0's.  For an expression, expand all terms first to explicitly list all maxterms. Do this by first applying the second distributive law , “ORing” terms missing variable v with a term equal to and then applying the distributive law again.  Example: Convert to product of maxterms: Apply the distributive law: Add missing variable z: Express as POM: f = M2 · M3 y x x ) z , y , x ( f + = y x ) y (x 1 ) y )(x x (x y x x + = +  = + + = + ( ) z y x ) z y x ( z z y x + + + + =  + + v v
  • 149. Product of Maxterms Express Boolean function F = xy + x’z into POM form
  • 150. Product of Maxterms A functions of n binary variables can be also expressed as a product of maxterms.
  • 151. Conversion between Canonical Forms  To convert between sum-of-minterms (SOM) and product-of-maxterms (POM) form (or vice-versa) we follow these steps:  Find the function complement by swapping terms in the list with terms not in the list.  Change from products to sums, or vice versa.  Example: Given F as before:  Form the Complement:  Then use the other form with the same indices – this forms the complement again, giving the other form of the original function: ) 7 , 5 , 3 , 1 ( ) z , y , x ( F m  = ) 6 , 4 , 2 , 0 ( ) z , y , x ( F m  = ) 6 , 4 , 2 , 0 ( ) z , y , x ( F M  =
  • 152. Conversion between Canonical Forms F(A, B, C) =∑ (1, 4, 5, 6, 7) F’(A, B, C) = ∑(0, 2, 3) = m0 + m2 + m3 F = (m0 + m2 + m3)’ = m0’ m2’ m3’ = M0M2M3 = ∏(0, 2, 3) To convert from one canonical form to another, interchange the symbols ∑ and ∏ and list those numbers missing from the original form.
  • 153. Function Complements  The complement of a function expressed as a sum of minterms is constructed by selecting the minterms missing in the sum-of-minterms canonical forms.  Alternatively, the complement of a function expressed by a Sum of Minterms form is simply the Product of Maxterms with the same indices.  Example: Given ) 7 , 5 , 3 , 1 ( ) z , y , x ( F m  = ) 6 , 4 , 2 , 0 ( ) z , y , x ( F m  = ) 7 , 5 , 3 , 1 ( ) z , y , x ( F M  =
  • 154. Function F = xy + x’z F(x, y, z) = ∑(1, 3, 6, 7) F(x, y, z) = ∏(0, 2, 4, 5)
  • 155. Standard Forms • The two canonical forms of Boolean algebra are basic forms that one obtains from reading a given function from the truth table. • These forms are very seldom the ones with the least number of literals, because each minterm or maxterm must contain, by definition, all the variables, either complemented or uncomplemented • Another way to express Boolean functions is in standard form. • In this configuration, the terms that form the function may contain one, two, or any number of literals. • There are two types of standard forms: the sum of products and products of sums.
  • 156. Standard Forms It is assumed that the input variables are directly available in their complements, so inverters are not included in the diagram. This circuit configuration is referred to as a two‐level implementation.
  • 157. Standard Forms A product of sums is a Boolean expression containing OR terms, called sum terms. A Boolean function may be expressed in a nonstandard form
  • 158. OTHER LOGIC OPERATIONS • AND • OR Two Variables functions for n binary variables 2 2 n The AND and OR functions are only 2 of a total of 16 possible functions formed with two binary variables
  • 159. OTHER LOGIC OPERATIONS 2 2 n The 16 functions listed can be subdivided into three categories: 1. Two functions that produce a constant 0 or 1. 2. Four functions with unary operations: complement and transfer. 3. Ten functions with binary operators that define eight different operations: AND, OR, NAND, NOR, exclusive‐OR, equivalence, inhibition, and implication.
  • 160.
  • 167. Positive and Negative Logic Choosing the high‐level H to represent logic 1 defines a positive logic system. Choosing the low‐level L to represent logic 1 defines a negative logic system.
  • 168. Demonstration of positive and negative logic
  • 169. Demonstration of positive and negative logic polarity indicator Thus, the same physical gate can operate either as a positive‐logic AND gate or as a negative‐logic OR gate.
  • 170.
  • 171.  A Simplification Example:   Writing the minterm expression: F = A B C + A B C + A B C + ABC + ABC  Simplifying: F =  Simplified F contains 3 literals compared to 15 in minterm F Standard Sum-of-Products (SOP) ) 7 , 6 , 5 , 4 , 1 ( m ) C , B , A ( F  = Chapter 2 - Part 1 171
  • 172. Implementation of SOP Expression  The two implementations for F are shown below – it is quite apparent which is simpler! F A B C A B C A B C A B C A B C F B C A Chapter 2 - Part 1 172
  • 173. SOP and POS Observations  The previous examples show that:  Canonical Forms (Sum-of-minterms, Product-of- Maxterms), or other standard forms (SOP, POS) differ in complexity  Boolean algebra can be used to manipulate equations into simpler forms.  Simpler equations lead to simpler two-level implementations  Questions:  How can we attain a “simplest” expression?  Is there only one minimum cost circuit?  The next part will deal with these issues. Chapter 2 - Part 1 173
  • 174. Karnaugh Maps (K-map)  A K-map is a collection of squares  Each square represents a minterm  The collection of squares is a graphical representation of a Boolean function  Adjacent squares differ in the value of one variable  Alternative algebraic expressions for the same function are derived by recognizing patterns of squares  The K-map can be viewed as  A reorganized version of the truth table Chapter 2 - Part 1 174
  • 175. Some Uses of K-Maps  Provide a means for:  Finding optimum or near optimum  SOP and POS standard forms, and  two-level AND/OR and OR/AND circuit implementations for functions with small numbers of variables  Visualizing concepts related to manipulating Boolean expressions, and  Demonstrating concepts used by computer-aided design programs to simplify large circuits Chapter 2 - Part 1 175
  • 176. Two Variable Maps  A 2-variable Karnaugh Map:  Note that minterm m0 and minterm m1 are “adjacent” and differ in the value of the variable y  Similarly, minterm m0 and minterm m2 differ in the x variable.  Also, m1 and m3 differ in the x variable as well.  Finally, m2 and m3 differ in the value of the variable y y = 0 y = 1 x = 0 m0 = m1 = x = 1 m2 = m3 = y x y x y x y x Chapter 2 - Part 1 176
  • 177. K-Map and Truth Tables  The K-Map is just a different form of the truth table.  Example – Two variable function:  We choose a,b,c and d from the set {0,1} to implement a particular function, F(x,y). Function Table K-Map Input Values (x,y) Function Value F(x,y) 0 0 a 0 1 b 1 0 c 1 1 d y = 0 y = 1 x = 0 a b x = 1 c d Chapter 2 - Part 1 177
  • 178. K-Map Function Representation  Example: For function F(x,y), the two adjacent cells containing 1’s can be combined using the Minimization Theorem: F = x y = 0y = 1 x = 0 0 0 x = 1 1 1 y x y x ) y x ( F + = Chapter 2 - Part 1 178
  • 179. K-Map Function Representation  Example: G(x,y) = x y+x y+x y G = x+y y = 0 y = 1 x = 0 0 1 x = 1 1 1 Chapter 2 - Part 1 179
  • 180. Three Variable Maps  A three-variable K-map:  Where each minterm corresponds to the product terms:  Note that if the binary value for an index differs in one bit position, the minterms are adjacent on the K-Map yz=00 yz=01 yz=11 yz=10 x=0 m0 m1 m3 m2 x=1 m4 m5 m7 m6 yz=00 yz=01 yz=11 yz=10 x=0 x=1 z y x z y x z y x z y x z y x z y x z y x z y x Chapter 2 - Part 1 180
  • 181. 181 Any two adjacent squares in the map differ by only one variable Thus, any two minterms in adjacent squares (vertically or horizontally, but not diagonally, adjacent) that are ORed together will cause a removal of the dissimilar variable.
  • 182. Alternative Map Labeling  Map use largely involves:  Entering values into the map, and  Reading off product terms from the map.  Alternate labelings are useful: y z x 1 0 2 4 3 5 6 7 x y z z y y z z 1 0 2 4 3 5 6 7 x 0 1 00 01 11 10 x Chapter 2 - Part 1 182
  • 183. Example Functions  By convention, we represent the minterms of F by a "1" in the map and leave the minterms of blank  Example:  Example:  Learn the locations of the 8 indices based on the variable order shown (x, most significant and z, least significant) on the map boundaries y x 1 0 2 4 3 5 6 7 1 1 1 1 z x y 1 0 2 4 3 5 6 71 1 1 1 z (2,3,4,5) z) y, F(x, m  = (3,4,6,7) c) b, G(a, m  = F Chapter 2 - Part 1 183
  • 184. Combining Squares By combining squares, we reduce number of literals in a product term, reducing the literal cost, thereby reducing the other two cost criteria  On a 3-variable K-Map:  One square represents a minterm with three variables  Two adjacent squares represent a product term with two variables  Four “adjacent” terms represent a product term with one variable  Eight “adjacent” terms is the function of all ones (no variables) = 1. Chapter 2 - Part 1 184
  • 185. Example: Combining Squares  Example: Let  Applying the Minimization Theorem three times:  Thus the four terms that form a 2 × 2 square correspond to the term "y". y = z y yz+ = z y x z y x z y x z y x ) z , y , x ( F + + + = x y 1 0 2 4 3 5 6 71 1 1 1 z m(2,3,6,7) F  = Chapter 2 - Part 1 185
  • 186. Three-Variable Maps  Reduced literal product terms for SOP standard forms correspond to rectangles on K-maps containing cell counts that are powers of 2.  Rectangles of 2 cells represent 2 adjacent minterms; of 4 cells represent 4 minterms that form a “pairwise adjacent” ring.  Rectangles can contain non-adjacent cells as illustrated by the “pairwise adjacent” ring above. Chapter 2 - Part 1 186
  • 187. Three-Variable Maps  Example Shapes of 2-cell Rectangles:  Read off the product terms for the rectangles shown y 0 1 3 2 5 6 4 7 x z Chapter 2 - Part 1 187
  • 188. Three-Variable Maps  Example Shapes of 4-cell Rectangles:  Read off the product terms for the rectangles shown y 0 1 3 2 5 6 4 7 x z Chapter 2 - Part 1 188
  • 189. Three Variable Maps z) y, F(x, = y 1 1 x z 1 1 1 z z y x + y x  K-Maps can be used to simplify Boolean functions by systematic methods. Terms are selected to cover the “1s”in the map.  Example: Simplify ) (1,2,3,5,7 z) y, F(x, m  = Chapter 2 - Part 1 189
  • 190. Three-Variable Map Simplification  Use a K-map to find an optimum SOP equation for ,7) (0,1,2,4,6 Z) Y, F(X, m  = Chapter 2 - Part 1 190
  • 191. 3 variable K-map look 191
  • 192. Example 3.1 Chapter 2 - Part 1 192 F (x, y, z) = (2, 3, 4, 5) 
  • 193. Example 3.1 Chapter 2 - Part 1 193
  • 194. Example 3.2 Chapter 2 - Part 1 194 F (x, y, z) = (3, 4, 6, 7) 
  • 195. Example 3.2 Chapter 2 - Part 1 195
  • 196. Example 3.3 Chapter 2 - Part 1 196 F (x, y, z) = (0, 2, 4, 5, 6) 
  • 197. Example 3.3 Chapter 2 - Part 1 197
  • 198. Example 3.4 Chapter 2 - Part 1 198
  • 199. Example 3.4 Chapter 2 - Part 1 199
  • 200. Digital Logic Design 4 Variable K-MAP
  • 201. FOUR-VARIABLE K-MAP 16 minterms rows and columns → only one digit changing value between two adjacent rows or columns The map minimization of four-variable Boolean functions is similar to the method used to minimize three-variable functions. One square represents one minterm, giving a term with four literals. Two adjacent squares represent a term with three literals. Four adjacent squares represent a term with two literals. Eight adjacent squares represent a term with one literal. Sixteen adjacent squares produce a function that is always equal to 1.
  • 203. EXAMPLE 3.5 F (w, x, y, z) = (0, 1, 2, 4, 5, 6, 8, 9, 12, 13, 14) 
  • 204.
  • 205. EXAMPLE 3.6 F = A’B’C’ + B’CD’ + A’BCD’ + AB’C’ F = B’D’ +B’C’ +A’CD’
  • 206.
  • 207. Prime Implicants In choosing adjacent squares in a map, we must ensure that (1) all the minterms of the function are covered when we combine the squares, (2) the number of terms in the expression is minimized, and (3) there are no redundant terms (i.e., minterms already covered by other terms). A prime implicant is a product term obtained by combining the maximum possible number of adjacent squares in the map. If a minterm in a square is covered by only one prime implicant, that prime implicant is said to be essential
  • 208. The prime implicants of a function can be obtained from the map by combining all possible maximum numbers of squares F(A, B, C, D) = (0, 2, 3, 5, 7, 8, 9, 10, 11, 13, 15) 
  • 209.
  • 210. Five-Variable Map A five-variable map needs 32 squares and a six-variable map needs 64 squares
  • 211. EXAMPLE 3.7 Simplify the following Boolean function into (a) sum-of-products form and (b) product-of-sums form: F (A, B, C, D) = (0, 1, 2, 5, 8, 9, 10)  Combining the squares with 1’s gives the simplified function in sum-of- products form: F = B’D’ + B’C’ + A’C’D
  • 212. If the squares marked with 0’s are combined, as shown in the diagram, we obtain the simplified complemented function: F’ = AB + CD + BD’ Applying DeMorgan’s theorem we obtain the simplified function in productof- sums form: F = (A’ + B’) (C’ + D’) (B’ + D)
  • 213.
  • 214. F (x, y, z) = (1, 3, 4, 6)  F (x, y, z) = (0, 2, 5, 7) 
  • 215. For the sum of products, we combine the 1’s to obtain For the product of sums, we combine the 0’s to obtain the simplified complemented function F = x’z + xz’ F’ = xz + x’z’ F = (x’ + z’)(x + z)
  • 216. DON’T-CARE CONDITIONS Incompletely Specified Functions . Functions that have unspecified outputs for some input combinations In most applications, we simply don’t care what value is assumed by the function for the unspecified minterms. For this reason, it is customary to call the unspecified minterms of a function don’t-care conditions .
  • 217. DON’T-CARE CONDITIONS These don’t-care conditions can be used on a map to provide further simplification of the Boolean expression. A don’t-care minterm is a combination of variables whose logical value is not specified. Such a minterm cannot be marked with a 1 in the map, because it would require that the function always be a 1 for such a combination. Likewise, putting a 0 on the square requires the function to be 0. To distinguish the don’t-care condition from 1’s and 0’s, an X is used.
  • 218. DON’T-CARE CONDITIONS An X inside a square in the map indicates that we don’t care whether the value of 0 or 1 is assigned to F for the particular minterm. In choosing adjacent squares to simplify the function in a map, the don’t- care minterms may be assumed to be either 0 or 1. When simplifying the function, we can choose to include each don’t-care minterm with either the 1’s or the 0’s, depending on which combination gives the simplest expression.
  • 219. EXAMPLE 3.8 F (w, x, y, z) = (1, 3, 7, 11, 15) d (w, x, y, z) = (0, 2, 5)  
  • 220. NAND AND NOR IMPLEMENTATION Digital circuits are frequently constructed with NAND or NOR gates rather than with AND and OR gates. NAND and NOR gates are easier to fabricate with electronic components and are the basic gates used in all IC digital logic families.
  • 221. NAND Circuits The NAND gate is said to be a universal gate because any logic circuit can be implemented with it. To show that any Boolean function can be implemented with NAND gates, we need only show that the logical operations of AND, OR, and complement can be obtained with NAND gates alone.
  • 222. NAND Circuits The complement operation is obtained from a one-input NAND gate that behaves exactly like an inverter. The AND operation requires two NAND gates. The first produces the NAND operation and the second inverts the logical sense of the signal. The OR operation is achieved through a NAND gate with additional inverters in each input.
  • 223. NAND Circuits A convenient way to implement a Boolean function with NAND gates is to obtain the simplified Boolean function in terms of Boolean operators and then convert the function to NAND logic. The conversion of an algebraic expression from AND, OR, and complement to NAND can be done by simple circuit manipulation techniques that change AND–OR diagrams to NAND diagrams.
  • 226.
  • 227.
  • 228. NAND Circuits The implementation of Boolean functions with NAND gates requires that the functions be in sum-of-products form. A B C D G(A,B,C,D) = A*B + C*D G(A,B,C,D)
  • 229. F = AB + CD
  • 230. F = AB + CD A B C D F AB CD
  • 232. EXAMPLE 3.9 F = xy’ + x’y + z ( ) , , 1, 2, 3, 4, ( ) 5, 7 F x y z = 
  • 233. F = xy’ + x’y + z x y x y z F
  • 237. NOR Implementation The NOR gate is another universal gate that can be used to implement any Boolean function. The NOR operation is the dual of the NAND operation The complement operation is obtained from a one input NOR gate that behaves exactly like an inverter The OR operation requires two NOR gates, and the AND operation is obtained with a NOR gate that has inverters in each input
  • 240.
  • 241.
  • 242. EXCLUSIVE-OR FUNCTION The exclusive-OR (XOR), is a logical operation that performs the following Boolean operation:
  • 243. EXCLUSIVE-OR FUNCTION It is particularly useful in arithmetic operations and error detection and correction circuits.
  • 245. Odd Function In general, an n -variable exclusive-OR function is an odd function defined as the logical sum of the minterms whose binary numerical values have an odd number of 1’s. The complement of an odd function is an even function 2 2 n
  • 248. Parity Generation and Checking • Exclusive-OR functions are very useful in systems requiring error detection and correction codes. • A parity bit is used for the purpose of detecting errors during the transmission of binary information. • A parity bit is an extra bit included with a binary message to make the number of 1’s either odd or even. • The message, including the parity bit, is transmitted and then checked at the receiving end for errors. • An error is detected if the checked parity does not correspond with the one transmitted. • The circuit that generates the parity bit in the transmitter is called a parity generator. The circuit that checks the parity in the receiver is called a parity • checker.
  • 250. Even Parity Checker The three bits in the message, together with the parity bit, are transmitted to their destination, where they are applied to a parity- checker circuit to check for possible errors in the transmission.
  • 251. Even Parity Checker • The information was transmitted with even parity, the four bits received must have an even number of 1’s. • An error occurs during the transmission if the four bits received have an odd number of 1’s, indicating that one bit has changed in value during transmission.