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

CHAPTER ONE

NUMBER SYSTEMS AND CODES

Objectives
Upon completion of this chapter, you should be able to:
• Determine the weighting factor for each digit positionin the decimal, binary, octal, and
hexadecimal numbering systems.
• Convert any number in one of the four number systems (decimal, binary, octal, or
hexadecimal) to its equivalent value in any of the remaining three number systems.
• Describe the format and use of binary-coded-decimal (BCD) numbers
• Determine the ASCII code for any alphanumeric data by using the ASCII code translation
table.

Introduction
Digital circutry is the foundation of digital computers and many automated control systems.
In modern home, digital circutry controls the appliances, alarm systems, and heating systems.
Undr the control of digital circutry and microprossesor, newer automobiles have added safet
features, are more energy efficient, and are easier to diagnose and correct when malfunctions
arise.
The most widely used number system is the positional system. In this system the position
of various digits indicates the significance to be attached to that digit. Positional number systems
have a radix or a base. In the decimal system the radix is 10.

Characteristics of commonly used Number System

Number Base Symbols used Example


System
Binary 2 0,1 1011.11
Octal 8 0,1,2,3,4,5,6,7 3567.25
Decimal 10 0,1,2,3,4,5,6,7,8,9 3974.576
Hexa-decimal 16 0,1,2,3,4,5,6,7,8 3FA9.56
9,A,B,C,D,E,F

Base Or Radix:
The base or radix of a number system equals the number of digits it has. Decimal numbers
have a base of 10 because digits 0 through 9 are used. Binary numbers have a base of 2 because
only the digits 0 and 1 are used. A subscript attached to a number indicates the base of the
number.
Positional Notation And Weights:
The decimal number system uses positional notation. Each digit position has a weight or
value. For decimal number the weights are units, tens, hundreds, etc., The sum of all the digits
multiplied by their weights gives the total amount.

-1-
Example:
For Decimal Number:
Number = (2342)10
2’s weight is 1000=103
3’s weight is 100=102
4’s weight is 10=101
2’s weight is 1=100
therefore 2342 = 2*1000 + 3*100 + 4*10 + 2*1
= 2000+300+40+2( In powers of 10 2*103 + 3*102 + 4*101+2*1)
For Binary Number:
Number = 101
1’s weight is 100=102
0’s weight is 10=101
1’s weight is 1=100
therefore 111 = 1*100 + 0*10 +1*1
=100+0+1
=101

BINARY TO DECIMAL CONVERSION


To convert a binary number into decimal number, multiply each binary digit by its positional
weight and add them.
To simplify the conversion, the following steps may be followed:
1) write the binary number
2) write the numbers (weights) 1,2,4,8,16 (20,21,22,23,24…) directly under each digit of the
binary integer number starting from the digit next to binary point towards left.
3) Whenever zero appears in the given binary number, the corresponding weights written
below the ‘0’s can be neglected and by adding the remaining weights the decimal
equivalent is obtained.

Example:
Conteger Integer Part to decimal equivalent:
Convert (10011)2 to decimal equivalent

Step 1 : 1 0 0 1 1
Step 2 : 16 8 4 2 1
Step 3 : 16 8 4 2 1
Step 4 : 16+2+1 = 19

(10011)2 = (19)10

-2-
Converting Fractional part to decimal equivalent:
Converting fraction to decimal is same as converting binary integer to decimal equivalent except that the
weights of digit positions (1,2,4,8,16…..) are to be replaced with ½, ¼ ,1/8,1/16 (i.e 2-1,2-2,2-3,2-4 ) starting from the
binary digit next to the decimal point towards right.

Convert (0.1011)2 to decimal equivalent

Step 1 : 1 0 1 1
Step 2 : 0.5 0.25 0.125 0.0625
Step 3 : 0.5 0.25 0.125 0.0625
Step 4 : 0.5 + 0.125 + 0.0625= 0.6875

(0.1011)2 = (0.6875)10

DECIMAL-TO-BINARY CONVERSION
To convert decimal numbers to binary numbers double dabble method is followed. In this
method divide the decimal number by 2, writing down the remainder after each division till we get
the quotient zero. Then the remainders are written sequentially with the last remainder at the left
most extreme and the first remainder at the right most extreme.

Example:
Conversion Of An Integer From Decimal To Binary

1.convert (17)10 to binary

2 17
1. First divided 17 by 2 to get an integer quotient of 8 and
remainder as 1.
2. Then the quotient 8 is divided by 2 to a new quotient
2 8 1
and remainder.
3. This process is repeated until the integer quotient
becomes 1.
2 4 0

2 2 0

1 0

(17)10=(10001)2

Conversion Of Fraction To A Binary


The conversion of fraction to binary is same as conversion of integer to binary except that
multiplication is used instead of division and integers are accumulated instead of remainders.

-3-
Example:

Convert (0.6875)10 to binary


a) 0.6875 is multiplied by 2 to give an integer and a fraction.(1.3750)
b) The new fraction (0.3750) is multiplied by 2 to give a integer and a new fraction.(0.7500)
c) This process is repeated until the fraction becomes 0 or the number of digits have sufficient
accuracy.

Integer Fraction Coefficient


0.6875 * 2 = 1 + 0.3750 a-1 =1
0.3750 * 2 = 0 + 0.7500 a-2 =0
0.7500 * 2 = 1 + 0.5000 a-3 =1
0.5000 * 2 = 1 + 0.0000 a-4 =1

Answer : (0.6875)=( 0.a-1 a-2 a-3 a-4 )2 = (0.1011)2

OCTAL NUMBER SYSTEMS


Since binary numbers are long and cumbersome to represent directly it is customary to
represent by a number system, which is closely related to binary. There are two types of such
systems used namely Octal and Hexadecimal Systems. Though a number is referred by any of
these systems it is stored only in equivalent binary digits. The reason for using these systems in
the latest computers, is that it represents a number in a simple form.
In octal number system the base is 8 and the digits vary from 0 to 7. The position of a digit
to the left carries a weightage in ascending powers of 8 similar to the binary system. It may be
noted that one digit of Octal System is equivalent to 3 digits of the corresponding positions in a
binary to represent the same value.

Conversion Of Decimal Number To Octal Number


To convert the octal number to decimal, use octal dabble method similar to double dabble
method of binary number system. Divide the number by 8 to obtain the quotient and remainder.
Repeat the same process of dividing the number(quotient) >=1 and < 8 as the final remainder. The
remainders in the reverse order form the octal number.

