Docsity

Digital Logic and Design: Binary Codes and Digital Logic Gates - Prof. Sohail, Study notes of Digital Electronics

Toggle sidebar
bg1
PREFACE
1
BINARY
SYSTEMS
1-1
1-2
1-3
1-4
1-5
1-6
1-7
1-8
1-9
Digital Computers and Digital Systems
Binary Numbers 4
Number Base Conversions 6
Octal and Hexadecimal Numbers 9
Complements 10
Signed Binary Numbers
14
Binary Codes
17
Binary Storage and Registers 25
Binary Logic 28
References 32
Problems
33
1
2
BOOLEAN
ALGEBRA
AND
LOGIC
GATES
2-1
2-2
2-3
Basic Definitions 36
Axiomatic Definition
of
Boolean Algebra
38
Basic Theorems and Properties
of
Boolean Algebra
ix
1
36
41
III
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Digital Logic and Design: Binary Codes and Digital Logic Gates - Prof. Sohail and more Study notes Digital Electronics in PDF only on Docsity!

PREFACE

1 BINARY SYSTEMS

Digital Computers and Digital Systems Binary Numbers 4 Number Base Conversions 6 Octal and Hexadecimal Numbers 9 Complements 10 Signed Binary Numbers 14 Binary Codes 17 Binary Storage and Registers 25 Binary Logic 28 References 32 Problems 33

2 BOOLEAN ALGEBRA AND LOGIC GATES

Basic Definitions 36

Axiomatic Definition of Boolean Algebra 38 Basic Theorems and Properties of Boolean Algebra

ix

1

36

III

iv Contents

Problems III

vi Contents

7-3 Shift Registers 264 7-4 Ripple Counters 272 7- 7- 7- 7- 7-

Synchronous Counters 277 Timing Sequences 285 Random-Access Memory (RAM) Memory Decoding 293 Error-Correcting Codes

References 302

Problems 303

8 ALGORITHMIC STATE MACHINES IASMI

8-1 Introduction 307

8-2 ASM Chart 309

8-3 Timing Considerations^312 8-4 Control Implementation 317 8-5 Design with Multiplexers 323

8-6 PLA Control 330

References 336 Problems 337

9 ASYNCHRONOUS SEQUENTIAL LOGIC

9-1 Introduction 341 9-2 Analysis^ Procedure^343 9-3 Circuits with Latches 352 9-4 Design Procedure 359 9-5 Reduction of State and Flow Tables 9-6 Race-Free State Assignment 374 9-7 Hazards 379 9-8 Design Example 385 References 391 Problems 392

10 DIGITAL INTEGRATED CIRCUITS

10-1 Introduction 399 10-2 Special Characteristics 401 10- 10- 10- 10- 10- 10-

Bipolar-Transistor Characteristics 406 RTL and DTL Circuits 409 Transistor-Transistor Logic (TTL) Emmitter-Coupled Logic (ECL) Metal-Oxide Semiconductor (MOS)

Complementary MOS (CMOS) 427 10-9 CMOS Transmission Gate Circuits 430 References 433 Problems 434

11 LABORATORY EXPERIMENTS

11-0 Introduction to Experiments 436 11- 11- 11- 11-

Binary and Decimal Numbers 441 Digital Logic Gates 444 Simplification of Boolean Functions Combinational Circuits 447 11-5 Code Converters 449 11-6 Design with Multiplexers 451 11-7 Adders and Subtractors 452 11-8 Flip-Flops 455 11-9 Sequential Circuits 458 11-10 Counters 459 11-11 Shift Registers 461 11-12 Serial Addition 464 11-13 Memory Unit 465 11-14 Lamp Handball 467 11-15 Clock-Pulse Generator 471 11-16 Parallel Adder 473 11- 11-

Binary Multiplier 475 Asynchronous Sequential Circuits

Contents vii

399

436

)

