Mr3391 Demp Unit I

Download as pdf or txt
Download as pdf or txt
You are on page 1of 94

MR3391 DIGITAL ELECTRONICS AND MICROPROCESSOR

COURSE OBJECTIVES:
➢ To present the Digital fundamentals, Boolean algebra, and its applications in digital systems
➢ To familiarize with the design of various combinational digital circuits using logic gates
➢ To introduce the analysis and design procedures for synchronous and asynchronous sequential circuits
➢ To explain the various semiconductor memories and related technology
➢ To introduce the electronic circuits involved in the making of logic gate

UNIT I DIGITAL FUNDAMENTALS


Number Systems – Decimal, Binary, Octal, Hexadecimal, 1‘s and 2‘s complements, Codes –
Binary, BCD, Excess 3, Gray, Alphanumeric codes, Boolean theorems, Logic gates, Universal
gates, Sum of products and product of sums, Minterms and Maxterms, Karnaugh map
Minimization and Quine-McCluskey method of minimization.

1. Number System
A number system relates quantities and symbols.In digital system how information is represented is key
and there are different radices, i.e. number bases, that a numbering system can use.
1.1 Digital computer
Any class of devices capable of solving problems by processing information in discrete form.It operates on
data,including letters and symbols,that are expressed in binary form i.e using only two digits 0 and 1.
The block diagram of digital computer is given below:

Processor (or)
Control Unit Arithmetic unit

Storage (or)
Memory Unit

Input Output
Devices and Devices and
Control Control

The memory unit stores programs as well as input, output and intermediate data. The processor unit
performs arithmetic and other data processing tasks as specified by the program.The control unit
supervises the flow of information between various units. The program and data prepared by the user
are transferred into the memory unit by means of an input device such as punch card reader (or) tele
typewriter. An output device, such as printer, receives the result of the computations and the printed
results are presented to the user.
1.2 Number Representation:
It can have different base values like: binary (base-2), octal (base-8), decimal (base 10) and
hexadecimal (base 16),here the base number represents the number of digits used in that numbering
system. As an example, in decimal numbering system the digits used are: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.
Therefore the digits for binary are: 0 and 1, the digits for octal are: 0, 1, 2, 3, 4, 5, 6 and 7. For the
hexadecimal numbering system, base 16, the digits are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.
2. Binary numbers
Numbers that contain only two digit 0 and 1 are called Binary Numbers. Each 0 or 1 is called a Bit,
from binary digit. A binary number of 4 bits is called a Nibble. A binary number of 8 bits is called a
Byte. A binary number of 16 bits is called a Word on some systems, on others a 32-bit number is called
a Word while a 16-bit number is called a Halfword.
Using 2 bit 0 and 1 to form
a binary number of 1 bit, numbers are 0 and 1
a binary number of 2 bit, numbers are 00, 01, 10, 11
a binary number of 3 bit, such numbers are 000, 001, 010, 011, 100, 101, 110, 111
a binary number of 4 bit, such numbers are 0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000,
1001, 1010, 1011, 1100,1101,1110,1111
Therefore , using n bits there are 2n binary numbers of n bits
Each digit in a binary number has a value or weight. The LSB has a value of 1. The second from the right
has a value of 2, the next 4 , etc.,

16 8 4 2 1

24 23 22 21 20

The binary equivalent for some decimal numbers are given below.

Decimal 0 1 2 3 4 5 6 7 8 9 10 11

Binary 0 1 10 11 100 101 110 111 1000 1001 1010 1011

3. Number Base Conversions


3.1 Conversion of decimal number to any number system
Step 1 convert the integer part by doing successive division using the radix of asked number systems.
Step 2 convert the fractional part by doing successive multiplication using radix of asked number system

3.2 Conversion of decimal to binary number system


The radix of asked number system is 2
Convert 8710 to ( )2
( 1010111)2

Convert (14.625)10 decimal number to binary number

MSB
(1110)2
1st Multiplication Iteration
Multiply 0.625 by 2
0.625 x 2 = 1.25(Product) Fractional part=0.25 Carry=1 (MSB)

2nd Multiplication Iteration


Multiply 0.25 by 2
0.25 x 2 = 0.50(Product) Fractional part = 0.50 Carry = 0

3rd Multiplication Iteration


Multiply 0.50 by 2
0.50 x 2 = 1.00(Product) Fractional part = 1.00 Carry = 1 (LSB)
(101)2
The binary number of (16.625)10 is (1110.101)2

3.3 Conversion of decimal to octal number system


The radix of asked number system is 8
Convert (264)10 decimal number to octal number

(410)8
The octal number of (264)10 is (410)8
Convert (105.589)10 decimal number to octal number

1 MSB

LSB (151)

MSB

LSB ( 0.4554)
The octal number of (105.589)10 is (151.4554)8

3.4 Conversion of decimal to Hexadecimal number system


The radix of asked number system is 16
Convert (1693)10 decimal number to Hexadecimal number
1693/16 = 105 Reminder (13) D (LSB)
105/16 = 6 Reminder 9
6/16 = 0 Reminder 6 (MSB)

(1693)10 (69D)16
Convert (1693.0628)10 decimal fraction to hexadecimal fraction (?)16
1693/16 = 105 Reminder (13) D (LSB)
105/16 = 6 Reminder 9
6/16 = 0 Reminder 6 (MSB)
(69D)

Multiply 0.0628 by 16
0.0628 x 16 = 1.0048(Product) Fractional part=0.0048 Carry=1 (MSB)
Multiply 0.0048 by 16
0.0048 x 16 = 0.0768(Product) Fractional part = 0.0768 Carry = 0
Multiply 0.0768 by 16
0.0768 x 16 = 1.2288(Product) Fractional part = 0.2288 Carry = 1

Multiply 0.2288 by 16
0.2288 x 16 = 3.6608(Product) Fractional part = 0.6608 Carry = 3 (LSB)
(.1013)

(1693.0628)10 = (69D.1013)16

3.5 Conversion of any number system to decimal number system


In general the numbers can be represented as
N= A n-1r n-1 + = A n-2r n-2 +……..+ A1 r1 + A0 r0 + A-1 r-1+ A-2 r-2+………
Where n= number in decimal
A= digit
r= radix of number system
n= The number of digits in the integer portion of number
m= the number of digits in the fractional portion of number

3.6 Conversion of binary to decimal number system


Convert ( 101.101 )2= ( ? )10

101.101
= 1 x 22 + 0 x 21 + 1 x 20 . 1 x 2-1 + 0 x 2-2 + 1 x 2-3

=1x4+0x2+1x1. 1x(1/2)+0x(1/4) +1x(1/8)

= 4+0 +1 . (1/2)+ 0 + (1/8)

= 5 + 0.5 + 0.125
= 5 . 625
Therefore ( 1 0 1 . 1 0 1 )2 = ( 5.625 )10

3.7 Conversion of octal to decimal number system


Convert (128)8= ( ? )10
1238 = 1*82 + 2*81 + 3*80 = 64 + 16 + 3 = 73
the decimal equivalent of the number 1238 is 7310
Convert (2 1. 2 1)8= (? )10
2 1. 2 1
= 2 x 81 + 1 x 80. 2 x 8-1 + 1 x 8-2
= 2 x 8 + 1 x 1. 2 x ( 1 / 8 ) + 1 x ( 1 / 64 )
= 16 + 1 . (0. 2 5) + (0. 0 1 5 6 2 5)
= 17 + 0. 265625
= 17. 265625
Therefore (2 1. 2 1)8 = (1 7. 2 6 5 6 2 5)10

3.8 Conversion of hexadecimal to decimal number system

Convert (E F. B 1)16= (?)10

= E x 161 + F x 160. B x 16-1 + 1 x 16-2


= 14 x 16 + 15 x 1 . 11 x (1 / 16) + 1 x (1 / 256)
= 224 + 15 + (0. 6 8 7 5) + (0. 0 0 3 9 0 6 2 5)
= 239 + 0. 6914
= 239. 691406
Therefore (E F. B 1)16 = (2 3 9. 6 9 1 4 0 6)10

Convert ( 0.9D9 )16= ( ? )10

= 0 x 160. 9 x 16-1 + D x 16-2 + 9 x 16-3


= 0 x 1. 9 x ( 1 / 16 ) + 13 x ( 1 / 256 ) + 9 x ( 1 / 4096 )
= 0 . (0. 5625) + (0. 050781) + (0. 0021972 )
= 0. (0. 6154782 )
= 0. 6154782

3.9 Conversion of binary to octal number system


Convert (101101001)2 to ( )8
Divide the binary into group of three digits from LSB we will find the following pattern
101|101|001 Now writing the equivalent decimal number of each group we get 5 | 5 | 1 So the
equivalent octal number is 5518

Convert 11001100.101 to ( )8
011|001|100. |101|
3 1 4 .5
So the equivalent octal number is 314.5

3.10 Conversion of binary to hexadecimal number system


Convert 111100010 to ( )16
Divide the binary into group of four digits from LSB
0001|1110|0010
Now writing the equivalent hexadecimal number of each group
1|E|2
So the equivalent Hexa decimal number is 1E216
Convert 11000011001.101 to ( )16
0110|0001|1001|.1010|
6 1 9 . A
So the equivalent Hexa decimal number is 619.A16

3.11 Conversion of octal number system to hexa decimal number system


Convert ( 25)8 to ( )16
First convert octal to binary
The binary equivalent of 25 is 010101
Divide the binary into group of four digits from LSB
0001|0101
1 5
So the equivalent Hexa decimal number is 1516

3.12 Conversion of hexa decimal number system to octal number system


Convert ( 1A.2B)16 to ( )8
First convert hexadecimal to binary
The binary equivalent of 1A.2B is 00011010.00101011
Divide the binary into group of Three digits
011|010|.|001|010|110
3 2 .1 2 6
so the equivalent octal number is 32.1268

4. COMPLEMENTS
In digital computers to simplify the subtraction operation and for logical manipulation complements
are used . There are two types of complements for each radix system the radix complement and diminished
radix complement. The first is referred to as the r’s complement and the second as the (r-1)’s complement.
r’s Complement
Given a positive number N in base r with an integer part of n digits, the r’s complement of N is
defined as rn-N if N≠0 and 0 if N=0
(r-1)’s Complement

