Understanding digital electronics 9780895120175, 0895120178

992 242 38MB

English Pages 0 [264] Year 1978

Report DMCA / Copyright

DOWNLOAD FILE

Polecaj historie

Understanding digital electronics
 9780895120175, 0895120178

Citation preview

62-20 10

TWO DOLLARS AN D

Nll ~ E T Y- F I VE

CENTS

llad1e lhaeK .:.-

Understanding Digital Electronics This book clearly explains a wide range of digital electronic devices, circuits and systems -what they are, what they do and how they can be used - by making reference to a common digital system - the hand held calculator.

Developed for Rad io Shack by Texas Instrument s Learning Center

Understanding Digital Electronics By: Gene McWhorter Longview, Texas Staff Consultant, TI Learning Center Manag1:ng Editor: Gerald Luecke

Mgr. Technical Products Development TI Learning Center

Foreword is by Jack S. Kilby who, while in the employ of Texas Instruments Incorporated, invented the integrated circuit in 1958 and is c:o-inventor of the first handheld calculator. Mr. Kilby was presented the Na tional Medal of Science by the President of the United States in 1970 as r ecognition of the integrated circuit invention .

ltafl1e lhaeK M A DIVISION OF TANDY CORPORATION FT. WORTH. TEXAS 76102

This hook was dei,eloped hy: The Staff of the Texas Instruments Learning Center P.O. Box 225012 MS-54 Dallas, Texas 75265

W-i:th conttibutions by: Jim Allen Gene Marcum Frank Walters Ralph Oliva Appreciation is expressed to Walt Matzen, Phil Miller, Marcus Allen, Kirk Allen, and Doug Luecke for their valuable comments. De.~ign and artwork by: Schenck, Plunk & Deason

ISBN 0-895 12-017-8 Library of Congress Catalog Kumber: 78-57024

IMPORTANT Texas Instruments makes no warranty, either express or implied, including but not limited to any implied warranties of merchantability and fit ness for a particular purpose, regard ing these materials and makes such materials available solely on an "as-is" basis. In no event shall Texas Instrum ents be liable to anyone for special, collateral, incidental, or consequential damages in connection with or arising out of the purchase or use of these materials and the sole and exclusive liability to Texas Instruments, regardless of the form of action, shall not exceed the purchase price of this book. Copyrii;ht c' 1978 Texas Instrumen ts lncorporaled, All rights Reserved

Unless otherwise noted, this publication, or parts thereof, may not be reproduced in any form by photographic, electrostatic, mechanical, or any other method , for an y use, including information storage and retrieval. For condition of use and permission to use materials contained herein for publication i n other than the English language, apply to Texas Instrumen ts Incor porated. For permissions and other rights under this copyright, please write T exas Instruments Learning Center, P.O. Box 225012 MS-54, Dallas, T exas 75265.

ii

U~DERSTA N DING DI GITAL EL ECT RONICS

Table of Contents Foreword. Preface Chapter 1

2

3 4

5 6

7

8 9

10

. IV

v

Page Let's Look At A System. Quiz How Digital Circuits Make Decisions . Quiz Building Blocks That Make Decisions . Quiz Building Blocks With Mernory. Quiz Why Digital? Quiz Digital Integrated Circui ts . Quiz Mass Storage in D'igital Systems Quiz How Digital Systerns Function Quiz Programmed Digital Systerns Quiz Digital Electron ics Today and in the F utu re Quiz

Glossary Index .

U NDE HSTA!\Ul!\G DIGI TAL E LE CTRON ICS

. 1-1 1-27,28 . 2-1 . 2-23, 24 . 3-1 3-18 .. 4-1 . 4-17, 18 .. 5-1 . 5-23, 24 . 6-1 6-24 .. 7-1 . 7-25, 26 .. 8-1 8-30 . 9-1 . 9-25, 26 10-1 10-21,22 G-1 1-1

iii

Foreword Since 1958, a period of twenty years, digi t al elect ronics has become one of the most rapidly growing industries in the world. In that year, most of the digital applications were found in computers, and probably less than 1200 machines were completed during the year. Today, one manufacturer, of several, builds more than 1000 calculators every hour of the working day. To emphasize further the advances accomplished in such a short period of time, some of these new calculators have more computational capability than t he 1958 computers. Quite a digital evolution! Now, calculators and computers represent only one of the many uses of digit al electronics. Old familiar analog circuits in consumer produc ts such as radios and televisions have been re placed wit h circuits using digi t al techniques. New electronic products for new markets such as mi crowave ovens, sewing machines, TV games, are springing up each year. In fact, digit al circuits arc even replacing mechanical parts like gears and pinions - as in the modern digital electronic watches. This rapid growth has come about because of the almost ideal match between the digital electronic requirements and t he capabilities of th e integrated circuit. Digital circuits give "off"-"on" answ ers, permitting the use of components with wide tolerance wh ich are easier to make. Because they are han dli ng only in formation , t hey can operat e with very low power. As a result, they can be very small phys ically and many th ousands of di gital fun ctions ca n be built on a single integrated circuit chip at very low cost. It is also th e very low cost whi ch has been responsible for t he ra pid g rowth in digital functions. A digital circuit that makes a decision called a "gate" - which cos t several dollars in 1958 ca n be obtain ed as a pa rt of an in tegrated circuit t oday for less than a t ent h of a cent. A reduction of more t han a thousand to o n e~ These decreases in circuit costs a rc cont inuing , helpin g dig ital electronic systems of t he fu ture to cost eYe n less - and t o fin d even wider uses. The technical a nd economic forces which ca used th is r apid g rowth of digit al techniqu es will open up new applications areas for electronics. We ar e truly on the thres hold of an e ra where dig it al electronics will ha ve a pervasive presence. Jack Kilby

IV

l'K DE RSTANDING 01GITA L E LECTROK ICS

Preface If you have a junior-high-school background in electricity, plus a curiosity about how things work and a general awareness of electronics in use all around you, this book is for you. It's for you whether you are a PhD who hasn't studied digital electronics yet or an eighth-grader who wants to build h is own digital computer. This book won't show you how to build that computer. It will do something more important. It will give you imderstandi ngunderstanding of t he electronic circuitry in many types of digital electronics, from the basic idea of a transistor circuit saying "yes" or "no," to entire digital systems made up of thousands of such circuits. This understanding will serve you well whether you have your hands into real hardware or simply wish t o be in touch with the most revolutionary technology of our time. This book is different from many others, in that it's a self-teaching co1lrse. That means it builds your understanding step by step. You shouldn't skip around in the book or try to pick out indi vidual things to learn . Read one chapter at a time, beginning with Chapter 1. Quizzes are provided at the end of each chapter to review main points learned in the chayter. Try to master each chapter before you go to the next. This is to make sure you have a solid background for learning more advanced things late r on . Each chapter will move you rapidly to a new level of understanding. A glossary for all special words and an index are provided to aid in the understanding and use of the material. We who have prepared th is book hope that, as you go through it, you will feel some of the excitement that comes from learning about the marvelous th ings that digital ci rcuitry can do-and the even more marvelous things that are yet to come from this fascinating new creation.

UNDERSTANDING DIGITAL ELECTRONICS

v

===~=====L=E=T=~= LO = K=A=T=A=S='=)'S=T=E~=I===========--===-===-=======--=--=== ~ Let's Look at a System Stop! Think a minute! Haven't you been curious about those electronic games that you play on a television screen? Have you ever wondered how an electronic digital watch works, or a hand-held calculator? How about the computerized control systems used in automobiles, or that computer used at your bank, or the office, or in a small business, or for credit cards? All of these systems are digital electronic systems. "Digital electronics" means the kind of electrical circuitry found in such systems. This kind of circuitry is very different in design from that found in older, more common electronic systems such as radio and television receivers, high-fidelity sound recording and playback systems, and electric guitars. These systems use another style of electrical circuit design called linear or "analog'" electronics. What's special about digital electronics?