Example:
Conversion of decimal integer to octal:
convert (175)10 the decimal number to octal number

8 175
1. First divided 175 by 8 to get an integer quotient of
21 and remainder as 8.
2. Then the quotient 21 is divided by 8 to a new
8 21 7
quotient(2) and remainder(5).
3. This process is repeated until the integer quotient
becomes less than 8.
2 5

-4-
Conversion of decimal fraction to octal:
The conversion of fraction to octal is same as conversion of integer to octal except that
multiplication is used instead of division and integers are accumulated instead of remainders.
convert (0.23)10 to octal
1. 0.23 is multiplied by 8 to give an integer(1) and a fraction (0.84).
2. The new fraction 0.84 is multiplied by 8 to give a integer and a new fraction.
3. This process is repeated until the fraction becomes 0 or the number of digits have
sufficient accuracy.

Integer Fraction Coefficient


0.23 * 8 = 1 + 0.84 a-1 =1
0.84 * 8 = 6 + 0.72 a-2 =6
0.72 * 8 = 5 + 0.76 a-3 =5

Answer : (0.23)=( 0.a-1 a-2 a-3 )8 = (0.165)10

Conversion Of Octal number To Decimal Equivalent


To convert an octal number into decimal, multiply each octal digit by its weights and add the
resulting products.

Example:
Convert (237.42)8 to decimal equivalent
(237.42) 8 = (2*82) + (3*81) + (7*80) + (4*8–1) + (2*8–2)
= 2*64 + 3* 8 + 7 + 4/8 + 2/64
= 128 + 24 + 7 + 0.5 + 0.0312
= (159.5312) 10

(237.42)8 = (159.5312)10

Conversion of Octal Number To Binary Equivalent


The conversion from octal to binary number becomes simple since the base of octal number 8
is the third power of 2, the base of binary numbers. Here each octal digit if replaced by its 3 binary
equivalent.

Example:
Conversion of an octal integer to binary equivalent
The binary equivalent for the (634)8 is converted directly as follows
1.The first digit 4 is equivalent to 100
2.The second digit 3 is equivalent to 011
3.The third digit 6 is equivalent to 110

Therefore (634)8 = (110 011 100)2

-5-
Conversion of an octal fraction to binary equivalent

The binary equivalent for the (34.56)8 is converted directly as follows


1.The first digit 3 is equivalent to 011
2.The second digit 4 is equivalent to 100
3.The third digit 5 is equivalent to 101
3.The fourth digit 6 is equivalent to 110

Therefore (34.56)8 = ( 011 100 . 101 110) = (011100.101110)2

Conversion of Binary To Octal Conversion


Large binary numbers can be converted into octal by grouping the bits in three, stating at the
binary point and then converting each group of three to its octal equivalent (0’s are added at each
end, if necessary)
Example:

1. Convert the binary number (1011.01101)2 into octal


(1011.01101)2 = 001 011 . 011 010
=1 3 . 3 2
Therefore the octal number of (1011.01101)2 is (13.32)8

2. Convert the binary number (10101011)2 into octal (adding zero’s at left end)
(1011.01101)2 = 010 101 . 011
= 2 5 . 3
Therefore the octal number of (10101011)2 is (253)8

Advantage of using octal over Binary:


1. Octal number system requires less circuit because octal number are easier to read, record
and print then binary numbers.
2. Large decimal numbers are easily converted to binary if we first convert to octal and then
to binary. The reason is that a direct decimal-to-binary conversion requires many division
than a decimal to octal conversion.

HEXADECIMAL NUMBER SYSTEM:


The number system having 16 as its base or radix is known as the Hexa Decimal Number
System. It has 16 digits, which are 0,1,2,3,4,5,6,7,8,9,A, B, C, D, E, and F. It means that a
hexadecimal number is a string consisting of 0 to 9 decimal digits and A to F alphabets. The
alphabets A to F represents the decimal numbers 10 to 15 example (79BE) 16 is a hexadecimal
number in which B stands for the digit 11 and E stands for 14.

-6-
Conversion Of Decimal To HexaDecimal
One method to convert the Decimal to Hexadecimal is the Hex Dabble method. In this method
divide the decimal number by 16 the base of hexadecimal system writing down the remainders
after each division. The remainders in reverse order form the hexadecimal form

Example:
Conversion of decimal into hexadecimal (934)10

16 42077 13(D)
1. First divided 42077 by 16 get an integer quotient
of 2629 and remainder as 5.
16 2629 5
2. Then the quotient 2629 is divided by 16 to a new
quotient (164) and remainder(4).
3. This process is repeated until we get the quotient
16 164 4
less than 16 as the final remainder.

10(A)

Therefore the hexadecimal A45D is equivalent to 422077.

Conversion of Decimal fraction to Hexadecimal equivalent


The conversion of fraction to Hexadecimal is same as conversion of integer to Hexdecimal
except that multiplication is used instead of division and integers are accumulated instead of
remainders.

Example:
Convert (0.85)10 into hexadecimal

1. 0.85 is multiplied by 16 to give an integer(13) and a fraction (0.60).


2. The new fraction 0.60 is multiplied by 16 to give a integer and a new fraction.
3. This process is repeated until the fraction becomes 0 or the number of digits have
sufficient accuracy.

Integer Fraction Coefficient


0.85 * 16 = 13 + 0.60 a-1 =13
0.60 * 16 = 9 + 0.60 a-2 =9
0.60 * 16 = 9 + 0.60 a-3 =9

Answer : (0.85)16 = (0. a-1 a-2 a-3 ) 8 = ( 0.D99 )10

-7-
Conversion Of Hexadecimal To Decimal
The positional weightage of each digit in the hexadecimal number is in powers of 16. Multiply
each Hexadecimal digit by its weight and add the resulting product.

Example:

Convert (A6B8)16 to decimal equivalent.


(A6B8)16 = (A*163) + (6*162) + (B*161) + (8 *160)
= (10 * 4096) + (6* 256) + (11*16) + 8
= 40960 + 1536 + 176 + 8 = 42680
Therefore (A6B8)16 = (42680)10

Conversion of Hexadecimal To Binary Conversion


In this, the base of hexadecimal number system 16 is the fourth power of 2 (i.e 2 4) which is the
base of binary numbers. Therefore for converting hexadecimal number into binary, each
hexadecimal digits has to be replaced by its 4 bit binary equivalent.

Example :

Conversion of hexadecimal integer to binary equivalent