Given a positive number N in base r with an integer part of n digits and a fraction part of m
digits, the (r-1)’s complement of N is defined as rn-r-m-N

Subtraction with r’s complement

• The direct method of subtraction uses the borrow concept


• When subtraction is implemented by means of digital components, this method is found to be
less efficient. So, instead the following procedure can be followed.

The subtraction of two positive numbers (M-N), both of base r, may be done as follows.

(1) Add the minuend M to the r’s complement of the subtrahend N.


(2) Inspect the result obtained in step 1 for an end carry.
• If an end-carry occurs, discard it.
• If an end-carry does not occurs, take the r’s complement of the number obtained in step
1 and place a negative sign in front.

Subtraction with (r-1)’s Complement

• The procedure for subtraction with (r-1)’s complement is same as r’s complement except for
end-around carry.
• The subtraction of M-N, both positive numbers in base r, may be calculated in the following
manner.
1. Add the minuend M to the (r-1)’s complement of the subtrahend N.
2. Inspect the result obtained in step 1 for an end carry.
• If an end-carry occurs, add 1 to the least significant digit (end-around carry)
• If an end-carry does not occur, take the (r-1)’s complement of the number
obtained in step 1 and place a negative sign in front.

It is classified into four types they are 1’s complement , 2’s complement , 9’s complement and
10’s complement.
4.1 1’s complement representation: The 1’s complement of a binary number is the number that
results when we change all 1’s to zeros and the zeros to ones.
2’s complement representation:
The 2’s complement is the binary number that results when we add 1 to the 1’s complement.
Problems related to 1’s complement and 2’s complement :
4.2 1’s complement subtraction
Subtraction of binary numbers can be accomplished by the direct method by using the 1’s complement
method, which allows to perform subtraction using only addition . for subtraction of two numbers we have
two cases.
1. Subtraction of smaller number from larger number and
2. Subtraction of larger number from smaller number.

1’s complement Subtraction of smaller number from larger number

Method:
1. Determine the 1’s complement of the smaller number.
2. Add the 1’s complement to the larger number.
3. Remove the carry and add it to the result.
This is called end -around carry.
1’s complement Subtraction of larger number from smaller number
Method:
1. Determine the 1’s complement of the larger number.
2. Add the 1’s complement to the smaller number.
3. Answer is in 1’s complement form. To get the answer in true form take the 1’s complement and
assign negative sign to the answer.

Advantages of 1’s complement subtraction :


1. The 1’s complement subtraction can be accomplished with an binary adder. Therefore , this method
is useful in arithmetic logic circuits.
2. The 1’s complement of a number is easily obtained by inverting each bit in the number.
4.3 2’s complement Subtraction:
Like 1’s complement subtraction, in 2’s complement subtraction, the subtraction is accomplished
by only addition.
2’s complement Subtraction of smaller number from larger number
Method
1. Determine the 2’s complement of the smaller number.
2. Add the 2’s complement to the larger number.
3. Discard the carry.

2’s complement Subtraction of larger number from smaller number


Method:

1. Determine the 2’s complement of the larger number.


2. Add the 2’s complement to the smaller number.
3. Answer is in 2’s complement form. To get the answer in true form take the 2’s complement and
assign negative sign to the answer.

4.4 9's complement and 10's complement


Before knowing about 9's complement and 10's complement we should know why they are used
and why their concept came into existence. Addition of signed BCD numbers can be performed by using
9’s and 10’s complement. The complements are used to make the arithmetic operations in digital system
easier. Various topics and related problems we going to see here are

1. 9s complement
2. 10s complement
3. 9s complement subtraction
4. 10s complement subtraction

Now first of all let us know what 9's complement is and how it is done. To obtain the 9,s complement
of any number we have to subtract the number with (10n - 1) where n = number of digits in the number, or
in a simpler manner we have to divide each digit of the given decimal number with 9. The table 1. will
explain the 9's complement more easily.

Table 1. 9’s complement equivalent for decimalo numbers

9s
Decimal digit
complement

0 9

1 8

2 7

3 6

4 5

5 4

6 3

7 2

8 1

9 0
Now coming to 10's complement, it is relatively easy to find out the 10's complement after finding
out the 9,s complement of that number. We have to add 1 with the 9,s complement of any number to obtain
the desired 10's complement of that number. Or if we want to find out the 10's complement directly, we can
do it by following the formula, (10n - number), where n = number of digits in the number. An example is
given below to illustrate the concept of obtaining 10’s complement

A decimal number 456, find 9's complement and 10’s complement of this number

10's complement of that no. is

In 9’s complement subtraction when 9’s complement of smaller number number is added to the
larger number carry is generated. It is necessary to add this carry to the result. ( this is called an end around
carry).when larger number is subtracted from the smaller number, there is no carry, and the result is in 9’s
compliment form and negative. This is explained with following examples.

Subtraction using 9’s complements:

Steps for 9’s complement BCD subtraction

1. Find the 9’s complement of a negative number.


2. Add two numbers using BCD addition
3. If carry is generated add carry to the result otherwise find the 9’s complement of the result.
Subtraction using 10’s complements:
The 10’s complement of the decimal is equal to 9’s complement plus 1. The 10’s complement can
be used to perform subtraction by adding the minuend to the 10’s complement of the subtrahend and
dropping the carry. This is explained with following examples.
Steps for 10’s complement BCD subtraction
1. Find the 10’s complement of a negative number.
2. Add two numbers using BCD addition
3. If carry is not generated find the 10’s complement of the result.

5.SIGNED NUMBERS

• Digital systems like computer, must be able to handle both positive and negative numbers.
• A signed binary number consists of both sign and magnitude information.
• The sign indicates whether a number is positive or negative.

5.1 Representation

There are three forms in which the signed integer (whole numbers) can be represented. They
include,

1. Sign – Magnitude Form – Rarely used


2. 1’s Complement Form
3. 2’s Complement Form – Mostly used

Note:

Sign bit – leftmost bit in a signed binary numbers

• 0 for positive, 1 for negative

5.11 Sign Magnitude Form


• Here, leftmost bit is the sign bit.
• Remaining bits are magnitude bits.
• Magnitude bits are in true binary.

5.12 1’s Complement Form


• In this Form, positive numbers are represented the same way as positive sign-magnitude
numbers.
• Negative numbers, are the 1’s complement of the corresponding positive numbers.

(eg)

+25 is represented as,

00011001 → same as sign-magnitude form

-25 is represented as,

11100110 → 1’s complement of +25

5.13 2’s Complement Form


• Positive numbers in 2’s complement form are represented as same as in sign-
magnitude and 1’s Complement Form.
• Negative numbers are the 2’s complement of the corresponding positive numbers

(eg)

+25 is represented as,

00011001 → same as sign-magnitude form

-25 is represented as,

11100110 +

111001112 → 2’s complement of +25

Decimal value of Signed Numbers

(1) Sign Magnitude


• Decimal values of positive and negative numbers in this form are determined by
summing the weights in all the magnitude – bit positions.
• The sign is determined by examining the sign bit.

(eg) 1. Determine the decimal value of this signed binary number expressed in sign –
magnitude. 10010101
Soln:
• The seven magnitude bits and their powers of 2 weights are as follows.
1 0010101
↓ 26252423222120
Sign bit
• Summing weights where there are 1’s.
→ 16+4+1 = 21
• Since, the sign bit is 1, the decimal number is -21
(2) 1’s Complement
• Decimal values of positive numbers in this form are determined by summing the
weights in all bit postions.
• Decimal values of negative numbers are determined by assigning a negative value to
the weight of the sign bit, summing all the weights where there are 1’s and adding 1 to
the result.

(eg) Determine the decimal value of the signed binary number expressed in 1’s complement
11101000

Soln:

• The bits and their powers- of- two weights are as follows.

Note: for sign bit, it is -27 (or) -128

1 1 1 0 1 0 0 0

-27 26 25 24 23 22 21 20

• Summing the weights where there are 1’s

-128+64+32+8 = -24 ( if +ve, write this as the result)


• Since, it is a negative number, add 1 to the result
-24+1 = -23
(3) 2’s Complement
• Decimal values of positive and neagative numbers in this form are determined by
summing the weights in all bit positions.
• The weight of the sign – bit in a negative number is given a negative value.

(eg): Determine the decimal values of the signed binary numbers expressed in 2’s complement
from 10101010

Soln:

• The bits and their corresponding powers of -2 weights are as follows

1 0 1 0 1 0 1 0
-27 26 25 24 23 22 21 20
• Summing weights where there are 1’s
-128+32+8+2 = -86

Range of signed integer numbers that can be Represented

• Since 8-bit (1byte) grouping is common in most computers, the illustrations are all 8-
bits. With 8-bits, we can represent 256 different numbers.
• With 16-bits (2 bytes), we can represent 65,536 different numbers.
• With 32-bits (4 bytes), we can represent 4.295×109 different numbers.
The formula for finding the number of different combinations of n-bits is,

Total combinations = 2n
Range of values for n-bit numbers is,

-(2n-1) to + (2n-1 – 1)

So, for 8 bits the range is,


-128 to +127

For 16 bits the range is,


-32768 to +32767 etc

5.2 Arithmetic operations with Signed Numbers

• Here, we use 2’s complement representation

Addition

• The two numbers in an addition are the addend and the augend
• The result is sum.
• There are four cases that can occur when two signed binary numbers are added.
(1) Both numbers positive.
(2) Positive number with magnitude larger than negative number.
(3) Negative number with magnitude larger than positive number
(4) Both numbers negative.

Case 1: Both numbers +ve


Subtraction

• It is a special case of addition.


• The two numbers in subtraction are subtrahend and minuend.
• The result is the difference.
• To subtract +6 from +9, it is also equivalent to add -6 to +9.
• So, to subtract two signed numbers, take the 2’s complement of the subtrahend and add. Discard
any final carry bit.

6. BINARY ARITHMETIC
6.1 BINARY ADDITION
The binary addition table is as follows:
A+B SUM CARRY
0+0 0 0
0+1 1 0
1+0 1 0
1+1 0 1
Illustration 1:
Add (1010)2 and (0011)2
1010 (Augend)
0011 (Addend)

1101 (sum)

The addition manipulated above as follows.