Digital Design is concerned with the design of digital electronic circuits. The subject is also known by other names such as logic design, digital logic, switching circuits, and digital systems. Digital circuits are employed in the design of systems such as digital computers, control systems, data communications, and many other applications that re- quire electronic digital hardware. This book presents the basic tools for the design of digital circuits and provides methods and procedures suitable for a variety of digital de- sign applications. Many features of the second edition remain the same as those of the first edition. The material is still organized in the same manner. The first five chapters cover combi- national circuits. The next three chapters deal with synchronous clocked sequential cir- cuits. Asynchronous sequential circuits are introduced next. The last three chapters deal with various aspects of commercially available integrated circuits. The second edition, however, offers several improvements over the first edition. Many sections have been rewritten to clarify the presentation. Chapters I through 7 and Chapter 10 have been revised by adding new up-to-date material and deleting ob- solete subjects. New problems have been formulated for the first seven chapters. These replace the problem set from the first edition. Three new experiments have been added in Chapter II. Chapter 12, a new chapter, presents the IEEE standard graphic symbols for logic elements. The following is a brief description of the subjects that are covered in each chapter with an emphasis on the revisions that were made in the second edition.

Ix

\

f

X Preface

Chapter 1 presents the various binary systems suitable for representing information in digital systems. The binary number system is explained and binary codes are illus- trated. A new section has been added on signed binary numbers. Chapter 2 introduces the basic postulates of Boolean algebra and shows the correla- tion between Boolean expressions and their corresponding logic diagrams. All possible logic operations for two variables are investigated and from that, the most useful logic gates used in the design of digital systems are determined. The characteristics of inte- grated circuit gates are mentioned in this chapter but a more detailed analysis of the electronic circuits of the gates is done in Chapter 11. Chapter 3 covers the map and tabulation methods for simplifying Boolean expres- sions. The map method is also used to simplify digital circuits constructed with AND- OR, NAND, or NOR gates. All other possible two-level gate circuits are considered and their method of implementation is summarized in tabular form for easy reference. Chapter 4 outlines the formal procedures for the analysis and design of combina- tional circuits. Some basic components used in the design of digital systems, such as adders and code converters, are introduced as design examples. The sections on multi- level NAND and NOR implementation have been revised to show a simpler procedure for converting AND-OR diagrams to NAND or NOR diagrams. Chapter 5 presents various medium scale integration (MS!) circuits and pro- grammable logic device (PLD) components. Frequently used digital logic functions such as parallel adders and sub tractors, decoders, encoders, and multiplexers, are ex- plained, and their use in the design of combinational circuits is illustrated with exam- ples. In addition to the programmable read only memory (PROM) and programmable logic array (PLA) the book now shows the internal construction of the programmable array logic (PAL). These three PLD components are extensively used in the design and implementation of complex digital circuits. Chapter 6 outlines the formal procedures for the analysis and design of clocked syn- chronous sequential circuits. The gate structure of several types of flip-flops is pre- sented together with a discussion on the difference between pulse level and pulse tran- sition triggering. Specific examples are used to show the derivation of the state table and state diagram when analyzing a sequential circuit. A number of design examples are presented with added emphasis on sequential circuits that use D-type flip-flops. Chapter 7 presents various sequential digital components such as registers, shift registers, and counters. These digital components are the basic building blocks from which more complex digital systems are constructed. The sections on the random ac- cess memory (RAM) have been completely revised and a new section deals with the Hamming error correcting code. Chapter 8 presents the algorithmic state machine (ASM) method of digital design. The ASM chart is a special flow chart suitable for describing both sequential and paral- lel operations with digital hardware. A number of design examples demonstrate the use of the ASM chart in the design of state machines. Chapter 9 presents formal procedures for the analysis and design of asynchronous sequential circuits. Methods are outlined to show how an asynchronous sequential cir-

Binary' $ystems

1·1 DIGITAL COMPUTERS AND DIGITAL SYSTEMS