Convert (A94)16 to binary equivalent.
1. The binary equivalent of A is 1010
2. The binary equivalent of 9 is 1001
3. The binary equivalent of 4 is 0100
Therefore (A94)16 = (1010 1001 0100)2

Conversion of Hexadecimal fraction binary


The binary equivalent for the (34.56)16 is converted as follows
1. The first digit 3 is equivalent is 0011
2. The second digit 4 is equivalent is 0100
3. The third digit 5 is equivalent is 1000
4. The fourth digit 6 is equivalent to 0110
Therefore (34.86)16 = ( 0011 0100.1000 0110) 2 = (00110100.10000110) 2

Conversion of Binary To Hexadecimal


Binary numbers can be converted into its equivalent hexadecimal number by grouping the
bits in four, starting from the binary point and then converting each group of four to its hexadecimal
equivalent ( 0’s are added at each end, if necessary)
Example:

Convert binary into hexadecimal number


(111101010110)2 = 1111 0101 0110
= F 5 6
(111101010110)2 = (F56)16

-8-
ASCII CODE
To get information into and out of a computer, we need to us some kind of alphanumeric code
for letters, numbers, and other symbols. At one time, manufacturers used their own alphanumeric
codes, which led to all kinds of confusion. To avoid the discrepancies an common standard for
input-output code known as the American Standard Code for Information Interchange is followed
by all the industries. This code allows manufacturers to standardize computer hardware such as
keyboards, printers, and video displays.

The ASCII code is a 7-bit code whose format is


X6X5X4X3X2X1X0

ASCII CODE

X6X5X4
X3x2x1x0
010 011 100 101 110 111
0000 SP 0 @ P p
0001 ! 1 A Q a q
0010 “ 2 B R b r
0011 # 3 C S c s
0100 $ 4 D T d t
0101 % 5 E U e u
0110 & 6 F V f v
0111 ‘ 7 G W g w
1000 ( 8 H X h x
1001 ) 9 I Y I y
1010 * : J Z j z
1011 + ; K  k 
1100 , < L l
1101 - = M  m

1110 . > N N ∞

1111 / ? O o DEL

The letter A has X6X5X4 as 100 and X3x2x1x0 as 0001. Therefore the ASCII code is 100 0001.
In the same way the ASCII for d is 110 0100 and $ is 010 0100. In the above table SP stands
for blank space.

Parity Bit
The ASCII code is used for sending digital data over Telephone lines, 1 bit-error may occur in
Transmitted data. To Catch these errors, a parity bit is usually transmitted along with the original
bits. Then a parity checker at the receiving end can test for even or odd parity, whichever parity
has been prearranged between the sender and the receiver. Since ASCII code uses 7 bits, the
addition of a parity bit to the transmitted data produces an 8-bit number in this format:

-9-
X7x6x5x4x3x2x1x0

Parity bit.

GRAY CODE
Each Gray-code number differs from the preceding number by a single bit. The numbers
differs in their Most significant bits. The conversion from binary to gray code is as follows
1. The leftmost digit of the binary number is also the leftmost digit of the gray code.

2. The mod 2 sum (0⊕ 0 =1⊕ 1=0 and 1⊕ 0 =0 ⊕ 1=1) of the two leftmost digits in the

binary number will ggive the second leftmost digit in the Gray code.
3. The mod 2 sum of the second and third digits of the binary number give the third leftmost
digit of the gray code. This rule continues until the mod 2 sum of the two rightmost digit of
the binary number give the rightmost gray code digit.

Example:
Conversion of the binary to Gray code is:

0111 : binary
0 leftmost digit
0⊕1 =1 d leftmost digit

1⊕1 =0 next digit

1⊕1 =0 rightmost digit

Therefore the gray code of 0111 binary is 0100

Decimal Gray Code

0 0000
1 0001
2 0011
3 0010
4 0110
5 0111
6 0101
7 0100
8 1100
9 1101
10 1111
11 1110
12 1010
13 1011
14 1001
15 1000

- 10 -
EXCESS – 3 CODE
One of the first, a code that was used in the early Mark machines built at Harvard and has
been used a good deal since , is known as the Excess – 3 code. The Excess-3 code is a 4-bit
code used with Binary Coded Decimal (BCD). To convert a decimal number into Excess-3 form
add 3 to each digit, and then convert the sum to BCD number.
For, instance, to form the excess-3 representation for 29 , first 3 is added to 2 yielding 5 and 3 is
added to 9 to yield 12.
2 9
+3 3
------- ----
5 12
------- -----

0101 1100
The Excess-3-code for 29 is 01011100

DECIMAL BCD EXCESS-3 CODE


0 0000 0011
1 0001 0100
2 0010 0101
3 0011 0110
4 0100 0111
5 0101 1000
6 0110 1001
7 0111 1010
8 1000 1011

9 1001 1100

In general, EXCESS- 3- CODE number is 3 greater than the BCD equivalent.

BINARY CODED DECIMAL REPRESENTATION


In most of the electronic circuit elements used to construct digital computers are inherently
binary in operation, the binary number system is the most natural number system for a computer.
Also computers constructed with the binary number system require a smaller amount of circuitry
and so are more efficient than machines operating in other number systems. However, the decimal
systems has been used for a long time, and there is a natural reaction to performing calculations in
a binary number system. Also, since cheque, bills, tax rates, prices etc., are all figures in the
decimal system, the values of the most things may be converted from the decimal to the binary
before computation can begin. For these reasons, most of the early machines operated in binary
coded decimal number systems. In such systems a coded group of binary bits is used to represent
each of the 10 decimal digits. For instance, an obvious and natural code is simple weighted binary
code.

- 11 -
Binary code Decimal

0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9

This is known as Binary – coded decimal 8,4,2,1 code or simply BCD. 4 digits are required for each
decimal digit, and each bit is assigned a weight. This is a very useful code and has been much
used. One difficulty with the code, however lies in forming the complements of numbers in this
system. It is common practice to perform subtraction in the computer by adding the complement of
the subtrahend.

Binary Addition
Binary addition is performed in the same manner as decimal addition. The complete table
for binary addition is

0+0= 0
0+1= 1
1+0= 1
1+1= 0 plus a carry of 1

Example:

101101 11100 1010111


+110101 +11010 +0011011
1100010 110110 1110010

Binary Subtraction
When 1 is subtracted from 0. The remainder is 1, but it is necessary to borrow. The binary
subtraction table is
0-0= 0
1-0= 1
1-1= 0
0-1= 1 with a borrow of 1