Step 1: The least significant bits are added, i.e. 0+1 =1 with a carry of 0
Step 2: The carry in the previous is added to the next higher significant bits, i.e. 0+1+1= 0 with a carry 1.
Step 3: The carry in the previous is added to the next higher significant bits, i.e. 1+0+0 =1 with a carry 0.
Step 4: The preceding carry is added to the most significant bit i.e. 0+1+0 = 1 with a carry 0.
Thus the sum is 1101.

6.2 BINARY SUBTRACTION


The binary subtraction table is as follows:

A-B DIFFERENCE BORROW


0-0 0 0
0-1 1 1
1-0 1 0
1-1 0 0
Illustration 1:
Subtract (0101)2 from (1011)2
1011 (Minuend)
0101 (Subtrahend)

0110 (Difference)

The steps are described below


Step1: the LSB in the first column are 1 and 1. Hence, the difference is 1 - 1 = 0
Step2: The column, the subtraction is performed as 1 – 0 = 1
Step3: In the third column, the difference is given by 0 – 1 =1
Step 4: In the fourth column (MSB), the difference is given by 0 – 0 = 0 since 1 is borrowed for third
column.

6.3 BINARY MULTIPLICATION


The binary multiplication table is as follows:
A *B PRODUCT
0*0 0
0*1 0
1*0 0
1*1 1

➢ Binary multiplication uses add and shift process


➢ Binary multiplication is similar to decimal multiplication.
Illustration 1:
Multiplicand * Multiplier
10110.1x01001.1

101101
101101
000000
000000 Partial Product
101101
000000

011010101.11 (Final product)

The steps are described below


Step 1: The LSB of the multiplier is taken. If multiplier bit is 1, the multiplicand is copied as such and if
the multiplier bit is 0 zero is placed in all the bit positions.
Step 2: The next higher significant bit of the multiplier is taken and, the partial product is written with the
shift to the left, as in step 1.
Step 3: step 2 is repeated for all other higher significant bits.
Step 4: The partial product terms are added which gives the actual product of multiplier and the
multiplicand.

6.4 BINARY DIVISION:


The binary division table is as follows:
A÷B Result
0÷0 Not allowed
0÷1 0
1÷0 Not allowed
1÷1 1

➢ Binary division uses subtract and shift process


➢ Binary division is similar to decimal division.
➢ Division by 0 is meaningless.
Illustration 1:
Dividend ÷ Divisor
11011.1÷ 101
101.1 (QUOTIENT)
DIVISOR 101 √11011.1 (DIVIDEND)
101

111
101

101
101

7. BINARY CODES
Binary codes are codes which are represented in binary system with modification from the original
one. The group of symbols is called as a code. The digital data is represented, stored and transmitted as
group of binary bits. This group is also called as binary code. The binary code is represented by the
number as well as alphanumeric letter.
Advantages of Binary Code
Following is the list of advantages that binary code offers.
1. Binary codes are suitable for the computer applications.
2. Binary codes are suitable for the digital communications.
3. Binary codes make the analysis and designing of digital circuits if we use the binary codes.
4. Since only 0 and 1 are being used, implementation becomes easy.
7.1 Classification of binary codes:The codes are broadly categorized into following four categories.
• Weighted Codes
• Non-Weighted Codes
• Binary Coded Decimal Code
• Alphanumeric Codes
• Error Codes
7.1.1 Weighted codes: Weighted binary codes are those binary codes which obey the positional weight
principle. Each position of the number represents a specific weight
Decimal 8421 5421 2421 5211
0 0000 0000 0000 0000
1 0001 0001 0001 0001
2 0010 0010 0010 0011
3 0011 0011 0011 0101
4 0100 0100 0100 0111
5 0101 1000 1011 1000
6 0110 1001 1100 1010
7 0111 1010 1101 1100
8 1000 1011 1110 1110
9 1001 1100 1111 1111

For example, in 8421BCD code, 1001 the weights of 1, 0, 0, 1 (from left to right) are 8, 4, 2 and 1
respectively. The codes 8421BCD, 2421BCD, 5211BCD are all weighted codes.
7.1.2 Non-weighted codes: The non-weighted codes are not positionally weighted. In other words, each
digit position within the number is not assigned a fixed value (or weight).
Examples are
• Excess-3
• Gray code
DECIMAL EXCESS - 3 GRAY CODE
0 0011 0000
1 0100 0001
2 0101 0011

6.1.3 EXCESS – 3 CODES:-


• This is another form of BCD code, in which each decimal digit is coded into a 4-bit binary code.
• The code for each decimal digit is obtained by adding decimal 3 to the natural BCD code of the
digit.
GRAY CONVERSION:-
• Record the mostsignificant bit add the binary MSB to the next significant bit of the Gray code.
• Record the result, ignoring carrier continue the process, until the LSB is reached.
REFLECTIVE CODES: A code is reflective when the code is self-complementing. In otherwords, when the
code for 9 is the complement the code for 0, 8 for 1, 7 for 2, 6 for 3 and 5 for 4. 2421BCD, 5421BCD and
Excess-3 code are reflective codes.
SEQUENTIAL CODES: In sequential codes, each succeeding 'code is one binary number greater than its
preceding code. This property helps in manipulation of data. 8421 BCD and Excess-3 are sequential codes.
ALPHANUMERIC CODES: Codes used to represent numbers, alphabetic characters, symbols and various
instructions necessary for conveying intelligible information. ASCII, EBCDIC, UNICODE are the most-
commonly used alphanumeric codes.

8. Decimal code
Binary codes for decimal digits require a minimum of four bits. Numerous different codes can be obtained
by arranging four or more bits in ten distinct possible combinations. A few possibilities are tabulated.
9. Error detection code
In data transmission, Interference and physical defects in the communication medium can cause random bit
errors. As the signal is transmitted through a media, the signal gets corrupted because of noise and
distortion. Therefore the media is not reliable. To achieve a reliable communication through this unreliable
media, there is need for detecting the error in the signal so that suitable mechanism can be devised to take
corrective actions.
Error coding is a method of detecting and correcting these errors to ensure information is transferred intact
from its source to its destination
The errors can be divided into two types:
• Single-bit Error: only one bit of given data unit (such as a byte, character, or data unit) is changed from 1
to 0 or from 0 to 1.
• Burst Error: two or more bits in the data unit have changed from 0 to 1 or vice-versa. (Here doesn’t
necessary means that error occurs in consecutive bits)
Error Detecting Codes:
Basic approach used for error detection is the use of redundancy, where additional bits are added to
facilitate detection and correction of errors.
Popular techniques are:
• Simple Parity check
• Two-dimensional Parity check
• Checksum
• Cyclic redundancy check
Detecting Errors using simple parity check
Suppose we are transmitting 7-bit ASCII characters. A parity bit is added to each character to make it 8
bits. Parity can detect all single-bit errors
–If even parity is used and a single bit changes, it will change the parity to odd, which will be detected at
the receiver end
–The receiver end can detect the error, but cannot correct it because it does not know which bit is erroneous
Parity can also detect some multiple-bit errors
Table 1 shows the four bit data word and its corresponding code words
Decimal value Data block Parity bit Code word
0 0000 0 00000
1 0001 1 00011
2 0010 1 00101
3 0011 0 00110
4 0100 1 01001
5 0101 0 01010
6 0110 0 01100
7 0111 1 01111
8 1000 1 10001
9 1001 0 10010
10 1010 0 10100
11 1011 1 10111
12 1100 0 11000
13 1101 1 11011
14 1110 1 11101
15 1111 0 11110

10. Gray Code- Reflection and Self Complementary codes


• Gray Code is a non-weighted code which belongs to a class of codes called minimum change codes.
• Gray Code is an alternative binary representation, devised such that, between any two adjacent
numbers, only one bit changes at a time.
Binary Dec Gray
00000 0 00000
00001 1 00001
00010 2 00011
00011 3 00010
00100 4 00110
00101 5 00111
00110 6 00101
00111 7 00100
01000 8 01100
01001 9 01101
01010 10 01111
01011 11 01110
01100 12 01010
01101 13 01011
01110 14 01001
01111 15 01000
• To the left we see three columns of data. These are representations of the same numbers 0-15 in
different ways.
o In the middle is the decimal value.
o On the left is positional notation binary
o On the right is Gray code.
• You will notice that, on the right, each adjacent row is different from it's neighbours by no more
than one bit.
• The term Gray code is often used to refer to a "reflected" code, or more specifically still, the binary
reflected Gray code.
10.1 Self-complementary Code
• A code is said to be self-complementary if the code for 9’s complement of N i.e. 9-N can be obtained by
interchanging all 0s and 1s.
• Decimal 9 is the complement of code for 0, 8 for 1, 7 for 2 and so on.
• For a code to be self complementing, the sum of all its weights must be 9. digit.8421 and 5421 codes are
not self complementing codes whereas 5211,2421,3321, 4321 are self complementing.
• In general, a code is self-complementary if we produce a code by taking the first complement of the digit
which is same as 9’s complement of the number.
10.2 Reflective code
• Imaged about the centre entries with one bit changed
• Example ï 9ís complement of a reflected BCD code word is formed by changing only one of its bits
• In the Gray code example shown below, the MSB bit alone is changing and the remaining bits is
reflected mirror image about the centre. For clarity, the MSB is removed.
• Gray code Reflected property of Gray code

Binary-to-Gray code conversion


• The MSB in the Gray code is the same as corresponding MSB in the binary number.
• Going from left to right, add each adjacent pair of binary code bits to get the next Gray code bit.
• Discard carries.
Problem: Convert 10110 to gray code