Digital and analog systems are similar in that they both use electricity, electronic devices such as transistors and diodes, and various other electronic parts. You can't always tell by looking inside a system whether it's digital or analog. The difference is in the way the systems use electricity - the things they make electricity do. This different way of dealing with electricity gives digital systems the ability to do almost unbelievably complicated things for you, without being very big or costing a lot of money. It's timely and important to learn about digital electronics because these sophisticated, compact, and economical systems are getting· even more so as time goes on. They are cropping up in more and more places - both as replace ments for analog systems and as entirely new ideas that were never possible before. And so to keep up with progress, it's not enough to know about microphones, loudspeakers, transformers, potentiometers, amplifiers, oscillators, mixers, tuners, detectors, filters, waveforms, impedance matching, feedback, frequency response, and other terms common to analog electronics. The wave of the future is with digital electronics, including terms such as gates, flip-flops, counters, registers, decoders, binary numbers, TTL, MOS, and microprocessors.

UNDERSTANDING DIGITAL ELECTRONICS

1-1

1 How will this book help you?

In this book, we're going to survey the field of digital electron ics, from a light switch in your house (yes, it's a diy'il,a/ device!) to a large digital computer. We'll learn the features common to digital systems, and how digital electronics works in a wide variety of ap plications. We'll see why digital methods are revolutionizing the field of electroni cs. And more than that, we'll learn what to expect in the future from this amazing t echnology, Furthermore, we're going to do all this without getting you bogged down in th e fine details of circuit design. Because one of the most marvellous t hings about digital electronics is t hat you can have a deep, sophisticated understanding of it without knowing very much about electricit y.'

Even if you already kn ow enough about both electricity and digital applications to tinker around a little bi t with digital circuits chances are you 'll find in this book a deeper, ri cher un derstanding of the subject plus its implica tions for the present and th e fu ture. What's a familiar digital system?

Rig ht away, we'r e going to find out just what a digital system is, and start learning how digital systems work. Let's begin wit h the digital system you're probably most familiar with personally - a small electronic calculator, such as the Texas Inst rum ents calculator shown in Figure 1-1.If you've got a hand-held calculator or a small desk-top model, stop reading and get it now. If you don 't hav e on e, perhaps you can borrow one - or you may want to buy one. It may help your learni ng and appreciation of this subject a great deal. Okay, now look at the calculator, and think for a moment about how small a nd inexpensive it is, considering the amazing things you know it can do.Just a few short years ago, an electron ic calculator that could add, subtract, multiply, and divide was as big as a large electric typewriter and cost maybe five hundred doll ars. And this illustrates what we said earlier about digital systems getting more sophist icated, smaller, and lower in cost as time goes on.

1-2

U>iDt:RSTA!\Dl :-IG DI GITAL ELE\TRU!\ICS

1

LET'S L OO K AT A SYSTEM

Now le t's consider what this calcula t or can do. Turn it on . Press the "3" key, noting what happens. The result may not seem very impressive at first - just a matter of a number "3" appearing in the display, r ight? What goes on inside a ca lculator?

But ask yourself what made t his "3" appear. Look closely at the lighted number itself. If your calculat or is li ke most, the "3" consists of five small lighted segments, out of seven segmen ts that can be lighted. When all seven segments are lighted, you get an "8". The segments in your display may be tiny red bars, rows of eve n smaller red dots, larger g reen bars, or dar k bars not ill um inated. These ar e all different ways to make the same basic pattern of seven segments. Now consider what mad e the part icular five segments turn on t o form the "3". App arently, pressing the "3" key sent some information somewhere inside t he calcul ator - some informa tion saying, " Remember number 3." And somewhere inside, something is remember ing "3". And somehow t his reme mbered "3" is making five particular segments of the display light up. Now go through the steps for adding five to the three and g etting t he total. The particula r keys you press at which times depe nds on just what kind of calculator you have. Most likely, you pr ess t he "plus" key, t hen t he "5" key, and finally the "equals" key. Note what happens as you go through the necessary steps to get t he tot al of five and three. First, th e "3" was replaced by a "5," right? So where did the "3" go? Apparently, it was still being remember ed somehow wi t hout being displayed. And the "5" was lighted up in the same way the "3" was earlier. If you pressed "plus" befor e the "5," th en something inside had t o remember you wanted to add the next number . If you pressed "equals" after the "5," th is ap parently caused the t wo numbers to be added, because now an "8" is being displayed. But what inside t he calculat or figured ou t this answer? And what happen ed to the 5 and t he 3? Where are t hey now? Obviously, there are some pretty complicated t hings going on inside this machine, even when we simply add t wo numbers less than ten. When we have answe red the questions as to how t hese numbers were transmitted from the keyboard, how they were added, how they were stored, and how they were formed on the d·i splay, we will have answered the questions of what a digit al system is, and how it works. So let's get star t ed.

UNt> F. J\STANDl NG D1 l:JTA 1, F:1.r: cTJWNIC~

1-3

l.iil f!!I = ==

LET 'S LOOK AT A SYSTEM

1

How can we simplify a calculator for study?

Let's limit our discussion at this point to a very simple imaginary calculator - one that will only add, subtract, multiply, and divide. Its display will handle numbers with only eight digits (numerals). It won't work exactly the same way as the calculator in your hand, so you can put yours down. But keep it handy for reference. Furthermore, let's say that the electronic circuitry in our example calculator is the simplest possible to handle these limited tasks. But the general way t he circuitry works is very much like the operation of most real calculators that will do more sophisticated things. First, let's consider the main parts of the machine, as shown schematically in Figure 1-2. (A "schematic" drawing of a circuit is one using simple symbols for the various parts and the interconnecting wires.) The large block at the bottom represents an integrated circuit - words we'll abbreviate to "IC." The 22 arrows pointing in and out of t he IC represent wires, and the arrowheads indicate the direction electric current flows. Segment Lines "a"' through '"h "' ......._ N INE CHARACTER

POSIT IONS IN DISPLAY

Arrow\.. heads

2 p } N

4 5 6 7 B 3 Scan Lines are energized one at a time, over & over

Keyboard inputs tell whether either key is ··on" for the scan line being energized,

Segment lines control display d igit being energized.

INTEGRATED CIRCUIT

Power Supply

l

+7

0

-7

volts

volts

volts

Figure 1-2. Schematic diagram of connections among IC chip, keyboard, and display in the simple example calculator 1-4

UNDERSTANDING DIGITAL ELECTRONICS

1

LET'S LOOK AT A SYSn:M

What's an integrated circuit?

Integrated circuits are the main reason digital systems are becoming more and more sophisticated, compact, and econo mical. They are a method of mass-producing complicated electronic circuits containing thousands of transistors, diodes, resistors, capacitors and the interconnecting wires in an unbelievably tiny form. Figure 1-3 shows a Texas Instruments calculator integrated circuit. It's a little package about an inch and a half long, half an inch wide, and an eighth of an inch thick (38 by 13 by 3 mm), with metal strips (pins) for electrical terminals. These st rips are connected on the inside to a little "chip" of semiconductor material called silicon. The chip, which is about a quarter of an inch square (6mm) and not much thicker than t he pages of this book, is shown in the enlarged photograph of Figure 1-3. As you can see, there are so many transistors inter connected with other components on this chip, packed so close together, that you can 't tell them apart. Many small calculators have all their electron ic circuitry packed into just one integrated circuit (not counting the batteries, keyboard, and display). That's a brief look at I Cs. We'll explain them further in a later chap ter. But for now, let's move on with our discussion of the calculator. What are the calculator parts outside the IC?

Looking back at Figure 1-2, we see 18 little blocks representing the calculator keys. Under each key is a schematic symbol representing a switch. One pole (terminal or connection) of each switch is connected to a horizontal "keyboard input" wire labeled Nor P. The other pole is connected to a vertical "scan line" wire (numbered 1 t hrough 9). Pressing a key closes (turns on) a switch for a momen t. This allows electric current to flow from one of the vertical scan lines to one of the horizon tal keyboard-input lines Notice that a custom in schematic diagrams is to use a little black dot to show when two wi res are connected. If t wo lines representing wires cross without a dot, they're not connected. Many of these "wires" would actually be little metal strips on a printed-wiring card. Real wires (or strips) are not always laid out so straight and neat as they appear in a schematic diagram. Above the keys are nine somewhat larger blocks called "character positions." These blocks form the display, where numbers as long as eight digits can be shown, in addition to a minus sign and various symbols for errors. We'll get to these in a moment. But first , let's talk about how the keys transmit numbers and commands to the IC chip.