- 12 -
Example:
111 1101 11001 1111 11011
-101 -1010 -1110 -1011 -101
------ -------- --------- ------- ---------
010 0011 1011 100 10110
------ -------- --------- -------- ----------

Binary Multiplication
Each digit is separately multiplied and then the values are added
The binary multiplication table is

0*0= 0
1*0= 0
0*1= 0
1*1= 1

Example:

1) 1100
2) 1100110
X1100 X1000
--------------- ------------------
ans 1100110000
0000 ------------------
1100
0000
1100
--------------
ans 1111000
--------------

Binary Divisions:
In the decimal system division by zero is meaningless. The complete table is
0/1= 0
1/1= 1

Example:
100
1011 101100
1011
------------
000
------------
101100 / 1011 = 100

1’s Complement Of A Binary Numbers:


This is determined by replacing its 1’s by 0’s and 0’s by 1’s

- 13 -
Example:
The 1’s complement of 1010 is 0101
The 1’s complement of 111001 is 000110
The 1’s complement of 1110 is 0001

2’’s Complement Of A Binary Number:


2’s complement of a binary number is obtained by adding 1 to the least significant digit of
1’s complement of that number

2’s complement of a number = 1’s complement of the number +1

Example:
Number : (1010)2

1’s complement is 0101


+1
-------
2’s complement is 0110

REVIEW QUESTIONS

a. What is meant by Binary numbers?


b. Why Binary Numbers are used?
c. What is a bit?
d. Define Data.
e. Define Number System.
f. Define Hardware and Software.
g. Define Base or Radix.
h. Define Binary Coded Decimal.
i. Define Octal Numbers.
j. Define Hexadecimal Numbers.
k. Define Binary Coded Decimal.
l. Define ASCII Code.
m. Define 1’s Complement.
n. Define 2’s Complement.
o. Define Positional Notations and weights.
p. Give the ASCII code for each of these i)7 ii) f iii) W iv) y.

Homework
1.Convert Binary to Decimal Numbers.
001,11101, 0100111, 100.10, 111.10101, 0.001101, 10110.011, 1.011.
2.Convert decimal numbers to equivalent binary numbers.
43, 64, 4096, 0.375, 27/32, 0.4375, 512.5, 131.5625, 2048.0645

- 14 -
3. Perform the addition and check by converting the binary numbers to decimal.
a) 1001.1+1011.01
b) 100101+100101
b) 0.1011+0.1101
c) 1011.01+1001.11
d) 1011+11101
e) 11111.1+10010.1
f) 101.1+111.
4. Perform the subtraction and check in binary and check by converting the number into decimal.
a) 1101-1000
b) 1101-1001
c) 1011.1-101.1
d) 1101.01-1011.1
e) 111.11-101.1
f) 1101.1-1010.01
5. Perform then subtraction in the binary number system
a) 64-32
b) 127-63
c) 93.5-42.75
d) 84 9/32 – 48 5/16
e) 128-32
f) 1/8 - 1/16
g) 31- 5/8
h) 62-31 1/16
i) 129-35
j) 94.5-43.75
6. Perform the Following multiplications and divisions in the binary system
a) 16*8, b) 31* 14, c) 23 * 356.32, d) 15*8.625, e) 24*12, f) 31* 14, g) 49.5 * 51.75, h) 6/2, I)
16/8, j) 27/18, k) 32/8, l) 58.75/23.5, m) 31.5/15.75, n) 3/ 5/8, 2 5/8/ 15/8, O, m) 256 ½ / 128 ¼

7. Convert the following binary numbers to 1’s Complement and 2’s Complement.
1011,1101,1010,1111,1110,1011, 11010,0.0111,0.101,11.101,101.011,
10111.10,10111.110
8. Perform the following subtractions of binary numbers, using both 1’s and 2’s Complements:
1010 – 1011 , 110 –10 , 110 – 0.1111 , 0.111 – 0.1001 , 0.1111 – 0.101 , 11.11 – 10.111.
9. Convert the following hexadecimal numbers to decimal numbers
1. 15
2. B8
3. AB4
4. 9.B
5. 9.1A
6. B6C7
7. ]64AC

- 15 -
8. A492
9. D2763.
10. Convert the following octal numbers to decimal:
1. 15
2. 125
3. 115
4. 124
5. 156
6. 15.6
7. 2376
8. 4567
9. 24563
10. 324533
11. Convert the Binary numbers to octal:
110, 1111101, 111.1111, 0.11111, 10.11, 11111.101101, 1011101, 011.10101

- 16 -
CHAPTER TWO
BASIC LOGIC GATES

Objectives
Upon completion of this chapter, you should be able to:
• Describe the operation and use of AND gates and OR gates.
• Construct truth tables for two, three, and four-input AND and OR gates.
• Draw timing diagrams for AND and OR gates.
• Sketch the external connection to integrated circuit chips to implement AND and OR logic
circuits.

Introduction
Logic gates are the basic building blocks for forming digital electronic circuitry. A logic
gates has one output terminal and one or more input terminals. Its output will be HIGH (1) or LOW
(0) depending on the digital level(s)at the input terminal(s). Through the use of logic gates, we can
design digital systems that will evaluate digital input levels and produce a specific the output
response based on particular logic circuit design. The seven logic gates are AND, OR, NAND,
NOR, INVERTER, exclusive-OR, and exclusive-NOR. The AND and OR are discussed in this
chapter.

The AND Gate


Let’s start by lookng at the two-input AND gate shown in figure 2-1. The operation of the
AND gate is simple and is defined as follows. The output F is HIGH if input A and input B are both
HIGH. In other words, if A = 1 and B = 1, then F = 1. If ether A or B both are LOW, the output wil be
LOW.

A
B F

Figure 2-1 Two input AND gate


The best way to illustrate how the output level of a gate respond to all the possible input-
level combinations is with a truth table. Table 2-1 is a truth table for a two-input AND gate. On the
left side of the truth table, all possibleinput-level combinations are listed, and on the right side the
resultant output is listed.
Table 2-1 Truth table for a two-input AND gate
Inputs Output
A B F
0 0 0
0 1 0
1 0 0
1 1 1 Figure 2-2 Electrical analog for an AND gate

- 17 -
From the truth table we can see that the output F is HIGH only when both and B are
HIGH. Another way gto illustrate the operation of an AND gate is by use of a series electric circuit.
In Figure 2-2, using manual switches, the lamp is ON if both switches A and B are HIGH (1).
Boolean equation for the AND function, X = A and B, which can we thought of as X equals 1 if A
and B both equal 1.
Number of combinations =2 N where N = number of inputs
Therefore, in in the case of of a four-input AND gate, the number of possible input comb ination is
2 4 = 16 .