Gray-to-Binary Conversion
• The MSB in the binary code is the same as the corresponding bit in the Gray code.
• Add each binary code bit generated to the Gray code bit in the next adjacent position.
• Discard carries.
Problem: Convert the Gray code word 11011 to binary
11. Binary-Coded Decimal Code
Although the binary number system is the most natural system for a computer because it is readily
represented in today’s electronic technology, most people are more accustomed to the decimal system. One
way to resolve this difference is to convert decimal numbers to binary, perform all arithmetic calculations
in binary, and then convert the binary results back to decimal. This method requires that we store decimal
numbers in the computer so that they can be converted to binary. Since the computer can accept only
binary values, we must represent the decimal digits by means of a code that contains 1’s and 0’s. It is also
possible to perform the arithmetic operations directly on decimal numbers when they are stored in the
computer in coded form.
A binary code will have some unassigned bit combinations if the number of elements in the set is
not a multiple power of 2. The 10 decimal digits form such a set. A binary code that distinguishes among
10 elements must contain at least four bits, but 6 out of the 16 possible combinations remain unassigned.
Different binary codes can be obtained by arranging four bits into 10 distinct combinations. This scheme is
called binary-coded decimal and is commonly referred to as BCD.
A number with k decimal digits will require 4k bits in BCD. Decimal 396 is represented in BCD
with 12 bits as 0011 1001 0110, with each group of 4 bits representing one decimal digit. A decimal
number in BCD is the same as its equivalent binary number only when the number is between 0 and 9. A
BCD number greater than 10 looks different from its equivalent binary number, even though both contain
1’s and 0’s. Note that the BCD code is not self‐complementing. Moreover, the binary combinations 1010
through 1111 are not used and have no meaning in BCD. Consider decimal 185 and its corresponding value
in BCD and binary:
(185)10 = (0001 1000 0101) BCD = (10111001)2

Table 1
In multi digit BCD coding

11.1 BCD addition:


The addition of two BCD numbers can be best understood by considering the three cases that occur
when two BCD digits are added.
Sum equals 9 or less with carry 0
Let us consider additions of 3 and 6 in BCD.
Sum greater than 9 with carry 0
Let us consider addition of 6 and 8 in BCD

The sum 1110 is an invalid BCD number. This has occurred because the sum of the two digits exceeds 9.
Whenever this occurs this occurs the sum has to be corrected by the addition of six (1110) in the invalid
BCD number, as shown below

Sum equals 9 or less with carry 1


Let us consider addition of 8 and 9 in BCD

In this case, result (001 0001) is valid BCD number, but it is incorrect. To get the correct BCD result
correction factor of 6 has to be added to the least significant digit sum, as shown.

BCD addition procedure


1. Add two BCD numbers using ordinary binary addition.
2. If four bit sum is equal to or less than 9, no correction is needed. The sum is in proper BCD form.
3. If the four bit sum is greater than 9 or if a carry is generated from the four-bit sum, the sum is
invalid.
4. To correct the invalid sum, add 01102 to the four-bit sum. If a carry results from this addition, add it
to the next higher-order BCD digit.

12.Alphanumeric codes
Alphanumeric codes are sometimes called character codes due to their certain properties. Now
these codes are basically binary codes. We can write alphanumeric data, including data, letters of the
alphabet, numbers, mathematical symbols and punctuation marks by this code which can be easily
understandable and can be processed by the computers. Input output devices such as keyboards, monitors,
mouse can be interfaced using these codes. 12-bit Hollerith code is the better known and perhaps the first
effective code in the days of evolving computers in early days. During this period punch cards were used as
the inputting and outputting data. But nowadays these codes are termed obsolete as many other modern
codes have evolved. The most common alphanumeric codes used these days are ASCII code, EBCDIC
code and Unicode.

12.1 ASCII Character Code


Many applications of digital computers require the handling not only of numbers, but also of other
characters or symbols, such as the letters of the alphabet. For instance, consider a high‐tech company with
thousands of employees. To represent the names and other pertinent information, it is necessary to
formulate a binary code for the letters of the alphabet. In addition, the same binary code must represent
numerals and special characters (such as $). An alphanumeric character set is a set of elements that
includes the 10 decimal digits, the 26 letters of the alphabet, and a number of special characters. Such a set
contains between 36 and 64 elements if only capital letters are included, or between 64 and 128 elements if
both uppercase and lowercase letters are included. In the first case, we need a binary code of six bits, and in
the second, we need a binary code of seven bits. The standard binary code for the alphanumeric characters
is the American Standard Code for Information Interchange (ASCII), which uses seven bits to code
128 characters, as shown in Table below. The seven bits of the code are designated by b1 through b7, with
b7 the most significant bit. The letter A, for example, is represented in ASCII as 1000001 (column 100, row
0001). The ASCII code also contains 94 graphic characters that can be printed and 34 nonprinting
characters used for various control functions.
The graphic characters consist of the 26 uppercase letters (A through Z), the 26 lowercase letters (a
through z), the 10 numerals (0 through 9), and 32 special printable characters, such as %, *, and
$.characters. Format effectors are characters that control the layout of printing. They include the familiar
word processor and typewriter controls such as backspace (BS), horizontal tabulation (HT), and carriage
return (CR). Information separators are used to separate the data into divisions such as paragraphs and
pages. They include characters such as record separator (RS) and file separator (FS). The communication‐
control characters are useful during the transmission of text between remote devices so that it can be
distinguished from other messages using the same communication channel before it and after it. Examples
of communication‐control characters are STX (start of text) and ETX (end of text), which are used to frame
a text message transmitted through a communication channel.
ASCII is a seven‐bit code, but most computers manipulate an eight‐bit quantity as a single unit
called a byte. Therefore, ASCII characters most often are stored one per byte. The extra bit is sometimes
used for other purposes, depending on the application.
For example, some printers recognize eight‐bit ASCII characters with the most significant bit set to
0. An additional 128 eight‐bit characters with the most significant bit set to 1 are used for other symbols,
such as the Greek alphabet or italic type font.
Classification of codes
Codes

Error
Weighted Non-weighted Reflective Sequential Alpha detecting and
Codes Code Codes Code numeric correcting
Codes
1. Weighted Codes
• Obey positional weight principle.
• A specific weight is assigned to each position of the number.
• Eg.: Binary, BCD codes

2. Non-weighted Codes
• Do not obey positional weight principle.
• Positional weights are not assigned.
• Eg.: excess-3 code, Gray code

3. Reflective Codes
• A code is said to be reflective when code for 9 is complement of code for 0, code for
8 is complement of code for 1, code for 7 is complement of code for 2, code for 6 is
complement of code for 3, code for 5 is complement of code for 4.
• Reflectivity is desirable when 9’s complement has to be found.
• Eg.: excess-3 code
4. Sequential Codes
• A code is said to be sequential when each succeeding code is one binary number
greater than preceding code.
• Eg.: Binary, XS-3

5. Alphanumeric Codes
• Designed to represent numbers as well as alphabetic characters.
• Capable of representing symbols as well as instructions.
• Eg.: ASCII, EBCDIC

6. Error Detecting and Correcting Codes


• When digital data is transmitted from one system to another, an unwanted electrical
disturbance called ‘noise’ may get added to it.
• This can cause an ‘error’ in digital information. That means a 0 can change to 1 or 1
can change to 0.
• To detect and correct such errors special type of codes capable of detecting and
correcting the errors are used.
• Eg.: Parity code, Hamming code
BCD(Binary Coded Decimal) Code
• In this code each digit is represented by a 4-bit binary number.
• The positional weights assigned to the binary digits in BCD code are 8-4-2-1 with 1
corresponding to LSB and 8 corresponding to MSB.
Positional 8 4 2 1
Weights 23 22 21 20
MSB LSB
• Other BCD codes like 7-4-2-1, 5-4-2-1 etc also exist.

Conversion from decimal to BCD


• The decimal digits 0 to 9 are converted into BCD, exactly in the same way as binary.
Digital 0 1 2 3 4 5 6 7 8 9
BCD 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001

Invalid BCD codes:


• With 4 bits we can represent total sixteen numbers (0000 to 1111) but in BCD only
first ten codes are used (0000 to 1001)
• Therefore remaining six codes (1010 to 1111)are invalid in BCD
Conversion of bigger decimal numbers to BCD:
• Express each decimal digit with its equivalent 4-bit BCD code
• Eg.: Convert (964)10 to its equivalent BCD code.
Decimal Number → 9 6 4

Binary Equivalent → 1001 0110 0100


There fore (964)10 = (1001 0110 0100)BCD
• Hence smallest number in BCD is 0000 i.e., 0 and largest is 1001 i.e., 9 after
which 10 will be expressed by combinations i.e., 0001 0000 and is known as
packed BCD
Comparison with Binary:
• Less efficient than binary, since conversion of a decimal number into BCD
needs more bits than in binary
Eg., (22)10 = (10110)2 = (0010 0010)BCD So BCD uses more bits than binary for
the same decimal number.
• BCD arithmetic is more complicated than binary arithmetic.
• BCD – decimal conversion is simpler than Binary – decimal conversion.
Advantages of BCD codes:
• Its similar to decimal number system.
• We need to remember binary equivalents of decimal numbers 0 to 9 only.
• Conversions from decimal to BCD or BCD to decimal is very simple and no
calculation is needed.
Disadvantages of BCD codes:
• Less efficient than binary, since conversion of a decimal number into BCD
needs more bits than in binary
• BCD arithmetic is more complicated than binary arithmetic.
-------------------------------------------------------------------------------------------------------------
Convert following decimal numbers to BCD:
(a) 164 (b) 4297 (c) 8065
Convert following BCD codes to decimal equivalent:
(a) 1001 1000 (b) 0001 0100 0110 (c) 0111 0011 0101
Convert following binary numbers to BCD codes: (Hint: convert to decimal first)
(a) 1100 (b) 10001 (c) 1010101
Convert following BCD codes to binary equivalent: (Hint: convert to decimal first)
(a) 0010 1000 (b) 1001 0111 (c) 1000 0000
XS-3 (Excess-3)Code
• Non-weighted code.
• Derived from BCD code (8-4-2-1 code)words by adding (0011)2 or (3)10 to each
code word.
Write each digit in 4-bit binary code + (0011)
Decimal BCD XS-3
• Therefore Hence smallest number in XS-3 is 0011 i.e., 0 and largest is 1100 i.e., 9
Decimal BCD XS-3
• XS-3 is a reflective code since code
0 0000 0011 for 9 is complement of code for 0,
1 0001 0100 code for 8 is complement of code for
2 0010 0101 1, code for 7 is complement of code
for 2, code for 6 is complement of
3 0011 0110
code for 3, code for 5 is complement
4 0100 0111 of code for 4.
5 0101 1000 • It is a sequential code since each
6 0110 1001 number is 1 binary bit greater than
7 0111 1010 its preceding number.E
8 1000 1011
9 1001 1100
Conversion of decimal numbers XS-3 code:
• Eg.: Convert (964)10 to its equivalent XS-3 code.
Decimal Number → 9 6 4