Digital computers have made possible many scientific, industrial, and commercial ad- vances that would have been unattainable otherwise. Our space program would have been impossible without real-time, continuous computer monitoring, and many busi- ness enterprises function efficiently only with the aid of automatic data processing. Computers are used in scientific calculations, commercial and business data processing, air traffic control, space guidance, the educational field, and many other areas. The most striking property of a digital computer is its generality. It can follow a sequence of instructions, called a program, that operates on given data. The user can specify and change programs and/or data according to the specific need. As a result of this flexibility, general-purpose digital computers can perform a wide variety of informa- tion-processing tasks. The general-purpose digital computer is the best-known example of a digital system. Other examples include telephone switching exchanges, digital voltmeters, digital counters, electronic calculators, and digital displays. Characteristic of a digitaLsYstem is its manipulation. of discrete elements of information: SlicIi(JJscreteeiemenis may be. electric impulses, th;;-decimaf <iigTiS:-tlie letters of an alphabet, arithmetic operations, punctuation marks, or any other set of meaningful symbols. The juxtaposition of dis- crete elements of information represents a quantity of information. For example, the letters d, 0, and g form the word dog. The digits 237 form a number. Thus, a sequence of discrete elements forms a language, that is, a discipline that conveys information.

Early digital computers were used mostly for numerical computations. In this case, the

2 Chapter 1 Binary Systems

discrete elements used are the digits. From this application, the term digital computer has emerged. A more appropriate name for a digital computer would be a "discrete in- formation-processing system." Discrete elements of information are represented in a digital system by physical quantities called signals. Electrical signals such as voltages and currents are the most common. The signals in all present-day electronic digital systems have only two dis- crete values and are said to be binary. The digital-system designer is restricted to the use of binary signals because of the lower reliability of many-valued electronic circuits. In other words, a circuit with ten states, using one discrete voltage value for each state, can be designed, but it would possess a very low reliability of operation. In contrast, a transistor circuit that is either on or off has two possible signal values and can be con- structed to be extremely reliable. Because of this physical restriction of components, and because human logic tends to be binary, digital systems that are constrained to take discrete values are further constrained to take binary values. Discrete quantities of information arise either from the nature of the process or may be quantized from a continuous process. For example, a payroll schedule is an inher- ently discrete process that contains employee names, social security numbers, weekly salaries, income taxes, etc. An employee's paycheck is processed using discrete data values such as letters of the alphabet (names), digits (salary), and special symbols such

as $. On the other hand, a research scientist may observe a continuous process but

record only specific quantities in tabular form. The scientist is thus quantizing his con- tinuous data. Each number in his table is a discrete element of information. Many physical systems can be described mathematically by differential equations whose solutions as a function of time give the complete mathematical behavior of the process. An analog computer performs a direct simulation of a physical system. Each section of the computer is the analog of some particular portion of the process under study. The variables in the analog computer are represented by continuous signals, usu- ally electric voltages that vary with time. The signal variables are considered analogous to those of the process and behave in the same manner. Thus, measurements of the analog voltage can be substituted for variables of the process: The term analog signal is sometimes substituted for continuous signal because "analog computer" has come to mean a _computer that manipulates continuous variables. To simulate a physical process in a digital computer, the quantities must be quan- tized. When the variables of the process are presented by real-time continuous signals, the latter are quantized by an analog-to-digital conversion device. A physical system whose behavior is described by mathematical equations is simulated in a digital com- puter by means of numerical methods. When the problem to be processed is inherently discrete, as in commercial applications, the digital computer manipulates the variables in their natural form. A block diagram of the digital computer is shown in Fig. 1-1. The memory unit stores programs as well as input, output, and intermediate data. The processor unit per- forms arithmetic and other data-processing tasks as specified by a program. The con- trol unit supervises the flow of information between the various units. The control unit retrieves the instructions, one by one, from the program that is stored in memory. For

4 Chapter 1 Binary Systems

The operational characteristics of the memory unit are explained at the end of Chapter

  1. The design of the control unit is discussed in Chapter 8 using the basic principles of sequential circuits from Chapter 6. It has already been mentioned that a digital computer manipulates discrete elements of information and that these elements are represented in the binary form. Operands used for calculations may be expressed in the binary number system. Other discrete ele- ments, including the decimal digits, are represented in binary codes. Data processing is carried out by means of binary logic elements using binary signals. Quantities are stored in binary storage elements. The purpose of this chapter is to introduce the vari- ous binary concepts as a frame of reference for further detailed study in the succeeding chapters.

1-2 BINARY NUMBERS

A decimal number such as 7392 represents a quantity equal to 7 thousands plus 3 hun- dreds, plus 9 tens, plus 2 units. The thousands, hundreds, etc. are powers of 10 implied by the position of the coefficients. To be more exact, 7392 should be written as 7 X 10 3 + 3 X 102 + 9 X 10' + 2 x 10° However, the convention is to write only the coefficients and from their position de- duce the necessary powers of 10. In general, a number with a decimal point is repre- sented by a series of coefficients as follows:

The aj coefficients are one of the ten digits (0, 1,2, ... ,9), and the subscript valuej gives the place value and, hence, the power of 10 by which the coefficient must be mul- tiplied. 10'a, + 104 a4 + 10 3 a3 + 10 2 a2 + lOla, + 100ao + 1O-'a,_ + 1O- 2 a_2 + 1O- 3 a_

The decimal number system is said to be of base, or radix, 10 because it uses ten digits and the coefficients are multiplied by powers of 10. The binary system is a different number system. The coefficients of the binary numbers system have two possible val-

ues: 0 and 1. Each coefficient aj is multiplied by 21. For example, the decimal equiva-

lent of the binary number 11010.11 is 26.75, as shown from the multiplication of the coefficients by powers of 2: I X 24 + I X 2 3 + 0 X 22 + 1 X 2' + 0 x 2° + I x 2 -, + 1 X 2- 2 = 26.

In general, a number expressed in base-r system has coefficients multiplied by powers of r: an'r" + _a,,1'r,,--'1 + ' , ' + a2'r 2 + aj'r + Go

  • G_J,,--l + a __ 2'r- 2 + ' ,. + a_m'r-m

Section 1-2 Binary Numbers 5

The coefficientsaj rangein vllJue Jrom 0 to r - 1. To distinguish between numbers of different bases, we enclose the coefficients in parentheses and write a subscript equal to the base used (except sometimes for decimal numbers, where the content makes it ob- vious that it is decimal). An example of a base-5 number is (4021.2)5 = 4 X 53 + 0 X 5' + 2 X 5' + 1 X 50 + 2 X 5-' = (511.4ho Note that coefficient values for base 5 can be only 0, I, 2, 3, and 4. It is customary to borrow the needed r digits for the coefficients from the decimal system when the base of the number is less than 10. The letters of the alphabet are used to supplement the ten decimal digits when the base of the number is greater than 10. For example, in the hexadecimal (base 16) number system, the first ten digits are bor- rowed from the decimal system. The letters A, B, C, D, E, and F are used for digits 10, 11, 12, 13, 14, and 15, respectively. An example of a hexadecimal number is (B 65Fh. = 11 X 163 + 6 X 16' + 5 X 16 + 15 = (46687) The first 16 numbers in the decimal, binary, octal, and hexadecimal systems are listed in Table I-I.

TABLE ,-, Numbers with Different Bases Decimal Binary (^) OCtal Hexadecimal (base 10) (base 2) (base B) (base 16) 00 ()()()()^00 01 0001 01 I 02 0010 02 2 (^03 0011 03 ) 04 0100 04 4 (^05 0101 05 ) (^06 0110 06 ) 07 0111 07 7 08 1000 10 8 09 1001 11 9 (^10 1010 12) A II (^1011 13) B 12 1100 14 C 13 1101 15 D 14 1110 16 E 15 1111 17 F

Arithmetic operations with numbers in base r follow the same rules as for decimal numbers. When other than the familiar base 10 is used, one must be careful to use only the r allowable digits. Examples of addition, subtraction, and multiplication of two bi- nary numbers are as follows:

Example 1-

Section 1-3 Number Base Conversions

Integer quotient Remainder Coefftclent

41 (^20) +

I

ao = I 2 2 20 (^10) + 0 a, = 0 2 10 2=^5 +^0 a2^ =^0 5 (^2) +

I

2:= 2 a,^ =^ I 2 2:= I^ +^0 a4^ =^0 I (^0) +

I

= as^ =^1 2 2 answer: (41)10 = (a,a4a,a2a,ao)' = (101001),

The arithmetic process can be manipulated more conveniently as follows: Integer

41 20 10

I

o

Remainder

The conversion from decimal integers to any base-r system is similar to the exam- ple, except that division is done by r instead of 2.

Convert decimal 153 to octal. The required base r is 8. First, 153 is divided by 8 to give an integer quotient of 19 and a remainder of I. Then 19 is divided by 8 to give an integer quotient of 2 and a remainder of 3. Finally, 2 is divided by 8 to give a quotient of 0 and a remainder of 2. This process can be conveniently manipulated as follows:

153 19 I 2 3

o 2 L = (231).

8 Chapter 1 Binary Systems

Example 1-

Example 1-

The conversion of a decimal fraction to binary is accomplished by a method similar to that used for integers. However, multiplication is used instead of division, and in- tegers arc accumulated instead of remainders. Again, the method is best explained by example.

Convert (0.6875)10 to binary. First, 0.6875 is multiplied by 2 to give an integer and a fraction. The new fraction is multiplied by 2 to give a new integer and a new fraction. This process is continued until the fraction becomes 0 or until the number of digits have sufficient accuracy. The coefficients of the binary number are obtained from the integers as follows: Integer Fraction Coefficient 0.6875 x 2 = (^1) + 0.3750 a-I = 1 0.3750 x 2 = (^0) + 0.7500 U-2 = 0 0.7500 X^2 = (^) + 0.5000 a-3 = 0.5000 X 2 = (^) + 0.0000 a-4 = Answer: (0.6875)'0 = (O.a la-2u-3 a -4h = (O.lDII),

To conyert a decimal fraction to a number expressed in base r, a similar procedure is used. Multiplication is by r instead of 2, and the coefficients found from the integers may range in value from 0 to r - I instead of 0 and I.

Convert (0.513)10 to octal.

0.513 x^8 = 4.

0.104 X^8 = 0.

0.832 x 8 = 6.

0.656 x 8 = 5.

0.248 x^8 = 1.

0.984 x 8 = 7.

The answer, to seven significant figures, is obtained from the integer part of the prod- ucts: (0.513),0 = (0.406517 ... ls

The conversion of decimal numbers with both integer and fraction parts is done by converting the integer and fraction separately and then combining the two answers. Us- ing the results of Examples 1-1 and 1-3, we obtain

1 0 Chapter 1 Binary Systems

utilizes the relationship between the binary number system and the octal or hexadeci- mal system. By this method, the human thinks in terms of octal or hexadecimal num- bers and performs the required conversion by inspection when direct communication with the machine is necessary. Thus the binary number 111111111111 has 12 digits and is expressed in octal as 7777 (four digits) or in hexadecimal as FFF (three digits). During communication between people (about binary numbers in the computer), the octal or hexadecimal representation is more desirable because it can be expressed more compactly with a third or a quarter of the number of digits required for the equivalent binary number. When the human communicates with the machine (through console switches or indicator lights or by means of programs written in machine language), the conversion from octal or hexadecimal to binary and vice versa is done by inspection by the human user.

1-5 COMPLEMENTS

Complements are used in digital computers for simplifying the subtraction operation and for logical manipulation. There are two types of complements for each base-r sys- tem: the radix complement and the diminished radix complement. The first is referred to as the r's complement and the second as the (r - I)'s complement. When the value of the base r is substituted in the name, the two types are referred to as the 2's comple- ment and l's complement for binary numbers, and the 10's complement and 9's com- plement for decimal numbers.

Diminished Radix Complement

Given a number N in base r having n digits, the (r - l)'s complement of N is defined as (r" - 1) - N. For decimal numbers, r = 10 and r - 1 = 9, so the 9's comple- ment of N is (10" - 1) - N. Now, 10" represents a number that consists of a single 1 followed by nO's. 10" - I is a number represented by n 9's. For example, if n = 4, we have 104 = 10,000 and 104 - 1 = 9999. It follows that the 9's complement of a decimal number is obtained by subtracting each digit from 9. Some numerical examples follow. The 9's complement of 546700 is 999999 - 546700 = 453299. The 9's complement of 012398 is 999999 - 012398 = 987601. For binary numbers, r = 2 and r - I = 1, so the I's complement of N is (2" - 1) - N. Again, 2" is represented by a binary number that consists of a I fol- lowed by n O:s. 2" - 1 is a binary number represented by n I's. For example, if

n = 4, we have 24 = (\0000), and 24 - I = (1111),. Thus the l's complement of a

binary number is obtained by subtracting each digit from 1. However, when subtract- ing binary digits from 1, we can have either 1 - 0 = 1 or 1 - 1 = 0, which causes

Section 1-5 Complements 11

the bit to change from 0 to I or from I to O. Therefore, the I's complement of a binary

number is formed by changing I's to O's and O's to I's. The following are some nu-

merical examples. -

The I's complement of 1011000 is 0100111.

The I's complement of 0101101 is 1010010.

The (r - I)'s complement ofoctal or hexadecimal numbers is obtained by subtracting

each digit from '7 or F (decimal 15), respecti"ely.

Radix Complement

The r's complement of an n-digit number,N in.J?llse r is defined as r" - !!fOLN,"i:))_

and 0 for N = O. Comparing with the (r - I)'s complement, we note that the r's

coriipremefitTs06talned--by adding I to the (r - I)'s complement since r" - N = '[(r" - I) - NJ + 1. Thus, the lO's complement of decimal 2389 is 7610 + I = 7611

and is obtained by adding I to the 9's-complement value. The 2's complement of bi-

nary 101100 is 010011 + I = 010100 and is obtained by adding I to the I's-comple-

ment value. ..-

Since 10" is a number represented by a I followed by nO's, 10" - N, which is the

lO's complement of N, can be formed also by leaving all least significant O's un-

changed, subtracting the first nonzero least significant digit from 10, and subtracting all

higher significant digits from 9.

The lO's complement of 012398 is 987602.

The lO's complement of 246700 is 753300.

The lO's complement of the first number is obtained by subtracting 8 from 10 in the

least significant position and subtracting all other digits from 9. The lO's complement

of the second number is obtained by leaving the two least significant O's unchanged,

subtracting 7 from 10, and subtracting the other three digits from 9.

Similarly, the 2's complement can be formed by leaving all least significant O's and

the first I unchanged, and replacing I's with O's and O's with I's in all other higher

significant digits.

The 2's complement of 1101100 is 0010100.

The 2's complement of 0110111 is 1001001.

The 2's complement of the first number is obtained by leaving the two least significant

O's and the first I unchanged, and then replacing I's with O's and O's with I's iii-ihe.

other four most-significant digits. The 2's complement of the second number is ob-

tained by leaving the least significant I unchanged and complementing all other digits.

In the previous definitions, it was assumed that the numbers do not have a radix

point. If the original number N contains a radix point, the point should be removed