The OR Gate
The OR gate also has two or more inputs and single output. The symbol for a two-input
OR gate is shown in figure 2-3. The operation of the two-input OR gate is defined as follows: the
output at F will be HIGH whenever input A OR input B is HIGH or both are HIGH. As the boolean
equation, this can we written F = A+B. Notice the use of the + symbol to represent the OR function.

A
F

Figure 2-3 Two input OR gate

The truth table for a two-input OR gate is shown in Table 2-2.

Table 2-2 Truth table for a two-input OR gate


Inputs Output
A B F
0 0 0
0 1 1
1 0 1
1 1 1
Figure 2-4 Electrical analog for an OR gate

From the truth table you can see that F is 1 whenever A OR B is 1 or if both A and B are 1.
Using manual switches in electrical circuit, as shown in figure 2-4, we can observe the electrical
analogy to an OR gate. From the figure we see that the output at X will be 1 if A or B, or both, are
HIGH (1).

REVIEW QUESTIONS
1. Describe in words the operation of an OR gate and AND gate.
2. Write the boolean equation for:
a) A three-input AND gate
b) A four-input AND gate
c) A three-input OR gate
3. Build the truth table for a three-input AND gate and four-input OR gate.

- 18 -
CHAPTER THREE
INVERTING LOGIC GATES

Objectives
Upon completion of this chapter, you should be able to:
• Describe the operation and use of inverter, NAND, and NOR gates.
• Construct truth tables for two, three, and four-input NAND and NOR gates.
• Draw timing diagrams for inverter, NAND and NOR gates.
• Develop a comparison of the Boolean equation and truth tables for the five basic gates.

Introduction
Inverting logic gates are used like the basic ND and OR gated, except the inverting gates
have complemented (inverted) outputs. Basically, there are three inverting logic gates: the inverter,
the NAND (NOT-AND), and the NOR (NOT-OR). These gates are explained in this chapter and
later combined with AND and OR gate to form the combinational lgic used to provide the functional
operations of complete digital systems.

The Inverter
The inverter is used to complement, or invert, a digital signal. It has a single input and a
single output. If the HIGH level (1) comes in, it produces a LOW-level (0) output. If the LOW level
(0) comes in, it produces a HIGH-level (1) output. The symbol and truth table for the inverter gate
are shown in figure 3-1.
The boolean equation for an inverter is written F = A (F = NOT A) . The bar over the A
is an inversion bar, used to signify the complement. The inverter is sometimes referred to as the
NOT gate.

A F

Input (A) Output (F)


0 1
1 0

Figure 3-1 Inverter symbol and truth table

The NAND Gate


The operation of the NAND gate is the same as the AND gate except that its output is
inverted. You can think of the NAND gate as an AND gate with an inverter at its output. The symbol
for a NAND gate is made from an AND gate with a small circle (bubble) at its output, as shown in
figure 3-2.

- 19 -
A
F

Figure 3-2 Symbol for a NAND gate

In digital circuit diagrams, you will find the small circle used whenever complementary
action (inversion) is to be indicated. The circle at the output acts just like an inverter, so a NAND
gate can be drawn symbolically as an AND gate with an inverter conected to its output.
The boolean equation for the NAND gate is written X = AB . The inversion bar is drawn
over (A and B), meaning that the output of the NAND is the complement of (A and B). Because we
are inverting the output, the truth table outputs in table 3-1 will be the complment of the AND gate
truth table outputs. The easy way to construct the truth table is to think of how an AND gate would
respond to the inputs and then invert your answer. From the table 3-1 we can see that the output is
LOW when both inputs A and B are HIGH (just the opposite of an AND gate). Also, the output is
HIGH whenever either input is LOW.

Table 3-1 Two input NAND gate truth table

The NOR Gate


The operation of the NOR gate is the same as that of the OR gate except that its output is
inverted. You can think of a NOR gate as an OR gate, with the an inverter at its output. The symbol
for a NOR gate and its equivalent OR-INVERT symbol are shown in figure 3-3.

A
F
B

Figure 3-3 NOR gate symbol and its OR-INVERT equivalent with A = 0, B = 0

The boolean equation for the NOR function is X = A + B . The equation is stated
" X equals not ( A or B)" . In other words, X is LOW if A or B is HIGH. The truth table for a NOR
gate is given in table 3-2 below. Notice that the output column is the complement of the OR gate
truth table output column.

- 20 -
REVIEW QUESTIONS
1. What is the purpose of an inverter in a digital circuit?
2. How does a NAND gate differ from an AND gate?
3. Write the boolean equation for a three-input NOR gate
4. The output of a two-input NAND gate is ------------- (HIGH, LOW) if A = 1, B = 0
5. The output of a two-input NOR gate is ------------- (HIGH, LOW) if A = 0, B = 1

- 21 -
CHAPTER FOUR
EXCLUSIVE-OR AND EXCLUSIVE-NOR GATE

Objectives
Upon completion of this chapter, you should be able to:
• Describe the operation and use of exclusive-OR and exclusive-NOR gates.
• Construct truth tables for exclusive-OR and exclusive-NOR gates.
• Develop a comparison of the Boolean equation and truth tables for the exclusive-OR and
exclusive-NOR gates.

Introduction
We have see in the previous chapters that using various combinations of the basic gates
we can form almost any logic function that we need. Often a particular combination of logic gates
provides a function that is especially useful for a wide variety of tasks. In this chapter we learn
about and design systems uing two new combinational logic gates: the exclusive-OR and the
exclusive-NOR gates.

The Exclusive-OR Gate


Remember, the OR gate provides a HIGH output if one input or the other input is HIGH or
if both inputs are HIGH. The exclusive-OR, on the other hand, provides a HIGH output if one input
or the other input is HIGH, but not both. This point is made more clear by comparing the truth table
for an OR gate versus an exclusive-OR gate, as shown in table 4-1 below.

Table 4-1 Truth table for an OR gate versus an exclusive-OR gate


Inputs Output
A B F
0 0 0
0 1 1
1 0 1
1 1 1

A
F

Figure 4-1 Logic circuit for providing the exclusive-OR function

- 22 -
The Exclusive-NOR Gate
The exclusive-NOR is the complement of the exclusive-OR. A comparison of the truth
tables in table 4-2 illustrates this point.

Table 4-1 Truth table of the exclusive-NOR versus the exclusive-OR gate