XS-3 Equivalent → 1100 1001 0111


Therefore (964)10 = (1100 1001 0111)XS-3

Conversion of XS-3 code to equivalent decimal numbers :


• Eg.: Convert (0011 1010 1100)XS-3 to its equivalent decimal number.
XS-3 code → 1010 0011 1100

Decimal equivalent → 0 7 9
Therefore (1010 0011 1100)XS-3 = (709)10
--------------------------------------------------------------------------------------------------------------
Obtain XS-3 equivalent of following numbers:
(a) (235)10 (b) (146)10 (c) (0111 1000)BCD (d) (1001 0011)BCD
(e) (101010)2 (hint: first convert to decimal)
Gray Code
Decimal Binary Gray Code
• Non-weighted code.
0 0000 0000
• It has a very special feature that only
1 0001 0001 one bit will change, each time the
2 0010 0011 decimal number is incremented,
3 0011 0010 therefore also called unit distance code.
4 0100 0110
5 0101 0111 Binary and Gray conversions:
6 0110 0101 • For Gray to binary or binary to Gray
conversions let’s understand rules for
7 0111 0100
Ex-OR
8 1000 1100
(Ex-OR is represented by symbol )
9 1001 1101
10 1010 1111 Rules for EX-OR:
11 1011 1110
12 1100 1010
13 1101 1011
14 1110 1001
15 1111 1000
Conversion from Binary to Gray code:
Step 1: Write MSB of given Binary number as it is.
Step 2: Ex-OR this bit with next bit of that binary number and write the result.
Step 3: Ex-OR each successive sum until LSB of that binary number is reached.
• Eg.: Convert (1010011)2 to its equivalent Gray code.
1 0 1 0 0 1 1

1 1 1 1 0 1 0
Therefore (1010011)2 = (1111010)Gray
Conversion from Gray to Binary:
Step 1: Write MSB of given Binary number as it is.
Step 2: Ex-OR this bit with next bit of that binary number and write the result.
Step 3: Continue this process until LSB of that binary number is reached.
• Eg.: Convert (1010111)Gray to its equivalent Binary number.
1 0 1 0 1 1 1

1 1 0 0 1 0 1
Therefore (1010111)Gray = (1100101)2
Alphanumeric Codes
• A binary bit can represent only two symbols ‘0’ and ‘1’. But it is not enough for
communication between two computers because there we need many more
symbols for communication.
• These symbols are required to represent
- 26 alphabets with capital and small letters
- Numbers from 0 to 9
- Punctuation marks and other symbols
• Alphanumeric codes represent numbers and alphabetic characters. They also
represent other characters such as punctuation symbols and instructions for
conveying information.
• Therefore instead of using only single binary bits, a group of bits is used as a code
to represent a symbol.
Boolean theorems
Boolean algebraic theorems are the theorems that are used to change the form of a boolean
expression. Sometimes these theorems are used to minimize the terms of the expression,
and sometimes they are used just to transfer the expression from one form to another.
There are boolean algebraic theorems in digital logic:
Transposition Theorem:
It states that:
AB + A'C = (A + C) (A' + B)
Proof:
RHS
= (A + C) (A' + B)
= AA' + A'C + AB + CB
= 0 + A'C + AB + BC
= A'C + AB + BC(A + A')
= AB + ABC + A'C + A'BC
= AB + A'C
= LHS
Duality Theorem:
Dual expression is equivalent to write a negative logic of the given boolean relation. For this,
1. Change each OR sign by and AND sign and vice-versa.
2. Complement any 0 or 1 appearing in the expression.
3. Keep literals as it is.

Example:
Dual of A(B+C) = A+(B.C) = (A+B)(A+C)
Complementary Theorem:
For obtaining complement expression,
1. Change each OR sign by AND sign and vice-versa.
2. Complement any 0 or 1 appearing in the expression.
3. Complement the individual literals.

Example:
Complement of A(B+C) = A'+(B'.C') = (A'+B')(A'+C')

Laws of Boolean Algebra

There are six types of Boolean algebra laws. They are:


• Commutative law
• Associative law
• Distributive law
• AND law
• OR law
• Inversion law

Commutative Law

Any binary operation which satisfies the following expression is referred to as a commutative
operation. Commutative law states that changing the sequence of the variables does not have any
effect on the output of a logic circuit.

• A. B = B. A
• A+ B = B +A

Associative Law

It states that the order in which the logic operations are performed is irrelevant as their effect is the
same.

• ( A. B ). C = A . ( B . C )
• ( A + B ) + C = A + ( B + C)

Distributive Law

Distributive law states the following conditions:


• A. ( B + C) = (A. B) + (A. C)
• A + (B. C) = (A + B) . ( A + C)

AND Law
These laws use the AND operation. Therefore, they are called AND laws.
• A .0 = 0
• A. 1 =A
• A. A = A
• A.A’ = 0

OR Law

These laws use the OR operation. Therefore they are called OR laws.
• A + 0 =A
• A+1=1
• A+A=A
• A + A’ = 1

Inversion Law

In Boolean algebra, the inversion law states that the double inversion of a variable results in the
original variable itself.

• (A’)’ = A

Boolean Algebra Theorems

The two important theorems which are extremely used in Boolean algebra are De
Morgan’s First law and De Morgan’s second law. These two theorems are used to change the
Boolean expression. This theorem basically helps to reduce the given
Boolean expression in the simplified form. These two De Morgan’s laws are used to change the
expression from one form to another form. Now, let us discuss these two theorems in detail.

De Morgan’s First Law:

De Morgan’s First Law states that (A.B)’ = A’+B’.

The first law states that the complement of the product of the variables is equal to the sum of their
individual complements of a variable.

The truth table that shows the verification of De Morgan’s First law is given as follows:
The last two columns show that (A.B)’ = A’+B’.

Hence, De Morgan’s First Law is proved.

De Morgan’s Second Law:

De Morgan’s Second law states that (A+B)’ = A’. B’.

The second law states that the complement of the sum of variables is equal to the product of their
individual complements of a variable.

The following truth table shows the proof for De Morgan’s second law.
The last two columns show that (A+B)’ = A’. B’.

Hence, De Morgan’s second law is proved.

The other theorems in Boolean algebra are complementary theorem, duality theorem, transposition
theorem, redundancy theorem and so on. All these theorems are used to simplify the given Boolean
expression. The reduced Boolean expression should be equivalent to the given Boolean expression.
Universal Gates
In addition to AND, OR, and NOT gates, other logic gates like NAND and NOR are also used in the
design of digital circuits.

The NOT circuit inverts the logic sense of a binary signal.

The small circle (bubble) at the output of the graphic symbol of a NOT gate is formally called a
negation indicator and designates the logical complement.

NAND Gate:
The NAND gate represents the complement of the AND operation. Its name is an abbreviation of
NOT AND.

The graphic symbol for the NAND gate consists of an AND symbol with a bubble on the output,
denoting that a complement operation is performed on the output of the AND gate.

The truth table and the graphic symbol of NAND gate is shown in the figure.

The truth table clearly shows that the NAND operation is the complement of the AND. NOR Gate:
The NOR gate represents the complement of the OR operation. Its name is an abbreviation of NOT
OR.

The graphic symbol for the NOR gate consists of an OR symbol with a bubble on the output,
denoting that a complement operation is performed on the output of the OR gate.

The truth table and the graphic symbol of NOR gate is shown in the figure.
The truth table clearly shows that the NOR operation is the complement of the OR.

Universal Gates:
A universal gate is a gate which can implement any Boolean function without need to use any other
gate type.

The NAND and NOR gates are universal gates.

In practice, this is advantageous since NAND and NOR gates are economical and easier to fabricate
and are the basic gates used in all IC digital logic families.

In fact, an AND gate is typically implemented as a NAND gate followed by an inverter not the
other way around!!

Likewise, an OR gate is typically implemented as a NOR gate followed by an inverter not the other
way around!!

NAND Gate is a Universal Gate:


To prove that any Boolean function can be implemented using only NAND gates, we will show that
the AND, OR, and NOT operations can be performed using only these gates.

Implementing an Inverter Using only NAND Gate

The figure shows two ways in which a NAND gate can be used as an inverter (NOT gate).

1. All NAND input pins connect to the input signal A gives an output A’.
2. One NAND input pin is connected to the input signal A while all other input pins are connected
to logic 1. The output will be A’.

Implementing AND Using only NAND Gates

An AND gate can be replaced by NAND gates as shown in the figure (The AND is replaced by a
NAND gate with its output complemented by a NAND gate inverter).

Implementing OR Using only NAND Gates

An OR gate can be replaced by NAND gates as shown in the figure (The OR gate is replaced by a
NAND gate with all its inputs complemented by NAND gate inverters).

Thus, the NAND gate is a universal gate since it can implement the AND, OR and NOT
functions.

NOR Gate is a Universal Gate:


To prove that any Boolean function can be implemented using only NOR gates, we will show that
the AND, OR, and NOT operations can be performed using only these gates.

Implementing an Inverter Using only NOR Gate

The figure shows two ways in which a NOR gate can be used as an inverter (NOT gate).
1. All NOR input pins connect to the input signal A gives an output A’.
2. One NOR input pin is connected to the input signal A while all other input pins are connected to
logic 0. The output will be A’.

Implementing OR Using only NOR Gates


An OR gate can be replaced by NOR gates as shown in the figure (The OR is replaced by a NOR
gate with its output complemented by a NOR gate inverter)

Implementing AND Using only NOR Gates

An AND gate can be replaced by NOR gates as shown in the figure (The AND gate is replaced by a
NOR gate with all its inputs complemented by NOR gate inverters)

Thus, the NOR gate is a universal gate since it can implement the AND, OR and NOT functions.

Equivalent Gates:
The shown figure summarizes important cases of gate equivalence. Note that bubbles indicate a
complement operation (inverter).

A NAND gate is equivalent to an inverted-input OR gate.


An AND gate is equivalent to an inverted-input NOR gate.

A NOR gate is equivalent to an inverted-input AND gate.

An OR gate is equivalent to an inverted-input NAND gate.

Two NOT gates in series are same as a buffer because they cancel each other as A’’ = A.