UND ERSTAND ING DIGITAL ELECTRONICS

1-5

L E:T'S L OOK AT A SYSTEM

1

~ co,,'""'"'""""' ~ '"""" '" 'c ""'"

Figure 1-3. Photograph of a typical real ca,/cu/a/or chip made by T e:ras I nstruments Incorpora.ted, showing sorne of the su/1sy stems described f or a simpler calcu lator in F?:gure 1-6 How do numbers get inside the calculator?

Pigure 1-4 shows a close-up view of part of the keyboard for discussion purposes. At all times, the I C supplies power t o one of the nine vertical "scan lines" at a time, over and over, 1 through 9, thousands of times each second. When the IC is ready for the next keystroke, it looks for a signal comi ng in on the two "keyboard input" lines, labeled "N" and "P." When you pressed the "3" key, the correspond ing switch st ayed closed long enough for all the scan lines to be energized several t imes 1-6

U ND ER STANDI NG D IG ITAL ELECTR ONI CS

IJiil

1 = = =rm LET'S LOOK AT A SYSTE:M

in a row - no matter how quickly you released the key. (Compared to digital circuitry, the fastest mechanical switch is as slow as molasses in January!) And so pulses began arriving at the "N" input line whenever scan line 3 was supplied power in pulses. These pulses coming at these particular times told the IC that the "3" key was pressed. Similarly, when the "plus" key was pressed later on, pulses began coming in on the "P" line whenever scan line number 3 was energized. And pressing the "5" key caused pulses on input "N" when scan line 5 was energized. Pressing a ke y transmits pulses from a scan line to a keyboard input line

3

5

N

1234567

L------~ N

8

g

SCAN LINES

p }

""'KEYBOARD INPUTS

IC CHIP

Figure 1-4. Concept of p11/sesfro111 many k eys corning into only t wo input on the IC chip (.(rom F igure 1-2)

terminal.~

How are numbers shown in the display?

So that's how information gets into t he IC from the keyboard. Now let's talk about how numbers are illuminated in the display. Looking at F igure 1-2 again, each of the nin e character blocks is a position for one "character," meaning a numeral digit, minus sign, or error symbol perhaps including a decimal point to the right. Each of the nine positions is connected to one of the vertical scan lines, and also to eight "segment li nes" labelled "a" through "h." Each segment line is connected to all nine character positions and to the IC. Now look at the detailed view of one of the character positions, shown in Figure 1-5. There are seven little light-emitting diodes or "LEDs" forming a figure-8 pattern, and an eighth LED off to the right for a decimal point. ("LED" is pronounced by saying the letters: "L-E-D.") The LEDs are labeled "a" through "h," to match the segment-line designations. These dev ices are made of a special kind of semiconductor material that gives off light when electric cu rrent is passed through them in the right direction. UNDERSTANDING DtGITA L Et.F:CTRO!\l'-S

1-7

liil f!!I ==--------==

LET'S LOOK AT A SYSTEM

1

Each LED has two electrical terminals. One terminal on each LED is connected to the scan line coming up to that character position from below (bolder lines), and the other terminal is connected to one of the eight segment lines (lighter lines). To illuminate one LED segment, both its scan line and its segment line must be turned on by the IC, so that current can be supplied by the scan line and returned to t he IC by the segment line. (When a scan line is "on," it supplies electricity. But when a segnient line is "on," it accepts electricity or "sinks" electric current.) As a result of this arrangement, each character posit ion can be illuminated only when that particular scan line is supplying electricity. And the character (the number or sy mbol, etc.) that appears at that position is defined by which segmen t lines are turned on to allow current to flow. The IC is able to change the combination of active segment lines every time it energ izes another scan line. Scan Lines determine which character position Is "on". Segment lines define character In that position.

a b

c d

e I

SCAN LINES-

----

g

SEGMEN T

}

LINES TO

OTHER CHARACTER POSITIONS

h

To other character positions SEGMENT LINES

hgfedcb a SEGMENT DECODER DISPLAY REGISTER

Broad arrows indicate several wires running together, showing flow of information

Figure 1-5. Schema.tic diagram ~howing detai/8 o.f connections to eight

light-emitting diode segments at far left character position in calculator display shown in Figure 1-2. Arrowheads show direction electricity.flows.

1-8

UNDERSTANDING D IGITAL ELECTROK ICS

-=~======L=E=T=s=Lo =K·=.~=T=A=S=\='S=TE=')=I===========- = = ============== ~ For example, when scan line 9 and segment lines a, b, c, d, g, a nd h are "on," a "3" followed by a decimal point appears in the fa r right position. (Verify this by noting which LEDs in Figure 1-5 have these la bels and then look again at Figure 1-2.) Then as scan line 9 goes off and scan line 1 comes on in the regula r scan-line sequence, the "3" and decimal point blink off. And the character intended for the far left-ha nd position blinks on - if a ny is called for. The blinking is so fast that even t hough ea.ch character position is "on" only one-ninth of the time, your eye sees only a steady display. As you can tell, the IC is working like a demon, even when it's not calcula ting but merely showing you a number in the display. A thousa nd t imes every second, it has to be prepared to switch on a di ffe rent pattern of segment lines, while watching for pulses on t he keyboard input lines. This switching may seem fast to you, but it's actually slow compared to many other digital systems that we will djscuss in due time. Because it's capable of scanning with such rapid action, the IC can handle 18 swit ches a nd 72 LEDs with only 19 connections. A separate connection for each switch and LED wou ld cost much more (as we will see in a later chapter whe n we discuss how I Cs are made). It would thus cause the calculator to cost much more. What's inside the integrated circuit?

So that's how info rmat ion gets into an d out of the in tegrated-circuit chip. (Remember, we called it a "chip" because it's only about 14 inch on a side and paper-thin.) To know the r est of the story, we've got to look inside this IC. Figure 1-6 is a simplifi ed diagram showing the main electronic subsystems in t he chip simply as blocks. (A "subsyste m" is just a smalle r system inside a larger one.) The broad arrows re presen t pathways for information between subsystems. Each of these pathways is really several wi res running together to carry simultaneous electric signals. To appreciate how greatly si mplified this diagram is, look closely at Figure 1- S aga in. The Jong, narrow, light-colored strips are thin ribbons of me tal acting as wires in the pathways we're speaking of. Also shown in Figure 1-6 above are blocks representing the keyboard and display. Let's follow t he action as we add 3 and 5.

UNDERSTANDING DIGITAL ELECTRONICS

1-9

1

LET 'S L OOK AT A SYSTE M

:E

M

a:

0

c(

a:> CJ a: Oo

0

"0 ...a: (.) c(

g: :E

"'

:i

0

_, w

0

ow a: :E u

(.) z w CJ

z

a: ~ ~

0

"' a: ...... "'"' a:"'

u"' ::> a: Cl

.J

z

Cl

~

z

~cc :::> ~u w!!:

...

a:' u w c( cc ,_ a: ct m

a: w .J

"'~w

WI-

a: w

~

u

iii _,

.:::i

0

...a:z

0

u AIWn::Hll:J !:>Nl l.nO ll

a: w

...

"'aw

Q

a:

II)