The truth table for the Ex-NOR gate shows a HIGH output for both inputs LOW or both
inputs HIGH. The Ex-NOR is sometimes called the equality gate because both inputs must be
equal to get a HIGH output. The basic logic circuit and symbol for the Ex-NOR are shown in figure
4-2 below.

A
F

Figure 4-2 Logic circuit for providing the exclusive-NOR function

REVIEW QUESTIONS
1. Describe in words the difference between an exclusive-OR and an OR gate.
2. Describe in words the difference between an exclusive-NOR and an AND gate.

- 23 -
CHAPTER FIVE
BOOLEAN ALGEBRA AND REDUCTION TECHNIQUES
Objectives
Upon completion of this chapter, you should be able to:
• Write booean equations for combinational logic applications.
• Utilize bolean algebra laws and rules for simplifying combinational logic circuits.
• Apply De Morgan’s theorem to complex boolean equations to arrive at simplified
equivalent equations.
• Design single-gate logic circuits by utilizing the universal capability of NAND and NOR
gates.

Introduction

In the previous section we looked at the eight logical operations: AND, OR, NOT,
XCLUSIVE-OR, NAND, NOR, if-then and if-and-only-if. In this section we shall look at the algebra
of these operations. Recall, from the last section a logical expression is a combination of logical
variables and logical operators
For example, (p + q)(pq)' and pq' + p'q are logical expressions. Often we use a capital
letter, e.g. P or Q, to denote a logical expression. For example, we might write P = (p + q)(pq)' or
Q = pq' + p'q. In the following we shall just say expression for logical expression if there is no
danger of confusion with other types of expressions such as arithmetic expressions or mixed
arithmetic or logical expressions.
Expressions are equivalent if they give the same result for every possible combination of
logical values for the logical variables appearing in them.
This occurs precisely if they have the same truth table. We write P = Q if P and Q are equivalent.
In the previous section we showed that (p + q)(pq)' = pq' + p'q.
Boolean algebra is the algebra of these equivalences. An equivalence is also called an identity.
Some of the equivalences that we showed in the previous section were the following.
(1) p nand q = (pq)' = p' + q'

(2) p nor q = (p + q)' = p'q'

(3) p  q = (p → q)(q → p) = (p  q)'

The right equivalences in (1) and (2) are called the De Morgan laws. Here is a list of some
useful identities in Boolean algebra. The De Morgan identities on the right of (1) and (2) are
included as formulas (7) in this list.

(4) pq = qp p+q = q+p commutative laws

(5) p(qr) = (pq)r p + (q + r) = (p + q) + r associative laws

(6) p(q + r) = pq + pr p + (qr) = (p + q)(p + r) distributive laws

- 24 -
(7) (pq)' = p' + q' (p + q)' = p'q' DeMorgan’s laws

(8) p1 = p p+0 = p identity laws

(9) p0 = 0 p+1 = 1 domination laws

(10) pp = p p+p = p idempotent laws

(11) pp' = 0 p + p' = 1 negation laws

(12) (p')' = p double negation law (or involution law)

One of the main reasons we are interested in equivalences is because they give us
alternative ways to design logic circuits.

p
Example 1. Consider the circuit at the right whose r = q + p'q'

output is r = q + p'q'.
q

If we use the second distributive law in (7) and (11) and (8) we have

r = q + p'q' = (q + p')(q + q') = (q + p')(1) = q + p'

p
So a simpler circuit to produce r is the one at the right. r = q + p'

p
Example 2. Consider the circuit at the right r = q + p'q
whose output is r = q + p'q.
q

If we use the first distributive law in (7) and (8) and (9) we have
r = q + p'q = (1)(q) + p'q = (1+ p')q = (1)(q) = q
So a simpler circuit to produce r would be q ⎯⎯→ r = q.
For more applications of Boolean algebra to logic design, see Fundamentals of Logic
Design by Charles H. Roth, Jr. and published by Thomson.
Some of the equivalences in the list (4) – (12) follow directly from the definition. Consider pq = qp.
The left side pq is 1 only if both p and q are 1. The right side qp is 1 only if both q and p are 1.
However both p and q are 1 precisely if both q and p are 1. So pq and qp are 1 under the same
circumstances. So pq = qp.
The equivalences that are less obvious can be shown to be true using truth tables.

Example 3. Show the first distributive law is valid using a truth table.
p q r q+r p(q + r) pq pr pq + pr
0 0 0 0 0 0 0 0
At the right is the truth table. 0 0 1 1 0 0 0 0
0 1 0 1 0 0 0 0
Note that both p(q + r) and 0 1 1 1 0 0 0 0
1 0 0 0 0 0 0 0
pq + pr are true precisely in 1 0 1 1 1 0 1 1
1 1 0 1 1 1 0 1
1 1 1 1 1 1 1 1

- 25 -
the last three rows, i.e. in the following three cases.
p = 1, q = 0, r = 1
p = 1, q = 1, r = 0
p = 1, q = 1, r = 1
The equivalences (4) – (11) are examples of dual pairs of equivalences. Every logical
expression has a dual expression that is obtained by interchanging and and or and 0 and 1. For
example, the dual of the expression p(q + r) is p + qr. One way to get the dual of an expression is
to do the following three steps.
1) complement the expression
2) Use the De Morgan laws
3) Replace each variable by its complement
For example, if we do that with p(q + r) we get the following.

complement 1st DeMorgan


p(q + r) → (p(q + r))' → p' + (q + r)'

2st DeMorgan Complement vars


→ p' + q'r' → p + qr

If two expressions are equivalent then the duals of the two expressions are equivalent. So
in each of the equivalence (4) – (11) the right equivalence follows from the left and vice-versa.

Example 4. Go through this argument to prove the commutative law for "or" from the commutative
law for "and".
We start with the commutative law for and, i.e. pq = qp. Next we not both sides giving (pq)'
= (qp)'. Next we use the first DeMorgan law giving p' + q' = q' + p'. Since this holds for all p and q
we can replace p by p' and q by q', giving p'' + q'' = q'' + p''. Finally we use (12) which gives p + q
= q + p.
In this argument we used some properties of equivalences that we usually use without taking note
that we are actually using them. Here are three useful properties of equivalences.

First, suppose P = Q and P and Q contain the logical variable p and R is another expression. If we
replace all occurrences of p in P and Q by R the resulting expressions are equivalent. In symbols

(13) if P = Q then P//p→R = Q//p→R

Here P//p→R denotes the expression obtained by replacing all occurrences of p in P by R and
similarly for Q//p→R. We used (13) to go from p' + q' = q' + p' to p'' + q'' = q'' + p''.