Two-Level Implementations:
We have seen before that Boolean functions in either SOP or POS forms can be implemented using
2-Level implementations.

For SOP forms AND gates will be in the first level and a single OR gate will be in the second level.

For POS forms OR gates will be in the first level and a single AND gate will be in the second level.

Note that using inverters to complement input variables is not counted as a level.

We will show that SOP forms can be implemented using only NAND gates, while POS forms can be
implemented using only NOR gates.

This is best explained through examples.

Example 1: Implement the following SOP function


F = XZ + Y’Z + X’YZ
Being an SOP expression, it is implemented in 2-levels as shown in the figure.

Introducing two successive inverters at the inputs of the OR gate results in the shown equivalent
implementation. Since two successive inverters on the same line will not have an overall effect on
the logic as it is shown before.
(see animation in authorware version)
By associating one of the inverters with the output of the first level AND gate and the other with
the input of the OR gate, it is clear that this implementation is reducible to 2-level implementation
where both levels are NAND gates as shown in Figure.

Example 2: Implement the following POS function

F = (X+Z) (Y’+Z) (X’+Y+Z)


Being a POS expression, it is implemented in 2-levels as shown in the figure.
Introducing two successive inverters at the inputs of the AND gate results in the shown
equivalent implementation. Since two successive inverters on the same line will not have an
overall effect on the logic as it is shown before.
(see animation in authorware version)
By associating one of the inverters with the output of the first level OR gates and the other with
the input of the AND gate, it is clear that this implementation is reducible to 2-level
implementation where both levels are NOR gates as shown in Figure.

There are some other types of 2-level combinational circuits which are
• NAND-AND
• AND-NOR,
• NOR-OR,
• OR-NAND

These are explained by examples.

AND-NOR functions:
Example 3: Implement the following function F = XZ +YZ

+ XYZ or

F = XZ + YZ + XYZ
Since F’ is in SOP form, it can be implemented by using NAND-NAND circuit. By
complementing the output we can get F, or by using NAND-AND circuit as shown in the
figure.

It can also be implemented using AND-NOR circuit as it is equivalent to NAND- AND circuit as
shown in the figure.

OR-NAND functions:
Example 4: Implement the following function

F = ( X + Z ).(Y + Z ).(X +Y + Z ) or

F = ( X + Z )(Y + Z )( X + Y + Z )

Since F’ is in POS form, it can be implemented by using NOR-NOR circuit.


By complementing the output we can get F, or by using NOR-OR circuit as shown in the figure.
It can also be implemented using OR-NAND circuit as it is equivalent to NOR-OR circuit as shown in the
figure.

Sum of Products and Product of Sums


The different forms of canonical expression which include the sum of products (SOP) and products of the
sum (POS), The canonical expression can be defined as a Boolean expression that has either min term
otherwise max term. For example, if we have two variables namely X & Y then the canonical expression
comprising of min terms will be XY+X’Y’, whereas the canonical expression comprising of max terms
will be (X+Y) (X’+Y’).
Sum of Products and Product of Sums

The concept of the sum of products (SOP) mainly includes minterm, types of SOP, K-map, and schematic
design of SOP. Similarly, the product of sums (POS) mainly includes the max term, types of product of
sums, k-map and schematic design of POS. What is a Sum of Product (SOP)?

The short form of the sum of the product is SOP, and it is one kind of Boolean algebra expression. In this,
the different product inputs are being added together. The product of inputs is Boolean logical AND
whereas the sum or addition is Boolean logical OR. Before going to understand the concept of the sum of
products, we have to know the concept of minterm.
The min term can be defined as, when the minimum combinations of inputs are high then the output
will be high. The best example of this is AND gate, so we can say that min terms are combinations of
AND gate inputs. The truth table of the min term is shown below.
In the above table, there are three inputs namely X, Y, Z and the combinations of these inputs are 8.
Every combination has a minterm that is specified with m.

Types of Sum of Product (SOP)

The sum of products is available in three different forms which include the following.

Canonical Sum of Products

Non-Canonical Sum of Products

Minimal Sum of Products

1). Canonical Sum of Products


This is a normal form of SOP, and it can be formed with grouping the minterms of the function for which
the o/p is high or true, and it is also called as the sum of minterms. The expression of the canonical SOP
is denoted with sign summation (∑), and the minterms in the bracket are taken when the output is true.
The truth table of the canonical sum of the product is shown below.
For the above table, the canonical SOP form can be written as F = ∑ (m1, m2, m3, m5) By
expanding the above summation we can get the following function.
F = m1 + m2 + m3 + m5
By substituting the minterms in the above equation we can get the below expression
F = X’Y’Z + X’YZ’ + X’YZ + XY’Z
The product term of the canonical form includes both complemented and non-complimented inputs

Non-Canonical Sum of Products


In the non-canonical sum of product form, the product terms are simplified. For example, let’s take the
above canonical expression.
F = X’Y’Z + X’YZ’ + X’YZ + XY’Z
F = X’Y’Z + X’Y (Z’+Z) + XY’Z
Here Z’+Z =1 (Standard function)
F = X’Y’Z + X’Y (1) + XY’Z
F = X’Y’Z + X’Y + XY’Z This
is still in the form of SOP, but it is the non-canonical form
3). Minimal Sum of Products
This is the most simplified expression of the sum of the product, and It is also a type of non-canonical.
This type of can is made simplified with the Boolean algebraic theorems although it is simply done by
using K-map (Karnaugh map).
This form is chosen due to the number of input lines & and gates are used in this is minimum. It is
profitably useful due to its solid size, quick speed, along with low manufacture price.
Let’s take an example of canonical form function, and the minimal Sum of Products K map is

The expression of this based on the K-map will be


F = Y’Z + X’Y
Schematic Design of Sum of Product
The expression of the sum of product executes two-level AND-OR design, and this design requires a
collection of AND gates and one OR gate. Each expression of the sum of the product has similar
designing.

The number of inputs and the number of AND gates depend upon the expression one is implementing.
The design for a minimal sum of product & canonical expression using AND-OR gates is shown above.
What is a Product of Sum (POS)?
The short form of the product of the sum is POS, and it is one kind of Boolean algebra expression. In this,
it is a form in which products of the dissimilar sum of inputs are taken, which are not arithmetic result &
sum although they are logical Boolean AND & OR correspondingly. Before going to understand the
concept of the product of the sum, we have to know the concept of the max term.
The maxterm can be defined as a term that is true for the highest number of input combinations otherwise
that is false for single input combinations. Because OR gate also provides false for just one input
combination. Thus Max term is OR of any complemented otherwise non-complemented inputs.

In the above table, there are three inputs namely X, Y, Z and the combinations of these inputs are 8.
Every combination has a max term that is specified with M.

In max term, every input is complemented as it provides only ‘0’ while the stated combination is applied
& complement of minterm is a max term.

Types of Product of Sums (POS)

The product of the sum is classified into three types which include the following.

• Canonical Product of Sums


• Non – Canonical Product of Sums
• Minimal Product of Sums
1). Canonical Product of Sum

The canonical POS is also named as a product of max term. These are AND jointly for which o/p is low or
false. The expression this is denoted by ∏ and the max terms in the bracket are taken when the output is
false. The truth table of the canonical product of sum is shown below.
For the above table, the canonical POS can be written as F = ∏ (M0, M4, M6, M7) By expanding
the above equation we can get the following function.
F = M0, M4, M6, M7
By substituting the max terms in the above equation we can get the below expression
F = (X+Y+Z) (X’+Y+Z)(X’+Y’+Z)(X’+Y’+Z’)
The product term of the canonical form includes both complemented and non-complimented inputs
2). Non – Canonical Product of Sum

The expression of the product of sum (POS) is not in normal form is named as non-canonical form. For
example, let’s take the above expression

3). Minimal Product of Sums

This is the most simplified expression of the product of the sum, and it is also a type of non-canonical.
This type of can is made simplified with the Boolean algebraic theorems although it is simply done by
using K-map (Karnaugh map).

This form is chosen due to the number of input lines & gates are used in this is minimum. It is profitably
useful due to its solid size, quick speed, along with low manufacture price.

Let’s take an example of canonical form function, and the Product of sums K map is
POS K-map
The expression of this based on the K-map will be

F = (Y+Z) (X’+Y’) Schematic


Design of Product of Sum

The expression of the product of the sum executes two levels OR- AND design and this design requires a
collection of OR gates and one AND gate. Each expression of the product of the sum has similar
designing.

Schematic
Design of POS
The number of inputs and the number of AND gates depend upon the expression one is implementing.
The design for a minimal sum of product and canonical expression using OR-AND gates is shown
above.

Minterm and Maxterm

interms and Maxterms are important parts of Boolean algebra. Minterm is the product of N
distinct literals where each literal occurs exactly once. The output of the minterm functions is 1.
Minterm is represented by m. Maxterm is the sum of N distinct literals where each literals occurs
exactly once. The output of the maxterm functions is 0. Maxterm is represented by M. In this
article we will learn about minterms and maxterms, their difference, why we use minterms and
maxterms along with the solved examples.

What is Minterm?
Minterm is the product of various different literals in which each literal occurs exactly once. The
output result of the minterm functions is 1. It is represented by m. To represent a function, we
perform a sum of minterms also called the Sum Of Products (SOP).
Example of SOP:
A’B + AC + BC

Minterms for Values


Minterms for values is the minterms obtained by the values of the Boolean variable.
Steps for Obtaining Minterms from Values
1. If the value of the Boolean variable is 1 then we will take the variable without complementing it.
2. If the value of the Boolean variable is 0 then we will take the variable by complementing it.
Minterm Example:
If there are four Boolean variables A, B, C, D with the values A = 1, B = 0, C = 0 and D = 1. Find the
minterms for values given.
Solution:
Given the values of the Boolean variables:
A = 1, B = 0, C = 0 and D = 1
The required minterm is given by = AB’C’D We
complemented B and C as its value is 0.
What is Maxterm?
Maxterm is the sum of various different literals in which each literal occurs exactly once. The output result
of the maxterm functions is 0. It is represented by M. To represent a function, we perform product of
maxterms also called Product of Sum (POS). Example of POS:

Maxterms for values is the maxterms obtained by the values of the Boolean variable.
Steps for obtaining maxterms from values:
1. If the value of the Boolean variable is 0 then we will take the variable without complementing it.
2. If the value of the Boolean variable is 1 then we will take the variable by complementing it. Maxterm
Example:
If there are four Boolean variables A, B, C, D with the values A = 1, B = 0, C = 0 and D = 1. Find the
maxterm for values given.
Solution:
Given the values of the Boolean variables:
A = 1, B = 0, C = 0 and D = 1
The required maxterm is given by = A’ + B + C + D’ We
complemented A and D as its value is 1.
Minterm vs Maxterm
Minterm Maxterm

Maxterm is the term with the sum of N literals


Minterm is the term with the product of N literals
occurring exactly once.
occurring exactly once.

It is represented by m. It is represented by M.

It is logical AND of distinct literals. It is logical OR of distinct literals.

The sum of minterms forms SOP (Sum of The product of maxterms forms POS (Product of
Product) functions. Sum) functions.

The output result of minterm function is 1. The output result of maxterm function is 0.

It works on active low.


It works on active high.

Example: AB + A’B’ Example: (A+B). (A’+B’)

Below mentioned is the image of Four Variable K-Map.


Why we use Minterms and Maxterms ?
Minterms and Maxterms are used to express the Boolean functions in its canonical forms. The minterms
and maxterms are the basic building blocks for representing the Boolean functions in the canonical forms.
The minterms are the terms which are used when we require active high output. The maxterms are the
terms which are used when we require active low output.
KARNAUGH MAP MINIMIZATION:

The simplification of the functions using Boolean laws and theorems becomes complex
with the increase in the number of variables and terms. The map method, first proposed by Veitch
and slightly improvised by Karnaugh, provides a simple, straightforward procedure for the
simplification of Boolean functions. The method is called Veitch diagram or Karnaugh map,
which may be regarded as a pictorial representation of a truth table.
The Karnaugh map technique provides a systematic method for simplifying and
manipulation of Boolean expressions. A K-map is a diagram made up of squares, with each square
representing one minterm of the function that is to be minimized. For n variables on a Karnaugh
map there are 2n numbers of squares. Each square or cell represents one of the minterms. It can be
drawn directly from either minterm (sum-of- products) or maxterm (product-of-sums) Boolean
expressions.

Two- Variable, Three Variable and Four Variable Maps


Karnaugh maps can be used for expressions with two, three, four and five variables. The number
of cells in a Karnaugh map is equal to the total number of possible input variable combinations as
is the number of rows in a truth table. For 3 variables, the number of cells is 23 = 8. For four
variables, the number of cells is 24 = 16.
Product terms are assigned to the cells of a K-map by labeling each row and each column
of a map with a variable, with its complement or with a combination of variables & complements.
The below figure shows the way to label the rows & columns of a 1, 2, 3 and 4- variable maps and
the product terms corresponding to each cell.

It is important to note that when we move from one cell to the next along any row or from
one cell to the next along any column, one and only one variable in the product term changes (to
a complement or to an uncomplemented form). Irrespective of number of variables the labels along
each row and column must conform to a single change. Hence gray code is used to label the rows
and columns of K-map as shown below.
Grouping cells for Simplification:
The grouping is nothing but combining terms in adjacent cells. The simplification is
achieved by grouping adjacent 1’s or 0’s in groups of 2i, where i = 1, 2, …, n and n is the number
of variables. When adjacent 1’s are grouped then we get result in the sum of product form;
otherwise we get result in the product of sum form.

Grouping Two Adjacent 1’s: (Pair)


In a Karnaugh map we can group two adjacent 1’s. The resultant group is called Pair.
Examples of Pairs

Grouping Four Adjacent 1’s: (Quad)


In a Karnaugh map we can group four adjacent 1’s. The resultant group is called Quad. Fig
(a) shows the four 1’s are horizontally adjacent and Fig (b) shows they are vertically adjacent. Fig
(c) contains four 1’s in a square, and they are considered adjacent to each other.

Examples of Quads
The four 1’s in fig (d) and fig (e) are also adjacent, as are those in fig (f) because, the top
and bottom rows are considered to be adjacent to each other and the leftmost and rightmost
columns are also adjacent to each other.

Grouping Eight Adjacent 1’s: (Octet)


In a Karnaugh map we can group eight adjacent 1’s. The resultant group is called Octet.

Simplification of Sum of Products Expressions: (Minimal Sums)


The generalized procedure to simplify Boolean expressions as follows:
1. Plot the K-map and place 1’s in those cells corresponding to the 1’s in the sum of
product expression. Place 0’s in the other cells.
2. Check the K-map for adjacent 1’s and encircle those 1’s which are not adjacent to any
other 1’s. These are called isolated 1’s.
3. Check for those 1’s which are adjacent to only one other 1 and encircle such pairs.
4. Check for quads and octets of adjacent 1’s even if it contains some 1’s that have
already been encircled. While doing this make sure that there are minimum number of
groups.
5. Combine any pairs necessary to include any 1’s that have not yet been grouped.
6. Form the simplified expression by summing product terms of all the groups.

Three- Variable Map:

1. Simplify the Boolean expression,


F(x, y, z) = ∑m (3, 4, 6, 7).
Soln:

F = yz+ xz’

3. F(x, y, z) = ∑m (0, 2, 4, 5, 6).


Soln:

F = z’+ xy’

3. F = A’C + A’B + AB’C + BC Soln:


= A’C (B+ B’) + A’B (C+ C’) + AB’C + BC (A+ A’)
= A’BC+ A’B’C + A’BC + A’BC’ + AB’C + ABC + A’BC
= A’BC+ A’B’C + A’BC’ + AB’C + ABC

= m3+ m1+ m2+ m5+ m7


= ∑ m (1, 2, 3, 5, 7)
Four - Variable Map:

1. Simplify the Boolean expression,


Y = A’BC’D’ + A’BC’D + ABC’D’ + ABC’D + AB’C’D + A’B’CD’ Soln:

Therefore,
Y= A’B’CD’+ AC’D+ BC’

2. F (w, x, y, z) = ∑ m(0, 1, 2, 4, 5, 6, 8, 9, 12, 13, 14) Soln:

Therefore,
F= y’+ w’z’+ xz’
3. F= A’B’C’+ B’CD’+ A’BCD’+ AB’C’
= A’B’C’ (D+ D’) + B’CD’ (A+ A’) + A’BCD’+ AB’C’ (D+ D’)
= A’B’C’D+ A’B’C’D’+ AB’CD’+ A’B’CD’+ A’BCD’+ AB’C’D+ AB’C’D’

= m1+ m0+ m10+ m2+ m6+ m9+ m8


= ∑ m (0, 1, 2, 6, 8, 9, 10)

Therefore,
F= B’D’+ B’C’+ A’CD’.

4. Y= ABCD+ AB’C’D’+ AB’C+ AB


= ABCD+ AB’C’D’+ AB’C (D+D’)+ AB (C+C’) (D+D’)
= ABCD+ AB’C’D’+ AB’CD+ AB’CD’+ (ABC+ ABC’) (D+ D’)
= ABCD+ AB’C’D’+ AB’CD+ AB’CD’+ ABCD+ ABCD’+ ABC’D+ ABC’D’
= ABCD+ AB’C’D’+ AB’CD+ AB’CD’+ ABCD’+ ABC’D+ ABC’D’

= m15+ m8+ m11+ m10+ m14+ m13+ m12


= ∑ m (8, 10, 11, 12, 13, 14, 15)
Therefore, Y= AB+ AC+ AD’.

5. Y (A, B, C, D)= ∑ m (7, 9, 10, 11, 12, 13, 14, 15)

Y= AB+ AC+ AD+BCD.

6. Y= A’B’C’D+ A’BC’D+ A’BCD+ A’BCD’+ ABC’D+ ABCD+ AB’CD


= m1+ m5+ m7+ m6+ m13+ m15+ m11
= ∑ m (1, 5, 6, 7, 11, 13, 15)
In the above K-map, the cells 5, 7, 13 and 15 can be grouped to form a quad as indicated
by the dotted lines. In order to group the remaining 1’s, four pairs have to be formed. However, all
the four 1’s covered by the quad are also covered by the pairs. So, the quad in the above k-map is
redundant.
Therefore, the simplified expression will be,
Y = A’C’D+ A’BC+ ABD+ ACD.

7. Y= ∑ m (1, 5, 10, 11, 12, 13, 15)

Therefore, Y= A’C’D+ ABC’+ ACD+ AB’C.


8. Y= A’B’CD’+ ABCD’+ AB’CD’+ AB’CD+ AB’C’D’+ ABC’D’+ A’B’CD+ A’B’C’D’

Therefore, Y= AD’+ B’C+ B’D’

9. F (A, B, C, D) = ∑ m (0, 1, 4, 8, 9, 10)

Therefore, F= A’C’D’+ AB’D’+ B’C’.

Simplification of Sum of Products Expressions: (Minimal Sums)

1. Y= (A+ B+ C’) (A+ B’+ C’) (A’+ B’+ C’) (A’+ B+ C) (A+ B+ C)
= M1. M3. M7. M4. M0

=∏ M (0, 1, 3, 4, 7)
= ∑ m (2, 5, 6)
Y’ = B’C’+ A’C+ BC.

Y= Y” = (B’C’+ A’C+ BC)’

= (B’C’)’. (A’C)’. (BC)’

= (B”+ C”). (A”+C’). (B’+ C’) Y =

(B+ C). (A+C’). (B’+ C’)

2. Y= (A’+ B’+ C+ D) (A’+ B’+ C’+ D) (A’+ B’+ C’+ D’) (A’+ B+ C+ D) (A+ B’+ C’+ D)
(A+ B’+ C’+ D’) (A+ B+ C+ D) (A’+ B’+ C+ D’)
= M12. M14. M15. M8. M6. M7. M0. M13

= ∏M (0, 6, 7, 8, 12, 13, 14, 15)

Y’ = B’C’D’+ AB+ BC

Y= Y” = (B’C’D’+ AB+ BC)’

= (B’C’D’)’. (AB)’. (BC)’

= (B”+ C”+D”). (A’+B’). (B’+ C’)

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

Therefore, Y= (B+ C+ D). (A’+ B’). (B’+ C’)


