You are on page 1of 855
Contents ~ Preface — 0 Introduction O41 0.2 0.3 0.4 History of Computing 0.1.1 Beginnings: Mechanical Computers 0.1.2 Early Electronic Computers 0.1.3. The First Four Generations of Computers 0.1.4 ‘The Fifth Generation and Beyond Digital Systems 0.2.1 Digital vs Analog Systems 0.2.2 Digital System Design Hierarchy Organization of a Stored Program Digital Computer 0.3.1 Computer Instructions 0.3.2 Information Representation in Computers 0.3.3 Computer Hardware 0.3.4 Computer Software Summary ~ 1 Number Systems and Codes 1.1 Number Systems 1.1.1 Positional Notation 1.1.2 Commonly Used Number Systems xv Ree ao web 20 2t 22 il iv Contents 1.2 Arithmetic 22 1.2.1 Binary Arithmetic 23 1.2.2. Octal Arithmetic 27 1.2.3. Hexadectmal Arithmetic 28 1.3 Base Conversions 30 1.3.1 Conversion Methods RSF 1.3.2 General Conversion Algorithms 35 1.3.3. Conversion Between Base 4 and Base B When B =A‘ 36 1.4 Signed Number Representation 37 1.4.1 Sign-Magnitude Numbers 37 14.2. Complementary Number Systems 38 1.5 Computer Codes 55 15.1 Numeric Codes 55 1.5.2 Character and Other Codes 61 1.5.3 Error Detection Codes and Correction Codes 65 1.6 Summary 73 Methods for the Analysis and Synthesis 4g 2 Algebrai of Logic Circuits 78 2.1 Fundamentals of Boolean Algebra 79 2.1 Basie Postulates ” 2.1.2 Venn Diagrams for Postulates (21 30 21.3 Duality 81 2.1.4 Fundamental Theorems of Boolean Algebra 84 2.2 Switching Functions 90 2.24 Truth Tables 93 2.2.2 Algebraic Forms of Switching Functions o4 2.2.3 Derivation of Canonical Forms 101 2.2.4 Incompletely Specified Functions 103 23 24 25 26 27 28 Contents ¥ Switching Circuits 2.3.1 Electronic Logic Gates 2.3.2. Basic Functional Components Analysis of Combinational Circuits. 24,1 Algebraic Method 2.4.2 Analysis of Timing Diagrams Synthesis of Combinational Logic Circuits 2.5.1 AND-OR and NAND Networks 2.52 OR-AND and NOR Networks 2.53 Two-Level Circuits 2.5.4 AND-OR-invert Circuits 25.8 Factoring Appli ions Computer-Aided Design of Logic Circuits 2.7.1 The Design Cycle 2.7.2 Digital Circuit Modeting 2.7.3. Design Synthesis and Capture Tools 2.7.4 Logic Simulation Summary — 3 Simplification of Switching Functions 34 3.2 3.3 Simplification Goals. Characteristics of Minimization Methods Karnaugh Maps 3.3.1 Relationship to Venn Diagrams and Truth Tables 3.3.2 K-Maps of Four or More Variables 104 104 108 120 120 123 128 128, 130 13h 134 136 140 140 146 148 152 165 172 173 174 175 6 7 vi Contents. 34 3.6 36 37 38 39 3.10 3.1 3.12 Plotting Functions in Canonical Form on the K-May Simplification of Switching Functions Using K-Maps. 3.8.1 Guidelines for Simplifying Functions Using K-Maps 3.5.2 General Terminology for Switching Function Minimization 3.5.3. Algorithms For Deriving Minimal SOP Forms From K-Maps POS Form Using K-Maps 3.6.1 General Terminology for POS Forms 36.2 Algorithms For Deriving Minimal POS Forms From K-Maps incompletely Specified Functions Using K-Maps To Eliminate Timing Hazards Quine-McCluskey Tabular Minimization Method 39.1 Covering Procedure 3.9.2 Incompletely Specified Functions 3.9.3. Systems With Multiple Outputs Petrick’s Algorithm Computer-aided Minimization of Switching Functions 3.1L1 Cube Representation of Switching Functions 3.1L.2 Algebraic Methods for Determining Prime Implicants 3.113 Identifying Essential Prime Implicants 3.114 Completing a Minimal Cover 3.15 Other Minimization Algorithms Summary 179 185 187 187 197 197 197 203 206 2 215 218 219 222 224 227 228 230 231 24 234 Contents vil ® 4 Modular Combinational Logic 41 42 43 44 45 4.6 47 48 49 Top-Down Modular Design Decoders 4.2.1 Decader Circuit Structures 4.2.2 Implementing Logic Functions Using Decoders 4.2.3 Enable Control Inputs 4.24 Standard MSI Decoders 4.28 Decoder Applications Encoders 43.1 Encoder Circuit Structures 43.2 Standard MSI Encoders Multiplexers/Data Selectors 4.4.1 Multiplexer Circuit Structures 44.2 Standard MSI Multiplexers 4.4.3 Applications of Multiplexers Demultiplexers/Data Distributors Binary Arithmetic Elements 46.1 Basie Binary Adder Circuits 46.2 MSI Binary Adder Modules 4.6.3. High-speed Adder Units 4.6.4 Binary Subtraction Circuits 465 Arithmetic Overflow Detection Comparators Design Example: A Computer Arithmetic Logic Unit Computer-aided Design of Modular Systems. 49.1 Design Libraries 4.9.2 Drawing Hierarchical Schematics 242 243 245 246 a7 29 252 253 259 260 264 268 268 270 277 280 283 283 285 289 294 295 298 302 312 312 ai4 vili_ Contents 4.10 Simulation of Hierarchical Systems 4.11. Summary 4 § Combinational Circuit Design with Programmable Logic Devices 5A 5.2 5.3 5.4 55 Semicustom Logic Devices Logic Array Circuits 5.2.1 Diode Operation in Digital Circuits 5.2.2. AND and OR Logic Arrays $2.3 Two-Level AND-OR Arrays 5.2.4 Field-Programmable AND and OR Arrays 5.28 Output Polarity Options 5.2.6 Bidirectional Pins and Feedback Lines 5.2.7 Commercial Devices Field-programmable Logic Arrays 53.1 FPLA Circuit Structures 5.3.2 Realizing Logic Functions With FPLAs Programmable Read-only Memory 5.41 PROM Circuit Structures 54.2 Realizing Logic Functions With PROMS $4.3 Lookup Tables 5.4.4 General Read-only Memory Applications 5.45 Read-only Memory Technologies Programmable Array Logic 58.1 PAL Circuit Structures 5.5.2 Realizing Logic Functions With PALS §.5.3 PAL Output and Feedback Options a7 a9 347 37 M7 5.6 57 Computer-aided Design Tools for PLD Design 5.6.1 Design Representation with PDL 5.6.2 Processing a PDL Design File Summary ~ 6 Introduction to Sequential Devices 61 6.2 6.3 64 6.6 6.7 68 Models for Sequential Circuits 6.1.1 Block Diagram Representation 6.4.2 State Tables and Diagrams Memory Devices Latches 63.1 Set-Reset Latch 63.2 Gated SR Latch 6.3.3 Delay Latch Flip-Flops Master-Slave SR Flip-Flops Master-Slave D Flip-Flops Master-Slave JK Flip-Flops Edge-triggered D Flip-Flops Edge-triggered JK Flip-Flops 6.4.6 T Flip-flops 6.4.7 Latch and Elip-flop Summary Other Memory Devices Timing Circuits 6.6.1 One-shots 6.6.2 The 555 Timer Module Rapidly Prototyping Sequential Circuits. Summary Contents. ix 371 373 379 380 382 383 383 385 387 339 389 398 403 404 As 418 418 418, 421 425 x Contents @® 7 Modular Sequential Logic 7A 72 “7.3 74 75 7.6 77 78 Shift Registers 7.1.1 A Generic Shift Register 7.1.2. Standard TTL Shift-Register Modules Design Examples Using Registers 7.2.1 Serial Adder Unit 7.2.2. Serial Accumulators 72.3 Parallel Accumulators: Counters 7.3.1 Syachronous Binary Counters 7.3.2. Asynéhronous Binary Counters 7.3.3 Down Counters 7.34 Up/Down Counters Modulo-N Counters 7.4.1 Synchronous BCD Counters 742 Asynchronous BCD Counters 7.4.3. Modulo-6 and Modulo-12 Counters 7.4.4 Asynchronously Resetting Modulo-N Counters 7.4.5 Synchronously Resetting Modulo-N Counters Shift Registers as Counters 75.1 Ring Counters 1.5.2 Twisted-ring Counters Multipte-sequence Counters Digital Fractional Rate Multipliers 7.7.1 TTL Modules 7.7.2 Cascading the Digital Fractional Rate Multipliers Summary 432 433 436 446 446 448 450 450 451 458 464 467 470 474 a7 477 478 482 ang 489 491 495, Contents xi i 8 Analysis and Synthesis of Synchronous Sequential Circuits 81 8.2 8.3 8.5 8.6 Synchronous Sequential Circuit Models 8.1.1 Mealy Modei 8.1.2. Moore Model Sequential Circuit Analysis 8.2.1 Analysis of Sequential Circuit State Diagrams 8.2.2 Analysis of Sequential Circuit Logic Diagrams 8.2.3 Summary Synchronous Sequential Circuit Synthesis 8.3.1 Synthesis Procedure 8.3.2 Flip-flop Input Tables 8.3.3 Application Equation Method for JK Flip-flops 8.3.4 Design Examples 8.3.5 Algorithmic State Machine Diagrams 8.3.6 One-hot Finite-State Machine Design Method incompletely Specified Circuits 8.4.1 State Assignment and Circuit Realization Computer-aided Design of Sequential Circuits 8.5.1 Design Capture and Synthesis 8.5.2 Design Analysis and Verification Summary — 9 Simplification of Sequential Circuits ot 9.2 Redundant States 9.1.1 State Equivalence 9.1.2 Equivalence and Compatibility Relations State Reduction in Completely Specified Circuits 9.2.1 Inspection 502 503 sod 505 507 317 519 520 522, 524 526 347 553 555, 558, 558 568 576 577 377 3879 579 579 xii Contents 9.3 9.4 9.5 9.2.2 Partitioning 9.2.3. implication Table State Reduction In Incompietely Specified Circuits 9.3.4 State Compatibility 9.3.2. Minimization Procedure Optimal State Assignment Methods 9.4.1 Unique State Assignments 9A2 State Assignment Guidetines 9.4.3 Partitioning 944 Optimal State Assignments Summary ~ 10 Asynchronous Sequential Circuits 10.4 10.2 10.3 10.4 10.5 10.6 Types of Asynchronous Circuits Analysis of Pulse-mode Asynchronous Circuits Synthesis of Pulse-made Circuits 10.3.1 Design Procedure for Pulse-mode Circuits Analysis of Fundamental-mode Circuits 10.4.1 Introduction 10.4.2 Tabular Representations 10.4.3 Analysis Procedure Synthesis of Fundamental-mode Circuits 105.1 Synthesis Procedure Introduction to Races, Cycles, and Hazards 10.6.1. Races and Cycles 10.6.2 Avoidance of Race Conditions 10.6.3 Race-free State Assignments 10.6.4 Hazards 10.6.5 Analysis ad 619 624 625 627 632 641 63 645 648, 648 os 659 664 om 673 Contents xiii 10.7 Summary ~ 11 Sequential Circuits With Programmable Logic Devices Wa 11.2 11.3 11.4 WS 11.6 Registered Programmable Logic Devices 11.1.1 Field-Programmable Logie Sequencers ILL2 Registered PALs 1L.1.3 PLDs with Programmable Logic Macrocells Programmable Gate Arrays M21 Logic Cell Arrays 11.2.2. ACT FPGAs Sequential Circuit Design and PLD Device Selection PLD Design Examples: Computer-aided Design of Sequential PLDs 11.5.1 Sequential Cireuit Design Representation with PDL. 11.5.2 Processing a PDL Design Fite Summary ~ 12 Logic Circuit Testing and Testable Design 124 12.2 12.3 Digital Logic Circuit Testing Fault Models. Combinational Logic Circuit Testing 12.3.1 Test Generation Untestable Faults Multiple Output Networks Fault Detection Test Sets Fault Location and Diagnasis, Random Testing 673 686 687 ol 700 702 705 713 715 717 723 79 738 740 741 Taz 751 752 753 187 758 xiv Contents 12.4 12.5 12.6 12.7 12.8 Sequential Logic Cireuit Testing Design For Testability 12.5.1 Scan Path Design Bui Self-test 12.6.1 Pseudorandom Test Vector Generation 12.6.2 Signature Analysis 12.6.3 Built-In Logie Block Observer Board and System-level Boundary Scan Summary ~ 13 Design Examples . Index 13.1 13.2 13.3 13.4 Electronic Slot Machine 13.1.1 Problem Definition 13.1.2 System Requirements and Solution Plan 13.1.3 Logte Design Keyless Auto Entry System 13.2.1. Problem Definition 13.2.2 System Requirements 13.2.3 Logie Design One-lane Traffic Controller 13.3.1 System Requirements 13.3.2 Logic Design Grocery Store Cash Register 13.4.1 System Requirements 13.4.2 Logic Design 760 763 764 768 769 172 775 777 781 788 789 TRY ™ 792 833 SF . IES — — + _ — — a ae \ We are living in an age that sociologists ru have called the computer revolution. Like any true revolution, it ix widespread and all- pervasive and will have u lasting impact on so- ciety. It is as fundamental te our present economic and social order as was the industrial revolution in the nineteenth century. H will affect the thinking par- terns and life-stvles of every individual, Whereas the major effect of the industrial revolution was ta aug ment our physical powers, the computer revolution i extending our mental powers Computers are composed of electronic, mechan- eat, and/or optical elements known as the hardware cand of programs and data known as the software, This book thiroduces the subject of computer hardware. In purticular, we will study the analysis und design of logic circuits that form the basis far most computer electronic hardware, But first, let's take @ closer look ut the history and she organization of the digital computer Introduction ® 0.1 History of Computing A computer is a device capable of solving problems or manipulating infor mation, according to s prescribed sequence of instructions (or program). ing some mechanical or electrical process. Since people first began solving problems thousands of years ago, ways have been sought to simplify various problem-solving tasks. Of prinvary intecest over the millenia has been the au- tomation of arithmetic operations. The advent of computer technology provided an inexpensive way to perform simple arithmetic, and, as the technology ma- tured, computer techniques were rapidly extended to solving complex numeric problems, storing, retrieving, and communicating information. and controlling robots, appliances. automobiles, games, manufacturing plants, and a variety of other processes and machines. What is most amazing is that this computer revolution has occurred all within the past 50 years! The following is a brief synopsis of these developments. Beginnings: Mechanical Computers ‘The first computer was probably the abacus, which has been used in the Orient for over 3000 years. This device, still in use today, had Tittle competition until the 1600s when John Napier used logarithms as the basis for a device that tnultiplied numbers. His work led to the invention of the stide rule. Then, in 1642, Blaise Pascal built an adding machine that had geared wheels much like the modern odometer. In 1820, Charles Babbage built the first device that used the principles of modem computers. His machine, the difference engine, evaluated polynomials by the method of finite differences (see [1]}. He also conceived a mechanical machine that resembled modern-day computers with a store and arithmetic unit. However, the precision required for constructing the mechanical gears, ‘was beyond the capabilities of the craftsmen of his time. 2 Chapter 0 Introduction 0.1.2 Early Electronic Computers “The first real progress toward electronic digital computers came in the late 1930s when Howard Aiken of Harvard University and George Slibivz of Bell Tele- phone Lahoratoties developed an atomatic catcukator using relay networks; the relay is an electrommagnetically controlled switch. Other relay machines were developed during World War II for anillery ballistic calculations. Although these machines were relatively slow and comparatively lange. they demon- strated the versatility of the electronic computer. Then, ia the early 4940s, John Mauchly and J. Presper Eckert, Jr, of the University of Pennsylvania designed, and buill a vacuum tube computer, which they called the electronic sumeri- cal integrator and calculator (ENIAC: it was completed in 1945 and installed at Aberdeen Proving Ground, Maryland. ENIAC used 18,000 electron subes. which required tremendous amounts of power. its failure rate was high and it was difficult w program because 1 plugbourd was required ‘Three very important discoveries were then made, whieh began the rapid evolution toward today’s digital computer. First, John von Neumann proposed ‘that the program reside in the computer's memory where it could be changed at will, solving the programming difficulties of ENTAC: second, in 1947 the tran- sistor was invented by John Bardeen, Walter H. Brattain, and William Shock ley, which drastically reduced the size and power requirements by replacing the electron vacuum tube; and, third, J. W. Forrester and his associates at the Massachusetts Institute of Technology developed the magnetic core memory, which made large amounts of storage feasible. 0.1.3 The First Four Generations of Computers ENIAC and other vacuum tube computers appearing in the late 1940s and through the 1950s have been labeled first-generation digital computers. The advent of transistors in the late 1950s brought about the second geweraion of machines. which were smaller in size and faster and featured increased eapa- bilities over their ancestors. In the late 196fks and throughout the 1970s, the third generation of machines appeared. These machines are characterized by their use of integrated circuits consisting of subminiature packages of multi- ple transistor circuits, which provided still another drastic reduction in size. Improvements in packaging and memory technology also contributed to the improved third-generation machines. ‘The late 1960s also brought the emergence of the minicompute. In ul tion fo large complex machines, offen called mainframes, many manufacturers colfered these smaller, limited-capability, general-purpose computers, Minicom puters, which derived their name feorn their size and cost, buve been Used in many diverse applications and have played a major role in popularizing the use of computers. The minicomputer widely increased computer usage in the sei- entific and engineering communities. Machines found their way into industrial and university research laboratories. Computerized process control in industey became commonplace. Section 0.1. History of Computing 3 The finrrth generation of computers was ushered in during the late 1970s and early 1980s with the appearance of machines based om large scale inte- grated (LSI and very lurge scale inmegrated (VLSE circuit hardware compo- nents. VLST mad it feasible 10 build small but powerful computers known as personal computess or workstations. The central component of these machines is the micruprocessor, which is an entire central processing unit of a computer inaplemenied in a single VLSI component, Intel Corporation and Motorola have fed the sway in microprocessor technology development. This develop- mencis illustraued in Fig, 0.1 which shows the evolution over a 20-year period of the Intel VEST microprocessor chips used in the IBM and [BM-cempatible Personal computers vane) Ei yovema 7 A ie 5 es & 5 2 7) | oi i . i ; wo 4 fe TELAT : voll Ls ' 401K S08 -AUBS SORSRON AND HOI SUMEH Penimm| 971) CISA 119%) OTR CTH) 4 1986y | 19RH) «1D Figure 0.1 Evolution of tne Intel microprocessors Perhaps the appearance of personal computers such as the IBM Personal Computer, based on Intel caicroprocessers, and the Apple Macintosh, based on ‘Motorola microprocessors. has had the most dramatic impact on expanding the range of computer applications than has any other occurrence, Before the per- sonal computer became widespread. one could safely say that most e mpurers were used by computer experts. Now computers are commonly used by experts and nonexperts alike. Computer newworks have become commonphice during the fourth generation as well, Networks have increased sccess (0 computers and have spawned new applications, such as electronic mail 4) Chapter Introduction » 0.2 Digital Systems 0.1.4 The Fifth Generation and Beyond ‘When will the fifth generation of computers begin? Or has it already begun? Using the classical measure, the switch to a new hardware technology base, the answer is no. But should hardware technology be the only indicator of computer generations? Probably not. It is clear that advances in software have had profound effects on the way computers are used. New user interfaces, such as voice activation, of new computational paradigms, such as parallel processing and neural networks, may also charactetize the next-generation machine. Whatever the case may be. itis likely that parallel processing, artificial intelligence. optical processing. visual programming, and gigabit networks will play key roles in computer systems of the Tuture. We will likely be in the fifth generation of computers for some time hefore it becomes apparent Armed with these perspectives, let us now review some important com: puter terminology that we will need to analyze and design circuits for computers and other digital systenm 0.2.1 Digital versus Analog Systems Adiigiai system or device is a system in which information is represented and processed in discrete rather than continuous forms, Systems based on contin- daous forms of information are called anaiog systems or devices. A watch that displays time with hour, minute, and second hands is an example of an analog device, whereas a watch that displays the time in decimat digits is a digital device. Information on traditional audio cassette tapes is recorded in analog, form, whereas compact laser disks hold information in digital farm. A more modern form of audio tape, the digital audio tape (DAT), stores information in digital form For example, Fig. 0.2a shows an analog signal as might be found on a strip of magnetic audio tupe. Figure 0.2b shows the same signal sampled at uniform time intervals and converted to a discrete number of values. Figure 0.2 shows this information in digital form, with each sample represented by a binary number written vertically on the tape. ca o et Figure 0.2 agnetio tape containing analog and digital forme of a signal {8} Analog form, (0) Sampled analog form. (¢} Digital form Section 0.2 Digital Systems § Although the modern computer is the most visible example of a digital system, there are many other examples, including digital watches, traffic Hight controllers, and pocket calculators. All these examples (other than the com- puter) are systems with fixed functionalities that cannot be medified by the user. On the other hand, the computer is a programmable system; that is, it can be modified to change the tasks or applications that it performs. In other ‘words, computers are general-purpose systems. while the other examples are application specific In a rapidly growing trend, computers are being used in place of applica- tion-specitic circuits in such products as automobile engines, home appliances, and electronic games by developing programs to perform the tasks required of the application and then embedding the programmed computer within the product. The ability to program a computer to perform any arbitrary task allows embedded computers to be used in place of a wide variety of fixed ciscuits, usually al a much lower cost. Analog computers and other analog systems were in use long before digital devices were perfected. Why then have digital systems supplanted analog systems in most application areas? There are several reasons. © In gencral, digital techniques offer more flexibility than do analog techniques in that they can be more easily programmed to perform any desired algorithm, © Digital circuits provide for more powerful provessing capabilities in terms of speed. ‘@ Numeric information can be represented digitally with greater precision and range than it can with analog signals. © Information storage and retrieval Functions are much easier toimplement in digital form than in analog © Digital techniques aflow the use of built-in error detection and eorreetion mechanisms. @ Digital systems lend themselves to miniaturization more than do analog systems, 0.2.2 Digital System Design Hierarchy Digital systems may be designed and studied ar many different levels of abstrac- tion, ranging from a purely behavioral model, in which no hardware details are specified, down to the physical level, in which only structures of physical ma- terials are specified. Several levels of design abstraction are listed in Table 0.1 ‘The System and Register Levels At its highest level, a digital system can be viewed us one or more interact- ing functional modules. The behavior of each module is deseribed without specifying implementation details, For example, a desktop computer viewed at the system level comprises a microprocessor, memory modules, and control circuits for the monitor. keyboard, printer, and other peripheral devices. 6 Chapter 0 Introduction TABLE 0.1 HIERARCHY OF DIGITAL SYSTEM DESIGN ABSTRACTION System Highest Behavioral Register Behavioral/structural Gare Steuetural ‘Transistor Structural Physical Lowest Structural At the register level, a digital system is viewed as a collection of elements. called registers that store information, interconnected in some fashion by signal lines. {nformation is processed by the system by transferring it between registers along these signal lines. In some cases the information is transformed during these register transfers by routing it through one or more functional modules Figures 0.3a and b illastrate the systemn- and register-level models of a digital ut 4 nae ememeeresan] | | reimn [Zo Ser aan Figure 0.3 Models of a cigtal system that adds sts ‘of numbers. (a) system tevel. (b} register level, system that computes the sum of a sequence of binary numbers, supplied one at a time as inputs to the system. At the system level, all that is knows is the basic function of the system, which is to compute: x Total = > Input, Atthe register level. asin Fig. 0.3b, itis seen that the system comprises a storage register, A, and an adder circuit. The Tora! is computed by first clearing register Avosing control signal Clear. and then adding each input number, frput, to the contents of register A. replacing the contents of register A with the new sum, Section 0.2 Digital Systems 7 using control signal Store, Hence. the sum of a list of numbers is computed by performing the following register transfers in the proper sequence. Clear, AD Store: A — A+ input The Gate Level Atits lowest level, the behavior of a digital system is specified ax a set of logic equations from switching algebra that ean be realized in hardware by logic circuits. The smallest logical unit of digital hardware is ealled a gate. Gates ‘are switching elerments that implement the fundamental operators of switching, algebra, Logic equations are realized in hardware by interconnecting gates to form combinational logic circuits, as illustrated in Fig. 0.4, Note that the circuit Ihas six yates. The inputs in this example are labeled &,.....¢, and the output Foxy... Agtisa fonction only of the present value of the input signals. Hence. distinguishing feature of the combinational logic cireuit is that it possesses nc memory of previous input signals, The analysis and design of combinational logic circuits consume a mayor portion of this text. Baye ot a) a Figure 0.4 4 combinational logic circuit with six gates. All digital computers contain memory devices called rexisters thal serve as temporary stores for information. ‘These registers ank! certain pars of the cuntrol unit are called sequential logic circuits. A sequential logic civeuit is, in general. a combinational logic eireuit with memory, as modeled in Fig. 0. Unlike combinational logie circuits, the outputs of a sequential logic circuit ure functions of not only the preseal value of the input signals. but also depeed on the past history of inpus, as reflected by the information stozed in the registers Sequential logic circuit analysis and design comprise the second focal point of this text. Only after readers have mastered the fundamentals of combinational anu sequential circuits can they proceed with the design and construction of digital systems haniware, 8 Chapter 0. Introduction np, mel Combinational Pte: aie ewok tomers Figure 0.5 Sequential logic circu ‘Transistor and Physical Design Levels Combinational and sequential logic circuits completely define the lgical bes havior of 2 digital system, Ultimately, each logic gate must be realized! by a lower-level transistor circuit, which in twin is realized by combining saninss semiconductor and other materials. The technologies used to consatuet gates and other logic elements have evolved from mechanical devices to relays 16 electron tubes (o discrete transistors to integrated circuits, Figure 0.6 illustrates several of these devives, Modern computers and application-spovitie i systems are ustally built of integrated elreuits that are arranged to realize the cuits necessary fo implement the computer's instruction set oF the System's Tunctions An integrated cireait (IC) contains multiple logic elements. The number of gates o gate eguivatents per IC determines the seale of integration, Small scale integration (SSU) refers to [Cs with | to 10 yates. medium seale integration (MSI) corresponds (0 10-to 10Q-gate ICs, urge scale integration ¢LSH) bo 100 to 10,008) gates, and very large scale integration (VLS1 te ICS with more than 10,000 gates. tis beyond the scope of this texto eunsider transistor and physicul-level design uf logic gates. However. itis importunt to have a basic understanding of various electrical and physical properties of different sate circuits so that the Jogicsl operation. performance. cast. and other parameters of design my be evaluited. registers and conirel digital system Electronic Tech Jogies Numerous fanities of electronic technologies have been developed to provide characteristics such ais speed, power consumption. packaging density. fun rionallty, and cost that hareware designers prefer. Usually. it iy impossible to provide all the desired eharsetertsties in one family. Hence. there is xn on going quest for improvements in proven technologies or the development of new technologies. Tables 0.2 and (3 fist the must si cones pondin: transistor The pucksusing of log ‘cantly over the yours. Early electronic logie elements w ere typically coastructed teom large electron tubes. disercte resistors. and capacitors, were mounted on ‘elements ha o gates anid other gi nged sig Section 0.2 Digital Systems 9 TABLE 0.2 IMPORTANT ELECTRONIC TECHNOLOGIES Technology Device Type Resistor-transisior logic (RTL) Bipolar junction Diode-transistor logic (DTL} Bipolar junction ‘Transistor-transistor logic (TTL) Bipolar junction Emitter-coupled logic (ECL) Bipolar junetion Positive metal oxide semiconductor (pMOS) MOSFET Negative metal oxide semiconductor (nMOS) MOSFET Complementary metal oxide semiconductor (CMOS) MOSFET Gallium Arsenide (GaAs) MESFET TABLE 0.3 CHARACTERISTICS OF ELECTRONIC TECHNOLOGY FAMILIES Technology Power Consumption Speed Packaging RTL High Low Diserere High Low Diserete, $31 Medium Medum — SSI1.MSt High High SSI. MSILLSL Medium Low MSLLSt Mediun Mediom MSI, LSI. VLSI Low Medium SSI. MSILLSI. VLSI High High SSI. MSILLSL an aluminum chassis. und were interconnected with copper wire, Tube tech- nology advances resulted in reduced sizes. and printed circuit boards replaced the wires. Later, discrete transistors replaced the tubes. but the resistors, ei pacitors, and printed circuit boards remained in use. although their sizes were smaller. The advent of the integrated circuit in the early 196ts produced further reduction in the size of printed circuit boards und other passive elements Integrated circuits can be manufactured in standard, xemictstom, an custom forms. Standard ICs provide the parts necessary 1o build systems fir most applications. However. some applicutions may require semicuston 0. custom circuits «y meet special functions, lower cost, ar smaller size requis ‘ments. Custom circuits are manufactured (o the exact requirements of a specil customer, On the other hand. semicustom circuits are progcaminied to salist st customer's need. The tert applicaston-speeific inseerazed cirenits ASICS ‘often used to describe semicustom devices, 10° Chapter 0 Introduction 0 Figure 0.6 photographs of computor hardware (a) abacus; (b) relays: (¢) electron tubes: (9) transistors; (e) small-scale integrated circus: (f) medium-scale integrated circuits, (g) farge- scale intecrated circu Organization of a Stored Program Digital Computer 11 a Figure 0.6 (Contined). (R) internal view of an integrated ecu chip (MC74480) {oourtesy of Motorola Semiconductor Products, ine} (i) internal viow ef an elaetcrically programmable loge Sevice (courtasy of Xilinx); @) internal view of an electronically progcammabie logic device (courtesy oF Xilitn): (ke) very large-scale inlegrated circ in a flat pack with pin-grid input’ output loads {courtesy of ini); ()rukichip modute containing tree chips—a microprocessor, an electrically programmable read-only memory, and an appication-spectic integrated cireut ‘courtesy of Taxa instruments). 12. Chapter 0. Introduction J 0.3 Organization of a Stored Program Digital Computer Now that we have been introduced to the basic elements used to construct digital fogie citeuits fet us take a look at the organization of a digital computer. A di ital computer isa system whose [unctional elements consist of arithmeticflogic units (ALUs), contol units, memory or storage enits, and inpuourput (40+ equipment. The interaction of dhese elements is shown in Fig, 0.7. Every com- puter system has a native set of instructions. called machine instructions, that specity operations to be performed on data by the ALU and other interactions between the ALU. memory. and UO devices. The memory elements contain he data plus a stored list of machine instructions called a program. Contr processing unit cry Auithneni| wo Lt Jeti] Memon uevices Memory t Conte Figure 0.7 High-level erganization of a digital computer The control unit coordinates all operations of the ALU, memory. and VO devices by continuously cycling through a set of operations that cause instructions to be fetched trom memory and executed. The fasdruction crele at j simple digital computer, Mustrated in Fig. 0.8. ineltkles the following bavie steps: 1. Fetch the next instruction of the cunen prstart Tres memory ince the ‘control ua. 2. Decode the instruction: that is, determine whieh machine tnssemetion is tw be executed 3. Fetch ny operands neuded for the instruction from memory or trem input devices. 4, Perform che operation indicated by the insteuction, 8, Store in memory any results generated by the operation, or send the revults to ap outpat device, Section 0.3 Organization of a Stored Program Digita! Computer 13 Instructions are taken from memory in sequential order unless @ special kind of instruction is encountered called. synonymousty, a branch, jump, skip, oF transfer. The branch instructions allow looping and decision-making programs to be written. Fach Decode Fetch Perform, Store Cl instroction [~~] insruetion [—"] operands operation resus Figure 0.8 Instruction cycle ol a stored program computer, 0.3.1 Computer instructions AAs the contro} unit of a digital computer fetches an instruction trom memory for execution, several types of operations may result 1, Arithmetic insernctions cause the binary data to be added, subtracted, multiplied, or divided us specified by the computer prograrnmer in the program, 2. Test and compare operations are availabte and determine the relation (greater than, Jess than, equal t0, or other) of cwo pieces of binary data, 3. Branch or skip instructions may be employed thal alter the sequential ature of program execution, based on the results of a test or compare, ‘This type of function adds considerable flexibility 10 programs, 4 Input and output commands are included for reading messages into the computer, writing messages trom the computer, and controlling peripheral devices 5. Logical and shifting operations provide the computer with the ability to translate and interpret all the different codes it uses, These in- structions allow bit manipulation to be accomplished under prograrn control. All instructions for any digital computer may be grouped into one of hese five categories, 0.3.2 Information Representation in Computers. We have brietly discussed the instructions and data stored in the digital come poter's memory unit. but no mention was made of che form oF these items, Information in a computer system ean generally be divided into three cates goties: aumeric data, nonnumerie data, and instruction codes Numeric Data Representation Numbers are stored in the computer's tnemory in the binary ¢buse 2) number system. Binary numbers are wrilten using the two binary digits (bits), | and 0. By contrast, we use 10 decimal digits in writing decimal aumbers, 14 Chapter 0 Introduction For example, 129 in decimal means 1 x 1G? +2» 10' +9 x 10°, or each digit’s position represents a weighted power of 10. Note that the 10 digits ase 0 through 10 — 1 = 9, Fach digit in a binary number, say 111, is represented by a weighted power of 2, or Ix 274 1x 240% ae) x2” To convert the binary number to decimal, this weighted sum is determined a8 (1101), = 1x BL x 440 x 241% 1 = (13))q 0F one-one-zero-one in binary equals £3 in decimal. The rules for converting numbers between decimal and binary are covered in detail in Chapter 1, Data in the form of binary numbers are stored in registers in the computer and are represented as follows: 1011000111 “This isa 10-bit register, which might reside im the arithmetic or memory tt memory, the data in a single register are called a word (the word lenigihis 10 bits in this example). Patterns of ones and zeros are the only information that can be stored in a computer's registers or memory. The assignment of a meaning, to the bit patterns is called coding, and the codes used in most computers for dara are simply variations of the binary weighting scheme just presented. Nonnumeric (Input/Output) Codes. Although the computer employs binary data, users prefer alphabetic and nu- ‘meric data representations, for example, recordls of sales, lists of names, of (est grades. The set of alphanumeric symbols allowed for many computers is called the character set and fas a special binary-tike code called the American Stan- dard Code for Information interchange (ASCII). In this code the alphanumeric ‘and other special characters (punctuation, algebraic operators, and the like} are coded with 8 bits each: a partial listing of this code is given in Chapter #. Sup- pose we wanted to give the digital computer a message “ADD 1”. This message has five characters, the fourth one being a space or blank, In the ASCII code, our message becomes Symbol | ASCII Code ‘After our message is sent to the computer, a progtam in the computer's memory accepts it and acts accordingly. Section 0.3. Organization of a Stored Program Digital Computer 15 Instruction Codes ‘The computer's insteuetions reside in main memory and therefore, by definition, aire also represented by patterns uf ones and zeros, The instructions are generally broken dowa into subfields that are coded separately, These subfields are the ‘operation code (op code) and the niemony address. The operation code specifies the specitic function to be performed. 0.3.3 Computer Hardware Now, let us futther examine the interaction of the computer’s components shown in Fig, 0.7, Progruins ave stored in the computer's memory as discussed previously. However, the programs are inserted into: memory by the conte! unit in conjunction with the inpuoutput (VO) equipment, sometimes called peripheral devices. Programs are usually given to the computer from magnetic ‘or optical peripheral storage devices. The computer then fetches the instructions. ‘of the program ftom memory and executes them. Data to be used by a program are likewise transferred into memory fiom keyboards, seanners, magnetic disks, and other peripheral devices. Control Unit The controt unit follows the stored list of instructions, directing the activities ‘of the arithmetic unit aad I/O devices until the program has run ta completion. Each unit performs its task under the synchronizing influence of the control unit. Arithmetic/Logic Unit Arithmetic/logic units (ALUs) are combinational or sequential logic circuits that perform various operations on data, as instructed by the control unit. Each ALU is characterized by the type of data that it can manipulate and the set of operations that it can perform on those data. Most ALUs support operations ‘on integers of various sizes and may also include operations to manipulate fixed-point and floating-point numbers and variows nonnumeric data. Typical ALU operations include the following: © Avithinetic: add, subteact. multiply, divide. # Logical: AND. OR, exclusive-OR, complement (these will be defined when we examine combinational logic circuits in Chapter 2). © Shifi and rotate data © Convert data from one type to another Controt unit and ALU circuits are usually constructed from semicon- ductor devices packaged in a wide variety of schemes. Models of the second generation have transistors, resistors, diodes, and so on, mounted on printed circuit boards, while models of the third generation use small scale integrated 16 Chapter @ Introduction cuits on circuit boards. Fourth-generation machines use large scale and very large scale integrated circuits, Memory Units Computer memory units are classified as primary memory if they can be ac- cessed directly by the controf unit, otherwise they ure classitied as secemdary memory: Primary memory units in today’s digital computers are usually con- structed using high-speed semiconductor clements called RAMs (rundom- access memory) and ROMS (read-only memory). Most systems built privr to 1980, some of which are still in operation today, utilized arrays of magnetic cores as their primary memory elements, A few specialized systems, particu larly in space vehicles, utilized plated wire asa replacement for magnet in some applications where radiation hardness was required, Memory units are divided into cells called words, and each cell is known by its physical location, or memory address. The concept of a memory addrexs fora memory cell is equivaient to a mailing address fora mailbox. For example. every post office has rows of mailboxes, each identified by 2 unique numbered position. Simitarly, each memory cell resides in a unique numbered position, the number being the memory addres» Memory units may be characterized by their access and eyele Limes: memory access time may be defined as the length of time required 16 extract {read} a word from the memory, and memwry crete Hime nay be defined as the minimum interval of time required between successive ziemory aperations. The awcess time of a memary determi ly information can be obtained by the CPU, whereas the cycle time determines the rate at which successive memory accesses muy be made. ‘Secondary memory devices are used for bulk or mass storage of programs and data and include rotating magnetic devices, such as floppy and hard disks, magnetic tapes. magnetic bubble memories. uptical devices such as CDROMs (compact disk read-only memory) and a variety of other devices, I eanutant to primary memory. information in secondary memory deviees is nal accessed directly. Instead. a special controller searches the device t0 Ineate (he block of information containing the desired item. When found. the entire block is usally transterred into primary memory. where the desired items can be accessed in a more convenient fashion, ore Inpuv/Output Equipment The computer may output dats to several types of peripherals; a magnetic dish or laser printer is typicul. Cathode-tay tubes (CRTs) snd fiqued crystal Uisplay (LCD) panels are also available to display the results of a progestins calculations. Anulog-10-digital converters, digital-wranaloy converters. plot ters. magnetic reading and recording devices. and laser and ink-yel printers are the most commonly used inpuvoutput equipment Section 0.3 Organization of a Stored Program Digital Computer 17 0.3.4 Computer Software Software consists of the programs and data stored in the computer's memory. The software determines how the computer hardware is utilized and can be broadly classitied ay either application programs or system programs. Application Programs Progearuming the digital computer is the process of designing a list of instruc+ tions for the computer so that it can efficiently perform a specified task. The digital computer's instructions must be coded in patterns of ones and zeros before the computer ean interpret them. If all programs had to be written in this form, digital computers would enjoy very limited use. The patterns of ones: and zeros are vulled machine language instructions, and very few programmers ever attempt to write progeams in this manner. Asymboli¢ representation of the machine language of a computer. called assembly language, isoften used to develop programs. This isespecially true for small microcomputers embedded into kitchen appliances, electronic games, und aulomotive equipment. Assembly language allows a programmer to specify the ‘operations to be performed on data stored in che internal registers and memory of a processor without becorning bogged down in pattems of ones and zeros. However, most programmers prefer touse higher-level, more reasonable, symbolic lunguages in which to program their problems. By using high-level languages such as C, Paseal. Ada, or FORTRAN, the programmer has a wide ringe of instructions in a form that he or she can easily understand andefficiently use. with the instructions of each language tailored to specific types of problems, The full Nexibility of machine language isdifficul to incorporate into high-level languages. but a magaificeat amount fas been retained, especially in C System Programs System programs comprise all the software provided on a computer systema 10 aid programmers in the process or developing and executing application pro- rims, For example, whenever a symbolic language. either assembly language ‘ofa high-level language, iy used to write a program. the program must be irans- fated into machine language before it cun be executed by the computer. The question now arises as tv whe shall perterm this laborious (ranskation chore, The mest efficient transtuor is not the programmer, but the digital computer itsel!. Any job done by a computer is done under program control; therefore, the program that cranslates higher-level languages into machine language hes been given a special nante, the compiter. This translution process is illustrated in Fig. 0.9. Likewise, the progeam that translates assembly language into ma- chine language is called an assembler. Compilers and assemblers are (ypical exumples of system programs. as are the text editors used to type and alter program statements. 18 Chapter 0. Introduction Machine Janguage program Figure 0.9 Translation et computer programs into machine language. Now, let us contemplate the manner in which a given digital computer might be operated. A special program called the operating system handtes the routine tacks needed to change from one user's program io the next. This special program falls into a category of programs called system software, In pantcular three different operating systems will be diseussed: single user. batch processing. and time sharing If a machine is operated by cach user who executes a progeam. it is dedicated (0 this program and no one cle may use the computer until the ‘current user ied. The computer is then dependent on human intervention during the time between programs, and hence much time can be spent idling. ‘This operating system is convenient for the user if the computer is available when the user needs it, for once an individual is “on the machine,” that user may modify and reexectte programs or execute several successive programs before turaing the machine over wo the next user. The MS-DOS and Macintosh ‘operating systems are examples of single-user operating systems. The batch operating system eliminates most of the computer idle time by establishing one operator who collects all the user programs and feeds them 10 the computer continuously. The operating system program resides in the memory unit, and the memory locations it uses are protected from each user. “Thus, although idle time is reduced, the available memory storage for the user is also reduced, In addition, the user must wait for the operator to return her or his program, which is always a source of irritation and confrontation. ‘A more advanced operating system called time sharing allows multiple users to execute their programs almost simultaneously. Common examples are the UNIX operating system, used on a wide variety of personal computers, workstations, and larger machines, and the VMS operating system used on computers from Digital Equipment Corporation, Remote terminals consisting of limited inpuvouiput devices are connected to the digital computer, and each terminal is assigned 10 @ single user. The users are relatively stow while the ‘computer is extremely fast. This speed differential allows the computer to skip around between users, or time-share, in such » manner as to convince exch 0.4 Summary REFERENCES Section 0.4 Summary 19 user that he has the machine ail to himself. Although this operating system seems vety attractive, it has disadvantages, the first of which is cost. Also the time-sharing system program is complicated and long, which means it uses a Jot of memory space and computer time. In addition, since all users" programs are stored in memory simultaneously, each individual's available portion of memory is limited. Therefore, time sharing usually requires the maximum number of memory elements that a particular computer can accommodate, In this introductory chapter we have provided motivation for the material that follows. We have briefly explained what a computer is, how it is organized, the codes it employs, the manner in which itis programmed, and the hardware of which it is composed. The material contained in the remaining chapters is prerequisite to any hardware design or implementation for digital computers or other complex digital systems. The reader is referred t [1, 2, 3, 4] for further reading. 1.1. P. Haves, Computer Architecuure and Organization, 2nd ed. New York: ‘McGraw-Hill Book Co., 1988, 2. DA. PATTERSON AND J. L. Hennessy, Computer Organization & Design: The Hardware/Sofiware Interface, San Mateo, CA: Morgan Kaufmann Publishers, 1993. 3D. A. HODGES AND H. G. JACKSON, Anatysis and Design of Digital Integrated Circuits, 2nd ed, New York: McGraw-Hill Book Co., 1988, J.B WAKERLY, Digital Design Principles and Practices, 2nd ed. Englewood Cliffs, NU: Prentice Hall, 1994, Computers and other digital systems pro= cess information as their primary function. Therefore, itis necessary to have methods and systems for representing information in forms thai can be manipulated and stored using electronic or other types of hardware. Inthis chapter we cover number systems and codes that ave often employed in computers and digital sys- tems. Topics covered include binary, octal, and hex- adecimal number systems and arithmetic: base con- version techniques; negative number representation methods such as sign-magnitude, two's complement, and one's complement; numeric codes for fixed- and floating-point numbers: character codes, including bi- nary coded decimal and ASCH; Gray and excess codes and error detection and correction codes. Later chap- ters of the book cover the analysis and design of hard- ware to process information represented in the forms described here. Number System and Codes —) 1.1 Number Systems A number system consists of an ordered set of symbols, called digits, with relations defined for addition (+), subtraction (-), muliiplication (x). and division (=). The radix (7), oF base. of the number system is the total number of digits allowed in the number system. Number systems commonly used in digital system design and computer programming include decimal (r = 10), binary (r= 2), acu (r = 8), and hexadecimal (y = 16). Any number in a given system may have both an integer part and a fractional part, which are separated by a radix point (.), The integer part or the fraction part may be absent in some cases, Now let's examine the positional and polynomial notations for a number. Positional Notation Suppose you borruw one hundred twenty-three dollars and thirty-five cents, from your local bank. The check you are given indicates the amount as $123.35, In writing this number, positional notation has been-used. The check may be cashed for 1 one hundred dollar bill, 2 ten dollar bills, 3 one dollar bills, 3 dimes, and 5 pennies. Therefore, the position of each digit indicates its relative weight or significance. In general, a positive aumber N’ can be written in positional notation as we ay N=, (4,5 My @ ay where radix point separating the integer and fractional digits + = tadix or base of the number system being used wumber of integer digits ¢o the feft of the radix point wumber of fractional digits to the right of the radix point integer digit i when —1> £20 4, = fractional digit i when —1 > i> —m = most significant digit least significant digit 4,1 4. at 22 Chapter 1 Number Systems and Codes Tefal Figure 1.1 an et register Prep ye sy 1.2 Arithmetic Note that the range of values far all digits a, is ¢ — 1 2a, 20. Using this otiion, the hank loan amoont would be written $123.35). The parenthe- ses and the subscript denotating the radix may be elimi information if the radis is ether known by the context or otherwise specified. Polynomial Notation The €12: a Jolla loun amount cunt be writen in polynomial form as: x04 2 x 1043 «13M MTES < 0.01 aba We 2213s 43x10 1+ Sx MW? Note that euch digit resides i u weighted position and that the weight of excl position is a power of the radix 10. In general, any number A’ of radix ¢ may be written asa polynomial in the form et N= Yay 2) where euch synihol is defined the same as in Eq. 1.1, Forthe bank loun. r= 10, = ha, = Sanda, = ford 2 Fand ford = 3. N 1.1.2 Commonly Used Number Systems The decimal, binary, octal, and hexadecimal number systems are all important forthe study of digitat systems, Table 1.1 sunymarizes the fundamental features of each system and illustrates a timited range of positive imegers in each. All the numbers in Table J.1 are written in ponitional notation Digital systems are usually constructed using two-state devices that are either in an off state or an on state, Hence. the binary number system is ideully suited for representing numbers in digital systems, since only wo digits, O.und 1. commonly called bits, are needed. A bit ean be stored in a two-state storage device often called a farch. Binary aumbers of length vt can be stored in an 1-bil ong device known as a register, which is built with» latches. An 8-bit register Jouded with the binary number 10011010 is showa in Fig. 1.3. Every chile learns the udintents of arithmetic by memorizing the base-10 ad- dition and multiplication tables as shown in Tables 12a and b. respectively. Subtraction can be accomplished by using the addition table in reverse. Simmi- larly. tong division uses trial and error multiplication and subtraction to obtain the quotient. The foundation for arithmetic in any base ix a Knowledge of the addition and multiplication tables for the given base. Given these tables, arithmetic operations proceed in a sintilar manner for all bases, Arithmetiy in the binary, ovtal, and hexadecimal number systems will be introduced in the remainder of this section,

You might also like