Second, suppose P = Q and R is another expression containing P within it. If we replace some
occurrences of P in R by Q then the resulting expression is equivalent. In symbols

(14) if P = Q then R/P→Q = R

- 26 -
Here R/P→Q denotes the expression obtained by replacing some, but not necessarily all,
occurrences of P in R by Q. We used (14) to go from p'' + q'' = q'' + p'' to p + q = q + p.

Third, two expressions equivalent to the same expression are equivalent. In symbols

(15) if P = Q and Q = R then P = R

The commutative and associative laws are similar in structure to the commutative and
associative laws in regular algebra. So is the first of the two distributive laws in (6), i.e. p(q + r) =
pq + pr. However, the second, p + (qr) = (p + q)(p + r), is not true in regular algebra. This is one
thing that distinguishes Boolean algebra from regular algebra. The reason p + (qr) = (p + q)(p + r)
is called a distributive law is because it is obtained from the first distributive law p(q + r) = pq + pr
by interchanging + and ..

Problem 1. Make a truth table showing the second distributive law is valid. Show that both sides
are true in the last five rows if the first three columns are the same as the above truth table.
Let’s look at some examples of the two distributive laws.

Example 1. Suppose
p = “the Pistons win”
q = “the Lions win”
r = “the Red Wings win”
Then the statement

(16) The Pistons win and either the Lions win or the Red Wings win
has the form p(q + r). The distributive law p(q + r) = pq + pr says that (16) is equivalent to

(17) Either both the Pistons and Lions win or both the Pistons and Red Wings win
Both statements are valid in the following three situations.

The pistons win, the Lions lose, the Red Wings win
The pistons win, the Lions win, the Red Wings lose
The pistons win, the Lions win, the Red Wings win

- 27 -
Example 2. On a certain river there are two sets of rapids. To go past the first set of rapids boats
must go through lock A. For the second set of rapids boats can choose between lock B and lock
C.

lock B

boat rapids #1 rapids #2

lock A lock C

To get by both sets of rapids boats must go through lock A and either lock B or lock C. So to get
by both sets of rapids the following statement must be true.

(18) Lock A is working and either lock B is working or lock C is working.


If we let
p = "Lock A is working"
q = "Lock B is working"
r = "Lock C is working"

then (18) has the form p(q + r). By the first distributive law this is equivalent to pq + pr. Thus an
alternative condition for a boat to get by both sets of is the following statement be true.

Either both locks A and B are working or both locks A and C are working.

The algebra of exclusive-or. In many cases and, or and not are regarded as the most basic of
the logical operations and expressions involving the other operations are reduced to expressions
involving and, or and not. In which case the identities (4) – (12) play an important role. However,
in some cases it is convenient to work with exclusive or. In that case the following identities
involving exclusive or are useful. Some of these are similar to regular or while others are different.

(19) pq = qp commutative

(20) p  (q  r) = (p  q)  r associative

(21) p(q  r) = pq  pr distributive

(22) p0 = p zero is an identity

(23) pp = 0 p is its own inverse

(24) p  1 = p' exclusive or'ing with 1 inverts

(25) p  p' = 1

- 28 -
(19), and (22) – (25) can be proved using the definition of exclusive or. For example, the
commutative property is true since p  q is 1 if exactly one of p and q is 1 and the same is true for
q  p. Similarly, p  0 is 1 if exactly one of p and 0 is 1, i.e. if p is 1.

The associative and distributive properties can be shown to be true either using truth tables or by
expressing exclusive or in terms of and, or and not using p  q = pq' + p'q and using (4) – (12).

Example 3. Prove that exclusive or satisfies the associative law.

Solution. Here is a truth table for p  (q  r).

p q r qr p  (q  r)
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 0 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 0 1

We can see that

(26) p  (q  r) = 1 precisely if an odd number of p, q and r are 1

Now consider (p  q)  r. Using the commutative property for exclusive or, one has (p  q)  r =
r  (p  q). The right side has the form p  (q  r) but p, q and r are replace by r, p and q
respectively. From (26) it follows that r  (p  q) is 1 if an odd number of r, p and q are 1.
However, this occurs if an odd number of p, q and r are 1. So p  (q  r) and (p  q)  r are
both 1 if an odd number of p, q and r are 1. So they are equivalent.

Remark 1. Because exclusive or satisfies the associative law we usually don't use parentheses if
we are exclusive or'ing more than two things. For example, we write p  q  r for both p  (q 
r) and (p  q)  r.

Remark 2. (26) can be generalized to the following

(27) p1  p2  …  pn = 1 precisely if an odd number of p1, p2, …, pn are 1

Let's show that this holds for n = 4. The proof of the general case is the same. Consider p  q 
r  s. We want to show that

(28) p  q  r  s = 1 precisely if p  q  r  s has an odd number of 1's

- 29 -
There are four cases. The first case is when p  q  r has an even number of 1's and s = 0.
Then p  q  r = 0 and p  q  r  s = 0 and p  q  r  s has an even number of 1's. So (28)
is true in the first case.

The second case is when p  q  r has an even number of 1's and s = 1. Then p  q  r = 0
and p  q  r  s = 1 and p  q  r  s has an odd number of 1's. So (28) is true in the second
case.

The third case is when p  q  r has an odd number of 1's and s = 0. Then p  q  r = 1 and
p  q  r  s = 1 and p  q  r  s has an odd number of 1's. So (28) is true in the third case.

The last case is when p  q  r has an odd number of 1's and s = 1. Then p  q  r = 1 and
p  q  r  s = 0 and p  q  r  s has an even number of 1's. So (28) is true in this case.

Example 4. Prove that exclusive or satisfies the distributive law (21).

Solution. We could do this with a truth table. However, let's do by expressing exclusive or in
terms of and, or and not and using properties (4) – (12). In section (1.2) we showed that p  q =
pq' + p'q. Using this one has

p(q  r) = p(qr' + q'r) = pqr' + pq'r


and
pq  pr = pq(pr)' + (pq)'pr

Using DeMorgan, some of the other properties (4) – (12) one has

pq(pr)' + (pq)'pr = pq(p' + r') + (p' + q')pr


= pqp' + pqr' + p'pr + q'pr
= pp'q + pqr' + pp'r + pq'r
= 0q + pqr' + 0r + pq'r
= 0 + pqr' + 0 + pq'r
= pqr' + pq'r

So p(q  r) and pq  pr are equivalent to the same thing and hence are equivalent.