3. F(A, B, C, D)= ∏M (0, 2, 3, 8, 9, 12, 13, 14, 15)

Y’ = A’B’D’+ A’B’C+ ABD+ AC’

Y= Y” = (A’B’D’+ A’B’C+ ABD+ AC’)’

= (A’B’D’)’. (A’B’C)’. (ABD)’. (AC’)’

= (A”+ B”+ D”). (A”+ B”+C’). (A’+ B’+ D’). (A’+ C”) = (A+

B+ D). (A+ B+ C’). (A’+ B’+ D’). (A’+ C)

Therefore, Y= (A+ B+ D). (A+ B+ C’). (A’+ B’+ D’). (A’+ C)

4. F(A, B, C, D)= ∑m (0, 1, 2, 5, 8, 9, 10)


= ∏M (3, 4, 6, 7, 11, 12, 13, 14, 15)

Y’ = BD’+ CD+ AB

Y= Y” = (BD’+ CD+ AB)’


= (BD’)’. (CD)’. (AB)’
= (B’+ D”). (C’+ D’). (A’+ B’)

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

Therefore, Y= (B’+ D). (C’+ D’). (A’+ B’)

Don’t care Conditions:


A don’t care minterm is a combination of variables whose logical value is not specified.
When 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.

1. F (x, y, z) = ∑m (0, 1, 2, 4, 5)+ ∑d (3, 6, 7)

F (x, y, z) = 1

2. F (w, x, y, z) = ∑m (1, 3, 7, 11, 15)+ ∑d (0, 2, 5)

F (w, x, y, z) = w’x’+ yz
F (w, x, y, z) = w’xz+ wy’+ x’z’.
3. F (w, x, y, z) = ∑m (0, 1, 4, 8, 9, 10)+ ∑d (2, 11) Soln:

F (w, x, y, z) = wx’+ x’y’+ w’y’z’.

4. F( A, B, C, D) = ∑m (0, 6, 8, 13, 14)+ ∑d (2, 4, 10) Soln:

F( A, B, C, D) = CD’+ B’D’+ A’B’C’D’.


Five- Variable Maps:
A 5- variable K- map requires 25= 32 cells, but adjacent cells are difficult to identify on a
single 32-cell map. Therefore, two 16 cell K-maps are used.
If the variables are A, B, C, D and E, two identical 16- cell maps containing B, C, D and E
can be constructed. One map is used for A and other for A’.
In order to identify the adjacent grouping in the 5- variable map, we must imagine the two
maps superimposed on one another ie., every cell in one map is adjacent to the corresponding cell
in the other map, because only one variable changes between such corresponding cells.

Five- Variable Karnaugh map (Layer Structure)

Thus, every row on one map is adjacent to the corresponding row (the one occupying the
same position) on the other map, as are corresponding columns.
Also,the rightmost and leftmost columns within each 16- cell map are adjacent, just as they
are in any 16- cell map, as are the top and bottom rows.
Typical subcubes on a five-variable map

However, the rightmost column of the map is not adjacent to the leftmost column of the other
map.

1. Simplify the Boolean function


F (A, B, C, D, E) = ∑m (0, 2, 4, 6, 9, 11, 13, 15, 17, 21, 25, 27, 29, 31)
Soln:

F (A, B, C, D, E) = A’B’E’+ BE+ AD’E

2. F (A, B, C, D, E) = ∑m (0, 5, 6, 8, 9, 10, 11, 16, 20, 24, 25, 26, 27, 29, 31)
Soln:
F (A, B, C, D, E) = C’D’E’+ A’B’CD’E+ A’B’CDE’+ AB’D’E’+ ABE+ BC’

3. F (A, B, C, D, E) = ∑m ( 1, 4, 8, 10, 11, 20, 22, 24, 25, 26)+∑d (0, 12, 16, 17) Soln:

F (A, B, C, D, E) = B’C’D’+ A’D’E’+ BC’E’+ A’BC’D+ AC’D’+ AB’CE’

4. F (A, B, C, D, E) = ∑m (0, 1, 2, 6, 7, 9, 12, 28, 29, 31)


Soln:
F (A, B, C, D, E) = BCD’E’+ ABCE+ A’B’C’E’+ A’C’D’E+ A’B’CD

5.

F (x1, x2, x3, x4, x5) = x2x3+ x3x4x5+ x1’x2’x4+ x1’x3’x4x5


6. F (x1, x2, x3, x4, x5) = ∑m (1, 2, 3, 6, 8, 9, 14, 17, 24, 25, 26, 27, 30, 31 )+ ∑d (4, 5)
Soln:

F (x1, x2, x3, x4, x5) = x2x3’x4’+ x2x3x4x5’+ x3’x4’x5+ x1x2x4+ x1’x2’x3x5’+ x1’x2’x3’x4

QUINE-MCCLUSKEY (OR) TABULAR METHOD:


The K-map is a vercy effective tool for minimization of logic functions with 4 or less
variables. For logic expressions with more than 4 variables, the visualization of adjacent cells and
drawing of the K-map becomes more difficult.
The Quine-McCluskey method, also known as the tabular method, can be employed in
such cases to minimize switching functions. This method employs a systematic, step-bystep
procedure to produce a simplified standard form of expression for a function with any number of
variables.

The steps to be followed in Quine-McCluskey method are –


1. A set of all prime implicants of the function must be obtained.
2. From the set of all prime implicants, a set of essential implicants must be determined by
preparing a prime implicants chart.
3. The minterms which are not covered by the essential implicants are taken into
consideration and a minimum cover is obtained from the remaining prime implicants.

Selecting prime implicants:


1. List all minterms in the binary form.
2. Arrange the minterms according to the number of 1’s.
3. Compare each binary number with every term in the adjacent next higher category and if
they differ only by one position, put a check mark ( ) and copy the term in the next
column with ‘—‘ in the position that they differed.
4. Apply the same process described in step 3 for the resultant column and continue these
cycles until a single pass through cycle yields no further elimination of literals.
5. List all prime implicants.
6. Select the minimum number of prime implicants which must cover all the minterms.

1. Find the minimal SOP expression for the following function


F (a, b, c, d) = ∑ m(0, 3, 4, 6, 11) + ∑ d(8, 10, 12, 13) using Quine-McCluskey method.
Soln:
Step 1:
These minterms are represented in the binary form.

Minterm a b c d

0 0 0 0 0
3 0 0 1 1
4 0 1 0 0
6 0 1 1 0
11 1 0 1 1
8 1 0 0 0
10 1 0 1 0
12 1 1 0 0
13 1 1 0 1
Binary representation of minterms

Step 2:
The above binary representations are grouped into a number of sections in terms of
the number of 1’s.
No of 1’s Minterm a b c d

0 0 0 0 0 0
4 0 1 0 0
1
8 1 0 0 0
3 0 0 1 1
6 0 1 1 0
2 10 1 0 1 0

12 1 1 0 0
11 1 0 1 1
3
13 1 1 0 1
Group of minterms for different number of 1’s
2. Find the minimal SOP expression for the following function
F (w, x, y, z) = ∑ m (0, 1, 2, 3, 10, 11, 12, 13, 14, 15) using Quine-McCluskey method.
Soln:
Step 1:
These minterms are represented in the binary form.

Minterm w x y z
0 0 0 0 0
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
10 1 0 1 0
11 1 0 1 1
12 1 1 0 0
13 1 1 0 1
14 1 1 1 0
15 1 1 1 1

Binary representation of minterms


Step 2:
The above binary representations are grouped into a number of sections in terms of
the number of 1’s.
No of 1’s Minterm w x y z

0 0 0 0 0 0
1 0 0 0 1
1
2 0 0 1 0
3 0 0 1 1
2 10 1 0 1 0
12 1 1 0 0
11 1 0 1 1
3 13 1 1 0 1
14 1 1 1 0
4 15 1 1 1 1
Group of minterms for different number of 1’s

Step 3:

Minterm Combination w x y z

(0, 1) 0 0 0 -
(0, 2) 0 0 - 0
(1, 3) 0 0 - 1
(2, 3) 0 0 1 -
(2, 10) - 0 1 0
(3, 11) - 0 1 1
(10, 11) 1 0 1 -
(10, 14) 1 - 1 0
(12, 13) 1 1 0 -
(12, 14) 1 1 - 0
(11, 15) 1 - 1 1
(13, 15) 1 1 - 1
(14, 15) 1 1 1 -
2-cell combinations

Step 4:
From the two-cell combinations, one variable and a dash (-) in the same position can
be combined to form 4-cell combination.

Minterm Combination w x y z

(0, 1, 2, 3) 0 0 - -
(2, 3, 10, 11) - 0 1 -
(10, 11, 14, 15) 1 - 1 -
(12, 13, 14, 15) 1 1 - -
4-cell combinations

Step 5:
The column having only one cross mark corresponds to the essential prime implicants.
A tick mark is put against every column which has only one cross mark. A star mark is put
against every essential prime implicants.

Prime Implicants 0 1 2 3 10 11 12 13 14 15

w’x’ * (0, 1, 2, 3) x x x
x’y * (2, 3, 10, 11) x x x x
wy (10, 11, 14, 15) x x x x
wx * (12, 13, 14, 15) x x x

F (w, x, y, z) = w’x’+ wx+ (x’y or wy).


3. Find the minimal SOP expression for the following function

F (A, B, C, D) = ∑ m (1, 3, 4, 7, 8, 10, 11, 13, 15) using Quine-McCluskey method.


Soln:
Step 1:
These minterms are represented in the binary form.
Minterm A B C D

1 0 0 0 1
3 0 0 1 1
4 0 1 0 0
7 0 1 1 1
8 1 0 0 0
10 1 0 1 0
11 1 0 1 1
13 1 1 0 1
15 1 1 1 1
Binary representation of minterms
Step 2:

The above binary representations are grouped into a number of sections in terms
of the number of 1’s.
Step 3:
F (A, B, C, D) = A’BC’D’+ A’B’D+ AB’D’+ ABD+ CD
F (A, B, C, D) = A’B’C’+ B’D’+ AC.
5. Find the minimal SOP expression for the following function
F (A, B, C, D) = Σ m (0, 2, 3, 6, 7, 8, 10, 12, 13) using Tabulation method.
Soln:
Step 1:
List all minterms in the binary form.

You might also like