c( ,_

a:

0::>

> ~

II.

"'0

ID II.

Q

>z w-

a: c(

"

0

m > w

'

"

§

I "'

,_a: zw we :E 0 Cl u ww t/)Q

CJ c(

a: a: w c( Q Oo mu >z Q

~w

.J

IL

a:

a:

,_w

,_w

"'5w

"'5w

~ _,

Q

a:

II.

"'0

a:

z a: w a. c(

0

,_a:w "'5w a: a: 0

i-z,_ (!j ~

c(

:

Cl

Cl) a: zW o z u w

! :E ::> (.)

u

c(

::;; imple terms-to a matt er of on or off, yes or no, 1 or 0. To handle information and tasks of any complexity whatever requires employing large quanWies of such simple statements and tasks, doing it. rapidly using code schemes by which many simple pieces of information can represent a more complex bundle of information. You'll see t his pattern in every digital electronic system. How does electricity suit digital system requirements?

Now we haven't made a point of it yet, but the fact is that you can build a perfectly functional digital system without using electricity at all. Nothi ng in our definition of digital systems says anything abou t elec tricity- just about breaking information into little pieces, about using numerical digits, and so on. One example we've already cited of a non-electrical system-even a non-binary one-is a mechanical calcu lator. Another example, a more up- to-date one, is certain binary digital systems employing devices t hat switch liquids or gases flowing in li t tle tu bes. We call these " fl uidic" systems. But t he reason that electricity has been employed for digital systems so successfully is that e/ectr-iral sicitching circuit.~ - wh i ch arc r elatively simple and inexpcnsi\'e compared to so me other electrical circuits-can be used to handle t he ve ry simple informat ion and tasks 1-24

==~=======L=~T=s=·=Lo = K=A=T=A=S\=-sT==E=~·============================== ~ involved in binary digital systems. These circuits are the fastest, most convenient method we know for such purposes. Why do integrated circuits fit In so well ?

The first dig ital electric systems used electromecha nical relays that actually contained little mechanical switches of the sort we have been imagining in sw itching circuits. Later digital electric systems used vacuum tubes instead. Soon th e transistor came along as a replacement, and then semiconductor integrated circuits. And here again we seem to have a marriage made in heaven. As we will see mor e clearly later on in the book, integrated circuits are naturally adapted to reducing simple switching circuits to microscopically small size, and packing countless thousands of the m into an unbelievably small space, lowering the cost per circui t sig nificantly. This capability throws I Cs r ight into t he arms of digi tal systems-which as we have seen involve ma.ny simple tasks and pieces of information . Integrated semiconductor electronics is the best way we have found yet to implement digital systems- and it's getting better all th e time as in tegr ated circuit technology improves so that more and more circuitry is pu t on one piece of s ilicon material. What do all systems do?

From here, we can move on to one more, even grander generalization drawn from our calculator exa mple, illustrated in Figure 1-20. This generalization is made up of two ideas. First, the only things t hat any system does, or can do, are to manipul ate inform ation and do work (or both). That is, all t hat's going on in any system is t he handling of various forms of informat ion, perhaps associated with the doi ng of work. DIGITAL SYSTEMS EX TERNAL FORM S OF IN FORMAT ION

/ /

I

SENSE (INPUT) (CONVERT) (DETECT)

are those that use dlgltal forms of ~ Information Internally ~

DECIDE (PROCESS)

- ..

I

f--------1

I

I

L-

AN D / OR WORK

ACT (OUTPUT) (CONVERT)

r I I

EXTERNAL FORMS OF INFORMATION

I oij

I

l STORE ( MEMORY)

I

I I

I

I

J

~

I I ________ _JI L

Figure 1-20. The universal system organization. All systems ma.m'pulate information an d /or do work u:;1'11g the same three or four stages. UNOERSTA NDINGDIGITAL ELECTRONICS 1-25

IJiil

1 f!!I= = - - - = = LET's LooK AT A Svsn :M

How are all systems organized?

And second, all systems are organized in the same fashi on. They do th eir jobs in the same general steps or stages. First, they sense (or detect, or accept) information in various forms from the outside world, and convert it to forms of information that cari be handled in the system. Then they make decisions based on this in put information-meaning t hey process or man ipulate the information. In doing so, they may store or remember some of the information for a time, or process it as a result of other information stored permanen tly. And fin ally, th ey take t he resultant new in formation and act on t he outside worl d with it- by converting it in to external forms of information again, and perhaps by exerting some cont rolled form of work or energy. Think of any sys tem you like, and th is univer sal organizat ional concept can be construed to apply to it. For example, our calculator's keyboard and encoder sense information and convert it into an internal form. Various subsystems deci:de and store. And the segment decoder and display system convert t he resulting internal information into the desired action of showing you numbers in the display. This "digital electronic" system, of course, is handling the information in digi tal form. How does this distinguish digital systems from others?

The significance of this universal system concept is that it shows us that digital systems are those that manipulate i nforrnat·ion in digital form, which we have seen means in the for m of digits -little separate pieces of information. There's only one other general method for handling information, and it's called "analog." In Chapter 5, we'll st udy the differences between these two kinds of information, and the two kinds of system that result. And now we really have come a long way! We've moved from a general understanding of a hand-held calculator, through an introduction to concepts of digital systems, to a grasp of the uni fyi ng concepts of all systems. This will provide a background of understanding as we proceed to dig into digital systems and see Jww they do the things we've been discussing. Take a break

As you come to t he end of each chapter, it will be a good idea for you to stop and take a breather. And before moving on to the next chapter, go back and study any of the parts t hat weren't clear to you at first. This is because a lot of the ideas covered in each chapter are necessary for your comprehension of material in later chapters. The glossary, and the quiz that follows each chapter, will help you review.

1-26

UNDERSTAKOING D IGIT AL BLio:CTRONICS

1

L ET 'S L OOK AT A SYsn

:M

Quiz for Chapter 1 1. H ow does t he calculator cir cuitry know which key caused a signal in a keyboard ·in put line? a. There's a differ ent input line for each key. b. There's a different scan line for each key. c . By noting which scan li ne is on when the sig nal is r eceived. d. B and C above. 2. Why do the numer als in t he display flicker (although faster than you can see)? a. They use alternating current. b. They're off while the controller re-checks the inputs to verify a sig nal was received. c . The segment out puts can transmit only one numeral at a t ime. d. The display register only stores one digit at a time. 3 . How is t he controller able to do so many different things at diffe rent times? a. It contains a special, different ci rcuit for each job it has to con trol. b . It really doesn 't control th e other subsystems - they pretty much act independen tly and automatically. c. It just repeats t he same process for each job it has to do. d . It's told what to do by instructions fetched from th e microprogram memory. UNDERSTANDING DIG IT AL ELECT!t ON ICS

4. How ar e operations in all

sybsystems kept in st ep together? a. Each sybsystem has a little "clock" unit. b . By control signals from the controller. c. By signals in the scan lines. d. By timing pulses in three networks called phases. 5. When the "equals" key is

pressed, how does t he controller know which arithmetic operation to perform? a. It checks a note it made about t his in t he flag regist er. b. The cu rrent microprogram instruction contains t his informa ti on. c. There's a place in each number register fo r minus signs, plus signs, multiplication signs, and so forth . d . It has already performed t he necessary operation and is just waiting to display t he result. 6. All the arithmetic in the

calculator is handled by a uni t that can only: a. Add b. Subtract c . Com pare t wo numbers d. A and B above

1-27

LF.:T'S LOOK AT A Svsn:M

7 . The switching circuit

controlling a wire in a binary digital system: a. Is either "on" or "off." b. Is often " part-way" on or off. c. Ca n be controlled by other Switching circuits. d. A and C above. 8 . A binary switching circuit can

indicate a choice be tween how many al ternatives (in one wire at one moment)? a . One b. Two c . Te n d. Depends on the circuit design.

9. What is a "bit" in a digital system? a . A binary digit (1 or 0). b. The basic unit of information. c . The smallest possible piece of information. d. All of the above. 10. Where do we get the name

"digital" electronics? a. You key in numbers wit h your fingers (digits). b. All digital systems use binary digits (bits). c . All digital systems use some sort of numberical digits (decimal, binary, etc.) d. All digital systems have digital numbe r displays as in the calculator.

1

11. Which binary number

represen ts "seven?" a. 1111111 b. 7

c. 0777 d. 0111 12. Wh ich of the following

man ipulate info rmation and possibly do work? a. All systems. b. Only digital syste ms. c. Only binary digital systems. d. Only elect ronic binary digital systems. 13. Which do all systems have in

common?

a. Sensing external information. b. Making decisions a nd

possibly storing information. c. Acting to produce external information and possi bly work. d. All of the a bove. 14 . Digital systems are those

which: a. Sense, decide, store, and act. b. Manipulate information a nd do work. c. Handle information in digital form internally. d . Deal with digital information in the external world.

(A nswers in back of the book) 1-28

U NDERSTANDING DIGITAL E tECTltONI C~

2

How DI GITAL CIRCUITS MAKE DECISIO NS

How Digital Circuits Make Decisions As we begin a new stage in ou r learning process, let's remind ourselves of what we have covered already, and why we did so. First , we gained a general familiarity with the operation of a s imple hand-held calculator. Of all digital systems, the calculator is perhaps the most fam iliar and intriguing, so it provided a good way to get us into th is su bject. And indeed we already are into the subject with both feet. Based on our study of the calculator, we have grasped the basic organizing principles that are common to all electronic digital systems. Some of these principles apply also to all digital systems, whether electronic or not. And some even encompass anything that we can call a "system" - even if it's not a digital system. And this is where we're going to pick up the subject now - with the universal system organization that we learned in Chapter 1, as we appl ied it to the hand-held calculator. This will lead us into our topic for this chapter. How does the universal organization apply to the calculator?

Figure 2- 1 shows how the various parts and subsystems of the calculator are categorized according to which of the "universal functions" they mainly perform - based on whether their primary job is to sense, to decide, to store, or to act. (There's actually a certain amount of decision-making involved in all four stages - but decisions are the main job only in the "decide" section.) IN TERNAL INFORMATION EXTERNAL INFORMATION VIA FINGER M OTIONS

I

SENSE Keyboard and

/

IN NECESSARY UNIFORM DIGITA L ELECTRICAL FORM

encoder

::~~~e~.

Adder-Subtracter

Routing Subsystem, Clock Generator.

\

,___

E XTERNAL INFORMATION AS P ATTERNS OF LIGHT

.---A_C_T_ __, \ _. ,

Decoder

,_____, ,

and display

Scan Gener a tor

Nu mber Regi sters,

Flag Reg ister, Address Register,

Instruction Register. M icroprogram M emory

STORE

Figure 2-1. Suh.~ y.~tems of calculator system from Figure 1-6, rear ranged to illustrate univer,qal system organization U s nrn STANlllNG DI GITAL E LECTRO:-l lCS

2-1

-

How

• === DIG ITA L CIR CU ITS MAKE D ECIS IONS

2

Chances are you pretty well understand how the switches in the keyboard sense external information from your fingertips, and how the light-emitting diode display acts to produce new external information in the form of patterns of light. And our initial picture of how switching circuits can store information is probably fairly satisfying to you for the time being. But you probably have some pret ty big question marks in your h_ead with regard to the decide function. How in t he world can electrical circuits actually make decisions? Can it be that electric circuits have some form of intelligence? Well, of course, they don't. But t his is indeed a natural question. And it's such a crucial question for digital systems t hat we're going to devote this entire chapter to it. What's the simplest example of decisions in the calculator?

Looking back at Figure 2-1, then, let's pi ck a very simple decision-making unit as an example to study, to hel p us grasp t he main idea of how digital circuits make decisions. Surprisingly enough, the simplest example is not in the "decide" stage (We'll postpone studying these more complicated subsystems un t il later). Instead, the simplest decisions are made in the keyboard encoder, over in th e "sense" stage. Figure 2-2 r eminds us of what the encoder's job is, and why this decision-making unit is classified in the "sense" stage rather t han in the "decide" stage. SCAN LINES FROM SCAN GEN ERA TOR

,,,,,..,.._, EXTERNAL INFORMATION IN FINGER

MOTIONS -··~

---- ----

/

TO D ISPLAY

t

R EGISTER \

KEYBOARD ENCODER

'

B IN ARY NUMBERS \ I /

---

/'



N

S IGNALS TO T ELL

p

CONTROLLER WH EN

KEYBOARD ,___ ___,

A N UMBER K EY IS

Keyboard-------~ Input Lines

"SENSE" STAGE

PRESSED AN D WH ICH OPERATION KEY IS PRESSED

Figure 2-2. The "sen .~e" stage of the calculator not only detects finger motions but also converts the resulting signals to forms suitable for other subsystems.

The "sense" stage, depicted in Figure 2-2, not only senses or detect s external information by means of t he switches in the keyboard but it also com;erts this information into a form t hat's con venie nt for t he other subsystems (which we have seen is the electr onic "binary code") by means of the encoder. This conversion process in volves decisions, as we will soon see - decisions that a re very well suited for introducing us to how they are performed. 2-2

U NDERSTA NDING D IG ITAL ELECTRONICS

How

= = =• 2

D IGITAL C IRCUITS MAKE DECISIONS

-

What steps are Involved in encoding numbers?

F irst, let's narrow the scope of our study of the encoder. It will be sufficient for us to find out only how the encoder generates the number signals to the display register , shown as a broad arrow emphasized by a circle in Figure 2-2. We wi ll take it for granted that the signals to the controller, shown further below, are produced in much the same fashion. (These signals tell t he controller when a number key is pressed - without saying which on·e - and when each of the "operation" keys is pressed, such as pl us, equals, and so forth.) So let's inquire into the decisions involved in encoding keystrokes into binary code. SCAN L INES

KEYBOARD INPUT

123456789

Li NES

1

i N

J

!I!J

j j j'

PART OF ENCODER SUBSYSTEM

SECTION 1: Which number key has been pressed?

p

- - A""num ber line.. is turned on w hen co rresponding key is pressed.

0

1

2

3

4

5

6

7

8

9

1 BINARY

SECTION 2: What's the right code for this number?

2

NUMBERS TO DISPLAY

4

R EG ISTER

8

Figure 2-3. The encoder uses two steps in converting keyboard signals into numbers.

The encoder generates numbers in two steps, and each step will illustrate a different kind of basic decision-making circuit for us. These steps are illustrated in Figure 2-.'l as two sections of the encoder. In the first section, some circuits of one kind decide which number key has been pressed, accor ding to which of the keyboard-input lines and scan li nes are "on." The answer is transmitted by turning on one of t en "number lines" leading down to the second sect ion. Down ther e, some circuits of the other kind decide which of the four wires leading to the display register to turn on, to transmit the number according to the binary code we learned back in Figure 1-18. UN DERSTANDING DIGITAL ELECTRONICS

2-3

How

DIGITAL C IRCl JI TS MAKE DECIS IONS

2

What does an AND gate do?

Let's look into the first sect ion shown in Figure 2-3, and consider the switching circuit that decides when to turn on the "number one" wire leading down to th e second section. Figure 2-4 shows what this particular circuit has to do, and where it gets its input information. Let's consider t his job carefully, because it's one of the most basic decisions in digital electronics. SCAN L INES

12345678

9

"1" key Is pressed Switching circuit must Iurn output wire on when input N and scan line 1 are on N

SECTION #1 FROM FIGURE 2-3

p

\ Bold lines are those "on·· - when .. , .. key is p1essed and scan line ·· 1 · · 1s on.

0

1 23"56

7 89

""NUMBER L INES.. TO SE CTION z: 2

Figure 2-4. The job of the type of switching circ1.cit .foimd in Section 1 of the

encoder shows what an AND gate does. We want this ci rcu it to turn on the "num ber one" wire whenever the "one" key is pressed on the keyboard. Remember now - pressing the "one" key causes keyboard input line N to be "on" when scan line 1 is "on ." No other keys (such as the other three shown in Figure 2- 4) will make both these inputs be on at the same time. Therefore, our "number one" switching circuit must turn on whenever both input N and scan line 1 are "on ." This circuit may be considered a "coincidence detector ," because it responds only when it discovers both input signals "on" at the same time. (Two things happening at the same ti me a re called "concident.") The ci rcuit can also be considered to be like a gate in a.fence, because an "on" signal in either in put causes the output to be in the same state as the other input. This makes it seem as though a "gate has been opened up" fo r sig nals in the other in put to "pass th rough." But an "off" signal in one input "shuts t he gate" against signals in the ot her input, causing the output to remain "off." This idea is where we get the name fo r the circuit . It's called a "gate." And since there are oth er circuits also called gates (which we will see in a moment), this kind is called t he AN D gate, with the "and" spelled in capital letters. 2-4

U ND EHSTANDING DI G ITA L f.1.r: CTRONI CS

How

2

D IGITAL

CIRC:lilTS ;\!.~KE

DEC ISIOl'iS

How does an AND gate work?

Before we see how all the rest of the t en "number wires" are turned on by AND gates, let's look at th e idea of how AND gates work, shown in Figure 2-5. Regardless of the details of circuit design (which we will study in due ti me), all AND ga tes fit the men tal picture presented in Figure 2-5. They all act as though they consisted of electrically-controlled switches connected "in series" as shown, wit h each switch t urned on by an "on" signal in a particular input wire. ("In series" means with the same current passing through both switches.) In this particular example, when "on" signals in both input N and scan line l t urn on both switches at the same time, electricity flows from the power supply to the output line. This gives us t he output signals we want for each of the possible combinations of input signals, as summarized in the "function table" in the figure. It's as simple as that. SCAN Une 1

Output Is on when scan line 1

ANO keyboard Input line N are both "on"

\

Customary symbol fo r "ground " - an ·electrical connec tion shared by all circ uits in the system and usually considered to b e at zero volts

POWER SUPPLY

FUNCTION TABLE • SCAN 1

N

OUTPUT

OFF

OFF

OFF

+

'---~-~-F . _ _~_F_: ~_:_~_-_~-------1-NP-u-rs~ ~1-t __

__...___

KEYBOARD INPUT LINE N --...

TO BE PRECISE IN DEFINING POSITIVE AND NEGATIVE LOGIC, ASSUME "ON" MEANS HIGHER , MORE POSITIVE VOLTAGE, AND "OFF " MEANS LOWER, MORE NEGATIVE VOLTAGE 0

1

OUTPUT POWER SUPPLIED IN "NUMBER LINE " TE LLS SECTION ::; 2 WHEN .. 1 . KEY IS PRESSED

Fig u re 2-5. General idea of how the A ND gate in preceding figu re works

Do you realize what you have just learned? Consider for a moment what a heavy idea has been revealed to you: ELECTRICALLY CONTROLLED SWITCHES CAN MAKE DECISIONS! We have wormed our way down to t he very foundations of our calculator - and indeed, the foundations of all digital electron ics. And down at the bottom, we have uncovered one of the building-blocks that all digital systems are made of. Connected together in the right patterns, large numbers of these AND gates - along with a few other very similar kinds of circu its - are what make ever y digital system work. UNIH : RSTANO ING DIG ITAL E L ECT RONICS

2-5

- -----

--~~

~~~--=====:---:=====

How DIG ITAL Crnt ·u1TS M AKE DECISIO:\S

2

- Again, we recogn ize the pattern we will see again and again in this fi eld: The deci8ions t.hat a system is r equired lo make can be broken up and subdirided inlv ff l'.I/ s 1:mple deci.~io11s . 'll:hich can bl' handled by r1·ry si mple electric circ uits (or better sti ll, electronic circui ts) . What's the customary symbol for the AND gate ?

Now in fini;;hing up our ex plana t ion of how the first section of our nu mber encoder works, we will need to show seve ral AND ga te;; in a small space. To avoid having to label each lit t le hox as an AND gate, we will use the customa ry sy mbol for AND gates, shown in Fig u re 2-ti. Note that t he output and all input;; are shown, but t he po\\"e r-supply connection is left off to keep the drawing simple. " AND" GATE Tw o OR MORE INPUT S

A

B

C

TRUTH TA BLE

Output 1s "yes" ( I ) only when all in pu1s are I .

FOR 3- IN PUT ··ANO . GATE

Ou1put is· ·no " (0) when any one o r more inputs are 0

A

B

c

0

TRUTH TAB LE

0 D

0 I 0 1

1 1

1 1

0

D 0 0 0 0 0 0

FOR CIRCU IT IN FIGURE 2-4. USING POSITIVE LOGIC

1

D 0 I 1 0 0

1

1

0 0 1

a ONE OUTPUT

0 1

SCAN I

N

OUTP UT

0 0

0

I

0

0 0 0

I

1

I

1

Figure 2-6. Custmnary symbol and precise de.finit ion~/" A ND ga.te. Jn the encoder, "ON" (higher voltage) means "yes" or 1, and. "u.ff' (lower voltage) means "no" or 0. whfrh is called "positive logic."

We're taking this opportunity to poin t ou t ;;omething new here in Pi,gure 2-6: three inputs are shown on this gate (labelled A, B, and C), rather than two. This is to shov,: you that an AND gat e can have rn.ore tha.n two inputs. Another thing new in F i:g ur e 2- fJ is tha t we're showing the

definition of an AN D gate more preci:;ely than before. An AND ga te is actually defined in terms of the logical meaning of t he inputs and outputs, in terms of the two basic bits of informat ion a wire can carry, rat her than in terms of t he electricity itself. As we learned in Cha pter 1, we call t he;;e hits 1 ("yes," or "true") and 0, ("no," or "false" ). So to be precise, then , an AND gat e is any cir cuit with t wo or more inputs and one output, whose output is 1 only when all the in puts a re 1. The output is 0 whe n any one or more in put s are 0. The larger table in F igu re 2-6 shows what this means in the case of a 3-input AND gate. It's a list of all the possible input combinations and the resulting out put fo r each combinat ion. It';; called the "truth table" for a 3-in put AND gate. 2-6

G !\DE RSTA:\lJING D IGITAL

Eu;crnONics

2

How 01 a decoder. The selected AND gate is enabled .to pass data from the data input. Other gate:; transmit only "O. " How do you " demultiplex" an input to one of several outputs?

Figure 3-11 shows a very simila r kind of "data-routing" buildingblock called a "demu ltiplexer." This one has the oppos·i te job from t he data selector- it routes data from one input (labelled F) to a ny one of several outputs (G, H, J, a nd K). As you can see, the selection process works t he sam e way as for t he data selector. What kind of building-block adds numbers?

Let's look at one more combi national buildi ng-block n ow- a fourbit binary adder. This unit's job is illustrated in F igur e 3-1 2 . It takes two four-bit binary numbers A a nd B, a nd produces a.five-bit binary sum of A plus B. (Not the Boolean "OR" function t his time, but an arithmetic sum.) Eac h 4-bil input ~ number can run from zero to fi fteen .

A

::.

B

::-

Al A2 A4 AB

Bl B2 B4 BB

. so we need five output wires, to han dle sums /as high as thirty . 4-BIT BINARY ADDER

Sl $2

$4 SB S 16

;

::-

S =A PLUS B

Figure 3-12. A 4-bit. b1:nary adder adds two 4-bit bina'l7/ num bers A and B, and produces a 5-b'il binary si1rn S . UNDERSTAN DING DIGITAi. ~l.ECTRON J CS

3-13

c==---

Bu1LDl~G-BLOcKs THAT MAKE DEc1sIO!'iS

3

As you can tell from the labe l "816," t his fift h output wire has a va lue of 16, compared to values of 8, 4, 2, and 1 for the other four. Each input number tan run from zero (0000) to fi fteen (111 1). So t he sum can run from zero (00000) to thi r ty (11110). If lhe "sum" output had only fo ur wires like the inputs, it coul--~~ A

8

8

c

c CONSTANT 1

J,

K,

J

K

J

K

0 CK

O CK

c

B

A ___j

(4)

(2)

PARALLEL

D (8)

15

COUNT REGISTERED

... 14

A B

0

0 0

J , - K,

0 ...

J,

=

K,

A·B

0

0 0

J ,, - K,

=

A·B·C

0

0 0

c

D

OUT PU TS

(1)

Fig ure 4 -12. Synch /'u 1w11s bi nu ry !,-hit cou 11ter..~hu1ci11g .'ia mp/e r--­ " SLAVE "

/

!

\ ] " MASTER"

" SLAVE"

:

" MAS TER "

fl ::~~ ~*~- i I

-...l.-

_ _L _

Dynamic storage circuit L----=-~-- -- for one bit. made of two charge-storage units 1n master-slave arrangement

I

_______:-: _______ J

Charge is stored 1n these ans 01 circuit. as if

~capacitors

¢1

0 VOLTS

CLOCK

- - --

TIMING DIAGRAM : ¢2

-1-----

- 12 VOLTS

0 STORAGE TIME FOR ONE BIT

\

VOLTS

-t2VOLTS

Negative pulses turn transistors " on"

L - - - - - - - - - - - - - - - - - - - - -....~

TIME

Figure 7-6. Simplified idea of a typ'ica.l MOS dynamic shift register UNDE RSTAN DI NG DIGITA L ELECTRON1CS

7-9

~

MASS STORAGE IN DIGITAL SYSTEMS

7

~ =================================== How do dynamic shift registers compare with static shift registers?

If you'll compar e the master-slave dynam ic storage circu it in Figiire 7-6 with t he more complicated master-slave flip-flo p in F igure 4· 5, you'll see why dyn amic storage units occupy less area on a chip. As we noted ea rl ier , t his is why dynamic shift registers cost less pe r bi t of storage capacity than stat ic sh ift regist ers. Dy nam ic shift r eg isters have another advantage, in that t hey can be clocked faster than MOS static shijl registers (perhaps 5 megahertz compared to 2.5 megahertz. Remember, a mega hertz is a million times per second). When even faster shifting is required, we've got to use bipolar circuitry (fl ip-flops), at a much greater cost per bit. Later in the chapter , we'll see a nother kind of dynamic storage un it. But fo r now, let's look back at Fi.qure 7-2 for a moment. We've covered the two types of serial-access memor ies t hat use integrated semiconductor storage elements (stalic and dynami c shift registers). So let's move on to learn about mass memories with random a.ccess. We'll begin with t he category of "read-only memories" or RO Ms. (ROM rhym es with "Tom.") Here again, we're on fai rly familiar territory, since the microprogram memory in our calculator (Hgure 7-1) would be a RO M. So let's use the example of t he microprogram memory as a jumpi ng-off point into random-access memories. How does the microprogram ROM illustrate random access?

First, let's recall from Chapter l what t he microprogram memory does, as shown in Figure 7-7. To begin with , the controller puts an "address" number in the address register. In response, the memory unit locates an instruct ion (stored when t he chip was made) in a place iden tified by t hat addr ess withi n t he me mory. A copy of t he instruction is put in t he instruction register for the con troller to use. Note t hat auy instruction can be " read" at any time, in a ny order. So this is a ra nt/0111-acce.~s rather than a serial-access memory, but one tha t can only be rea d. not \\"ritten into. You can't change t he data stored at any memory location.

MICROPROGRAM MEMORY UNIT ( READ-ONLY MEMORY)

CONTROLLER

256 16-BIT INSTRUCTIONS

-

16-Bn

INSTRUCTION REGISTER

Figure 7- 7. Summary of the j ob ofa nt·ic;-oprogram memory unit in a typical calculator 7- 10

UNo ~;RSTANDING D I GITAL Eu;crnoN1cs

~

7 =======-==========================--== ~ MASS STORAGE IN D IGITAL SYSTEMS

Both the addresses and the instructions are in binary fo r m, consisting of ones and zeros. A typical calculator might have 256 instructions, each consisting of 16 bits, for a total of 4,096 stored bits. To coun t addresses from zero (00000000) to 255 (11111111), each add ress must be eight bits long. To begin understanding how such a memor y works, let's first see the general way in which the storage units are arranged in all random-access me mories- both the "read-only" types and others we'll come to later. How are storage units arranged for random access?

Figure 7-8 shows the general idea of how one-bit storage uni ts (or "cells") of any sort would typically be arranged so that stored information can be read out at random. (The same arrangement works for writing too, as we'll see later.) For the sake of simple explanation, this memory stores only 16 bits, as eight "words" of two bits each. A "word" is a group of bits that arc stored together in a random-access memory, and also processed together when possible. (For example, each 16-bit instruction stored by the microprogram memory in Figure 7-7 is a word.) 00

ROW DECODER ACTIVATES ONE " ROW-LINE"

01

10

Each s1orage unit transmits its b it when its row -tine is aclivated .

11

All bits on selected ..,_ row are transmitted in column-lines.

control row decoder. Other bit con trols column selector

"

COLUMN SELECTOR

/

I

/

/ /

/

....., Data selector selecls " two column-lines for ~ a two-bit word output.

L---------------'

A DDRES S REGISTER

......................... WORD OUTPUT REGISTER

Figur e 7-8. A .~i mple random -access memory storing eight 2-bit words, slwwing typical rectangular pattern and method of "accessing" by row and column lines UNDERSTAN DING D IGITAi. ~~LEl:T RONICS

7-11

~

MASS STORAGE IN DIG ITAL SYSTEMS

~ ==-~===--=

7

The one-bit storag e cells in Fig u re 7-i'J are arranged on th e chip in a square pattern of four horizontal " rows" and four vertical " columns.'' Each cell is connect ed to one of fou r horizontal "row-lines" a nd one of four Yertical "column-lines." The two cells for a g i\'en word are on the .~a me rnw lin e. (By compari son, th e calculator ROM wou ld ha,·e 64 rows, each storing fo ur 16-bit words.) Addressing eight words requires thre< ' -hit add ress numbers, running from zero to seven. (In Fi,q ure 7- 8, we 're addressing word number five-101). Two of t he address bits go to a " row decode r,'' causing it t o act ivate one of the four row-lines (in the figure, it's row number t wo, or binary 10). Thi s makes all four cells in th at row transmit their bits in their column lines. Of these four bits, t wo (one word) are selected by the "colum n selector." This is a dat a selector con t rolled hy the remaining bit of the address (l, in the e xample) . Thus, th e add ressed word ( 10) is placed in the "word output regi ster." Nearl y all random-access-t ype me mories use one rnri a tion or another of this basic idea of a rect angular " ar ray" (arrangement) of one-bit storage units. It allows the storage uni t s to he packed closel y together, without an excessive amount of interconnecting wires. With th is unde rstanding of random-access memories in general, let's look in more detail at a read-only memory. This will be a particular kind of ROM-on e t hat's made in a p-channel MOS integrated circuit, such as a calculator chip. How does an MOS read-only memory work?

Figure 7-9 shows four bit-storage cells at the lower left corner of a ROM array of any size. Each cell (shaded blocks) is sim ply one MOS transistor- or rather, it is if a "l" is st or ed. If a "O" is stored, t he cell is an incomplete transistor, wi t hou t a g a te, so it can never be t urned on. The row decoder transmits a " low" voltage (negati ve 5 volts) in the selected row line. This t ur ns on all tra nsistors storing"!" on that row, connecting a column line through each MOS t ran sistor to a "ground line" at zero volts. Thus, a " l " is transmitted in a column line to the column selector as zero volts. Other.vise, if a column has an incomplete tran sistor on t his row (meaning 0), the column is kept at negative jive volts by a "load" transistor down below. (This should sound familiar to you. Each col umn-line with its transistors, ne ighboring ground line, and load transistor acts as a many-input negative NOR gate as in Figure 6-5.)

7-1 2

U l\DERSTA NDI NG Dir. ITAL ELECTRONICS

~

7 ================-==--~==========-- :-==== ~ MASS STORAGE 1:-1 DIGITAL SYSTEMS

Each vertical line is a long "p" region 1n chip.

p

I (COLUMN LINE) I

p

p

(GROUND LINE)

( COLUMN LINE)

Each row line is a long metal sl rip across " p " regions.

r-TH1C; Ox-;-o~ *1

ROW DECODER

:

T ...._"""i+-~

l- -~~~ --; L -~~~ - - 1

)

r - ---- --, 1 TH ICK

I

...._.,-1-..,.:~

Ox1or."" I•

T

IL_ _ _" O" _ __ _

-17 VOLTS

Two p -reg1ons form column lines.

L

:

J•

-17 VOLTS OVOLTS _ , _ -

(SUBSTRATE)

TL -s voLTs_Jf !._ ''LOAD ' ' TRANSISTORS ~

._______--] -

--COLUMN SELE CTOR

COLUMN LINE

Tiny area ol th1n oxide allows row line to acl asMOS gale. storing " 1..

LINE

prevents transistor action. sronng " O"

F igure 7-9. Schematic diagram and simplified drawing of the permanent

bit-storage cells in a p-channel MOS read -only rnernory Fu rther below in Figure 7-9, you'll see how t his array of cells is built with very high den sity (low cost per bit!) in an IC chip. Each row line is simply a long metal strip over the oxide layer. Each column line and ground line is a long p-region running crossways under all the row lines. Whe re a tra nsistor is desi1 ed (for permanently storing a " l "), the oxide is made very thin under the metal wh ere it crosses over the silicon between a column line and a g round line. Where the oxide is thicker, the electr ic field from t he metal is too far from the silicon to "turn on" a chann el as we discussed with r ega rd to Figure 2-12 for n-channel t ransistors. (Remember, we mentioned thin oxide for the first t ime in di scussing Figure 6-6.) UN DERSTANDING DIGITA L ELECTRONICS

7-13

n

MASS STORAGE IN DIG ITAL SYSTEMS

7

~===================

Beside its high density, the most useful fea ture of this ROM construction is that the "thin-oxide" areas are created in only one step of plwtomaskin,q and etching ofoxide. (Remember, we discussed photomasking back at Figure 6-2, although not this particular step.) So it's relatively easy for the factory to "program" a customer's specified information into a ROM integrated circuit. The ROM then becomes a special product supplied to that customer, typically in rather large quantities for assembly into a system built for sale by the customer. Similarly, a general-purpose calculator chip can be programmed for special functions required by a particular calculator model. Are there any other kinds of read-only memories?

MOS ROMs with cells similar to those in Figure 7-9 are the most commonly-used read-only memories. However, for faster access (getting a word out quicker), there are ROMs ~ hat use bipolar rather than MOS transistors-but we pay for the.higher speed with much lower packing density and therefore higher cost. Furthermore, there are certain MOS RO Ms that can be programmed by the user after they're made, called "programmable ROMs," or "PROMs." However, this "do-it-yourself" programming requires connecting the IC to a special electronic system designed for this purpose. And finally, there are some kinds of PROMs that can be erased and reprogrammed with new data. These are called "eraseable" PRO Ms, or "EPROMs." The erasing is done in a special system that exposes the chip to ultraviolet light. Although PRO Ms and EPROMs can be very useful in certain applications, their bit density is lower than that of plain RO Ms, and they cost quite a bit more per bit of storage capacity. While we're consider ing variations on the ROM idea, you sh0 1ld be aware that the high-density arrangement of gate strips and diffused strips in Figure 7-9 is often used in building-blocks such as decoders and encoders. As you've seen, this is basically a way to make a close-packed row of negative NOR gates (positive NAND gates). Because of the ease of "programming" the MOS gate connections as we've seen, a ROM used as a logic network is called a "programmable logic array," or " PLA" (pronounced letter by letter as "P-L-A"). PLAs ar e one feature of MOS in tegrated circuits that gives us very high-density, economical IC chips. 1

How are random-access memories different from RO Ms?

Although RO Ms are accessed in a r andom fashion as we've seen, they're not called "random-access memories." That name is reserved for memories that can be written into as well as read from. The name is abbreviated to " RAM," pronounced like the word for a male sheep. Later on, we'll consider how RAMs are used in electronic systems. But for now, let's find out how RAMs are made and how they work.

7-14

UNDERSTANDING DIGITAL ELECTRON ICS

n

7 =================== ~ MASS STORAGE IN DIGITAL SYSTEMS

As we learned earlier in the case of shift registers, there are also two general types of RAM: dynamic RAMS t hat store bits in the form of electric charges, and static RAMs that store bits in flip-flops. Let's look first at dy namic RAM s. How do dynamic RAMs work?

Dynamic RAMs fit the general patte rn for all random-accesstype memories that we discussed in Figure 7-8. (Remember, we said you'd see those general features in all memories with random access.) Electric charges are put into the cells through the column lines and read out through the same lines, using appropriate switching circuitry in the "column selector" section. As in all dynami c storage units , the stored charges decay in a fraction of a second, so they have to be ··refreshed'" often by one method or another. Figure 7-10 shows the general idea of one of many types of dynami c RAM. Due to the exceedingly tiny size of each storage cell, this one integrated circuit (perhaps 0. 16 inch or fou r millimetres square) can s tore 16,384 bits in 128 rows and 128 colu mns. / One row-line al a time is activated.

ROW DECODER

\ 16.384

Ab1tis!d~ o~---

as presence ) absence of c hange on a capacitor.

WORO ADDRES S

R EAD / WRITE

CONTROL 0ATA INPUT

DATA OUTPUT

T~

COLUMN DECODER PLUS READ, WRITE, & REFRESH CIRCUITRY

Spare dynamic storage units for all column-lines shift stored bits out and back into all cells on addressed row to refresh charges.

Figure 7-10. General idea of a I 6,384-bi l dynamic RAM that uses n-channel storage cells

one-t ran.~istor

UN DERSTANDI NG D IGITA L ELECTRONICS

7-15

~

MASS STORAGE IN D IGITAL SYSTEMS

7

~=================--=================== Each cell consists of one n-channcl MOS tr ansistor and a tiny capacitor -which as we noted earlier is a device that stores electric charge at a certain voltage. Each capacitor is simply a small area of metal over the oxide. When a row-l ine is activated (with a higher voltage), all the n-channel transistors on that row are turn ed on, conn ecting their capacitors to their col umn lines. By way of the column lines, the capacitors are charged when "writ ing," and the charges ar e detected when "reading." We won't go further in to electrical details. Suffice it to say that words from the "data inpu t" in Figure 7-10 are written into the capacitors as electric charges by voltage signals through the column lines, and read out the the "data output" throug h the same column lines. The "read-write control" input tells the subsystem whether to read or write. Such a memory can be designed to handle words of any length (from one to 128 bits in this example), so we're not specifying word length in the figure. Every time a row-line is activated, the charges in all cells on that row are refreshed automatically by a "spare" dynamic storage unit shown at the lower end of each column line. The stor ed bits are shifted from the cells on the row being accessed, into the spare storage units, and right back in to the cells again, with renewed strength. This process resembles the shifting of bits in the dynam ic shift register in Figure 7- 6. Any reading or writing that needs to be done takes place at the same time, for selected columns. (As we've noted before, the reason the stored charges need to be refreshed is to prevent the stored data from being lost due to leakage that changes the voltages.) To make sure all cells are refreshed often enough, the system controller (not shown) typically stops its work for about 50 microseconds (millionths of a second) every two milliseconds (thousandths of a second). During this time, the controller addresses one word on each of the 128 rows. This triggers the automatic refreshing process that we spoke of in the preceding paragraph, for each row addressed. To summarize the features of dyn amic RAMs, they use very small cells- as small as one transistor and one capacitor, as we've seen. This gives us very high packing density, and therefore low cost per bit of stor age. However, to get this advantage, we have had to add the additional refresh circuits a nd program the system's controller to do a "refresh" cycle several hundred times a second.

How do static random-access memories work?

If we can't live with the complication of the refresh cycles, we have to use a RAM of the static variety. Static RAMs use a.flip-flop for each storage cell, in the row-and-column arrangement that we've become familiar with. The flip-flops can be made either of bipolar or MOS transistors. As you mig ht expect, MOS g ives us higher density (lower cost per bit) but lower access speed. 7-16

UNDERSTANDI NG DIGITAL ELECTRONICS

7

MASS STORAGE IN DIGITAL SYSTEMS

- - f13

As with any kin- "'>iii iii a:

'"

' "'

Qo

-

~.

0-

to~

Cl R.

ti ~

~ ~·

0- ;:l

..... ~

BINARY ADDER

c z w :::> ~

:I!

"!

c z

w :r

Vl

0.-> .

~ ~

... !;)

;:l -

"'~ p

~

:R. "'· 'S. ~

-"'"' "'~ ;:!

'ti

p

l

:E1 I

l

000000 10 0000000 1

B, B,

00000000

B,

I

•• A,

I

B, B

I

c,.,

~8

'

0000001 1 000000 10 00000001

;:::;

~

~ DIFFERENCE

00000000

~

en -