REVIEW QUESTIONS
1. How many gates are required to implementation the following boolean equations?
a) X = ( A + B)C
b) Y = AC + BC
c) Z = ( ABC + CD) E

- 30 -
2. Simplify the equation and draw the logic circuit of the simplified equation.
a)

b)

- 31 -
CHAPTER SIX
LOGIC MINIMISATION USING KARNAUGH MAPPING

Objectives
Upon completion of this chapter, you should be able to:
• Utilize the karnaugh mapping procedure to systematically rwduce complex boolean
equations to their simplest form.
• Describe the steps involved in solving a complete system design application.

Introduction
When a logic circuit is represented as a truth table, the behaviour of the circuit can be
described in algebraic terms using a Boolean equation. It is often then desirable to minimise the
number of terms used to describe the output, i.e simplify the Boolean equation of the circuit. By
doing this the complexity of the resultant underlying digital circuit is obviously decreased. This in
turn leads to simpler and cheaper design. We have already seen a simple example where the laws
of Boolean algebra can be used to do this, and this is generally the case in any situation.
Simplification will always occur when we can use the distributive law to create terms of the form,
e.g, AB (C + C’), which simplifies to AB. Repeatdly doing this as often as possible leads to
progressive circuit simplification. However, the process is quite tedious, even for relatively simple
expressions. The diagrammatic method of Karnaugh maps effectively provides a systematic
approach for effectively achieving the same minimisation process in a few simple steps.

Minterm Notation
Before going on to study Karnaugh maps, let us consider a short-hand notation for
Boolean expressions, which we have already seen are most often expressed in sum-of-products
(AND-OR) form. A short-hand form of the AND-OR representation is known as minterm
notation.
Expressions in standard SOP form can also be written in minterm expansion notation. For
example given the Standard SOP expression below, with the variables A,B,C,D :
X = A BC D + A BC D + A B C D + A B C D + AB C D + AB C D + A BCD + A B CD + A BC D + A B C D + ABC D

0110 0100 0010 0000 1010 1000 0101 0001 0111 0011 1111

we can also write :

f ( A, B, C, D) = m0 + m1 + m2 + m3 + m4 + m5 + m6 + m7 + m8 + m10 + m15

which can be further abbreviated to :


f ( A, B, C, D) =  m(0,1,2,3,4,5,6,7,8,10,15)
domain minterms  Standard SOP terms
This is referred to as the minterm expansion.

- 32 -
Don’t Care terms – Incompletely Specified functions
Sometimes when a digital circuit is specified some input combinations are not required or
cannot occur. This means that out of the total number of combinations available as inputs not all
are used. An example is an input that can go from 0 to 9. This requires 4 bits/variables to represent
all 10 combinations but totally 16 are possible. Hence 6 are unused. If the output is X then we say
that the function X is incompletely specified. The remaining 6 unused terms are referred to as
Don’t Care terms, and are represented by an X in a truth table. If we decide that we desire an
output of 1 when a 1,3,5,7 is detected and 0 otherwise then we can write down the behaviour of the
circuit as:

Truth Table

Inputs Output
ABCD X
0000 0
0001 1
0010 0
0011 1
0100 0
0101 1
0110 0
0111 1
1000 0
1001 0
1010 X
1011 X
1100 X
1101 X
1110 X
1111 X

Minterm Expansion
f ( A, B, C, D) =  m(1,3,5,7) +  d (10,11,12,13,14,15)

Karnaugh Maps
A Karnaugh map is similar to a truth table in that it presents all of the possible values of the
input variables and the resultant output for each value. Karnaugh maps are organised into cells.
The map is arranged so that each cell is only one bit different from any adjacent cell, hence gray
scale axes are used. This also allows the cells in the Karnaugh map to wrap around. This will be
made clear with several examples. The number of cells required for each Karnaugh map is equal
to the total number of combinations possible for the given number of input variables, i.e. 2n where n
is the number of input variables. This is often referred to as the level of the Karnaugh map. For
example a 4-level Karnaugh map will have 24 = 16 cells. Karnaugh maps are only used from 2 to 6
levels, but we will consider only 2, 3 and 4 variable maps here. Each level of Karnaugh map will be
looked at in turn to illustrate how they are used, but before that an overview of how each level of

- 33 -
Karnaugh map is drawn will be given. The minterm expansion numbers are placed in the
appropriate cells, hence if a minterm expansion for the expression is given populating the
Karnaugh map is simple.

EXAMPLE : Simplify the following equation using a K-map (Karnaugh-map):

X = A BC D + A BC D + A B C D + A B C D + AB C D + AB C D + A BCD + A B CD + A BC D + A B C D + ABC D
m6 m4 m2 m0 m10 m8 m5 m1 m7 m3 m15

SOLUTION : Draw the K-map and minimise.

CD C
AB 00 01 11 10
0 1 3 2
00 1 1 1 1
4 5 7 6
01 1 1 1 1
1 1 1 1 B
11 02 03 15 04
A 8 9 1 1
10 1 0 01 10
D

X = B D + A + BC D
The equation is determined by looking at each region on the K-map and deciding which
part the group belongs to. For example, looking at the red highlighted group we see that it is inside
the B region (the yellow, orange and red areas on the diagram below), but the group is not big
enough to fill the entire B region so we look to see where else it lies. If we look again we see that it
also lies in the C region (the orange and red part of the B region), but not in all of the C region that
occurs inside the B region. Looking again we see that as well as lying in the B region and the C
region it also lies in the D region (the red part of the B region). A has no effect as it lies in both A
and A .

CD C
AB 00 01 11 10
00 0 1 3 2
01 4 5 7 6
B
11 12 13 15 14
A
10 8 9 11 10

The remaining terms are similarly determined. One thing of importance to note is that (as was
mentioned earlier) the groups can wrap around the Karnaugh map because every cell is adjacent

- 34 -
to the next, including at the edges. If we look at the four SOP terms that make up the blue region
( B D ) we find that they are adjacent. The following table shows this.

0000
0010
1010
1000

The red bits show which of the bits change, the grey bits show B and D .
The technique of looking for the appropriate regions on the Karnaugh map can also be applied to
populating it as the next example shows.

REVIEW QUESTIONS
1. Simplify the folwing SOP equation using the karnaugh mapping technique:
X = AB + ABC + ABC + ABC
2. Simplify the folwing SOP equation using the karnaugh mapping procedure
X = ABCD + ABCD + ABCD + ABC + ABCD + ABC D + ABCD

- 35 -

You might also like