You are on page 1of 12

Basic Microprocessor Architectural Concepts CHAPTER OBJECTIVES Over the years quite a number of different microprocessors have been

developed. Each new one focuses on a particular application which it performs very well. The differences between these microprocessors, and therefore what makes one microprocessor better for a particular application than another one, arise from the differences in their architecture. 2-1 What is Microprocessor's Architecture? We said it is the "the general way in which the computation are done." That is very broad definition of a microprocessor's architecture. In this chapter, we will look at a number of exampled to help understand microprocessor architectural concepts. Although we know there is no precise definition of architecture, these examples should help our understanding. We all know that the person who designs building is an architect. If we follow this line of thinking a bit further, we realize that while all building perform similar functions - that is, they keep the weather out they do it in different ways. The same is true of microprocessors. There are many different ones. Most try to do same job, but the internal structure which they use to do the job is different. That is, their architecture is different. The basic job of the microprocessor is to process data. The data processing is done using a general-purpose integrated circuit. The design of the integrated circuits lets the user program the function as one would program a general-purpose digital computer. In this, all microprocessors are alike. How are they different? For some microprocessors, the architectural differences are small. For others, the differences are large. For example the Intel 80518-bit single-chip microprocessor and the Intel 486 32-bit microprocessor will both add two numbers. The way they add the two numbers and the parts they use to add the tow number and the parts they use to add the two numbers are quite similar. However, if you ask a programmer to make each of these microprocessors compute the cosine of an angle, the way they perform this task and the parts hey use will be very different. Each of them can do the job, one will great ease and one with extreme difficulty. They have very different architectures. In this chapter, we will look at some of the major sections of a microprocessor design which contribute to architectural differences. We will also try to understand where and when these architectural features are important and they are not. Like a building, the architectural features of a microprocessor cost money. Greek columns cost a great deal more than wooden poles with the bark on However, poles with the bark left on do not look right holding up the roof of a courthouse. Likewise, Greek columns are really not necessary to hold up a shed covering hay. There are places for 4-bit microprocessors, and there are places for 32-microprocessors. To use the microprocessor intelligently, we must understand the differences.

What are some of the major architectural differences between microprocessors? We briefly looked at three major differences in the first chapter. They are The length of the microprocessor's data word The size of the memory which the microprocessor can directly address The speed which the microprocessor can execute Although these are some of the major architectural differences bet microprocessors, there are other important ones which you must know if you are to use the microprocessor with the understanding. Some of these additional architectural differences are The number of register available to the programmer " The different types of register available to the programmer

The different types of instruction available to the programmer The different types of memory addressing modes available to the programmer The different types of support circuits available to the system designer Compatibility with a readily available development, system and application software Compatibility with hardware development systems As you can see from the list, there are many differences between microprocessors. These differences make some microprocessor better for some applications and some other microprocessors better for other application. Some microprocessors are better because they appeal to the user more than another which might work equally well in the same situation. In the following sections, we will look at these differences in more detail. You will find, however that as the microprocessor's word length grows its other features tend to grow. That is, microprocessors with a long word also tend to have extensive instruction sets, many register, a wide variety of addressing modes, and lots of applications software. This means that the choices may not be as great as one might first think when looking at the above lists of microprocessor architectural differences. 2-2 Word Lengths The microprocessor started as a 4-bit device. It has progressed to an 8-bit, a 16-bit, a 32-bit, and now a 64-bit device. If 16- and 32-bit microprocessors can outperform the 4- and 8-bit microprocessor, why do the smaller devices remain in existence? What is the reason that the shorter-word-length architecture is still used?

The answer to this question lies in the definition of performance. Our initial idea of performance is usually speed - how quickly the microprocessor will perform its intended function. This thinking tell us that a microprocessor with a longer word length will solve more problems faster. Therefore, a longer word length should give a better solution to all problems. However, one must first ask, do I need to solve variety of problems? Suppose you are trying to build a simple microprocessor - controlled toy. Solving problems where you need to calculate the cosine of an angle are the farthest thing from your mid. On the other hand, the cost of the product is very close your heart. You can pay as little as 50 cents for 4-bit microprocessor which will do the job. This means that the dollar you would add to the product for an extra 4 or 12 bits of data latch to support a bigger microprocessor becomes a lot of money. In this example, the real performance issue is cost, not horsepower. In almost every case, the longer the data word, the more the microprocessor and its support components cost. Figure 4-1 shows three typical board-level microprocessor-based systems. From this you can see that the number of support circuits typically used with a microprocessor grows with the number of bits in the microprocessor's data word. What are some of the application area that the various data word lengths fall into? As we have seen, the 4-bit microprocessors are very good for low-cost applications. The typical 4-bit microprocessor cost well under $1 in volume and requires very few support parts. As noted before, they tend to be simple microprocessor designed for simple applications. 4-bit microprocessor applications Toys: robots, remote-controlled cars, handheld games Calculators: financial, scientific, data base Power tool controllers: speed controls, sequencers, measurement devices Simple, intelligent consumer product controllers: microwave ovens, telephone, dialers, smart thermostats, shortwave scanners, TV remote controls

Computer peripherals: keyboard scanners, simple printer, clocks All of these examples have two common features. First, all of the end products are low cost. Second, none of the applications is particularly demanding. For example, you may say that the scientific calculator must perform some difficult calculations such as sine's, cosines, or logarithms, but these calculations can be done very slowly in hand-held calculator. The 4-bit microprocessor is quite capable of either high-speed simple operations or complex operation at a slower speed. It just cannot do both at once. What are some applications which need the power of the 8-bit microprocessor? Where do we need additional speed, a greater word length, a more extensive instruction set? We must also ask, what application can afford a little more money for the microprocessor? The typical 8-bit microprocessor costs $2 to $4. It must be combined with another $5 to $10 of support circuits before a working system is built. If an 8-bit single-chip microprocessor is used, only a limited number of support circuits is needed. But, the cost of the 8-bit single chip microprocessor is about $4 to $5. So, for an application which really needs the 8-bit microprocessor, you must pay three to five times as much as for the 4-bit microprocessor. 8-bit microprocessor applications include: Toys: video games, programmable robots Complex, intelligent consumer product controllers: VCR control and programming, security systems, lightning system controllers Computer peripherals: video displays, higher-speed printers, modems, plotters, disk controllers, communications controllers Industrial controllers: robotics, substation data gathering, process control, sequence control, machine tool control Instruments: logic analyzers, communication analyzers, disk drive testers, digital ossiciloscopes, smart voltmeters The common feature of these products is a much higher product cost to the user. The end customer knows that the product is worth more and expects to pay more that for the products in the 4-bit microprocessor applications list. That is why these products can afford the extra cost of an 8-bit microprocessor. We also find that the tasks that the products are asked to do are more complex. This means that the microprocessor's job is going to be harder. The microprocessor must process more data and do it faster. In many cases, the processing must be done fast enough for a machine rather than for human being. For example, the microprocessor used in a hand-held game only need to respond as quickly as you can press the keys on the game's keyboard. On the other hand, the microprocessor which controls a dot matrix printer attached to your microcomputer may receive the data to be printed at a rate of 1000 characters a second. Because the printer cannot hold all the data the microcomputer might send it, the printer must send the microcomputer control signals. These signals tell the microcomputer when to send the data, and when to hold the data because the printer's memory is full and waiting until more printing is done. At a data rate of 1000 characters per second, this signal to the microcomputer must happen very quickly. This is a machine-to-machine response time, not a machine-to-human response time. To data, 16-bit, 32-bit, and 64-bit microprocessors have found one high-volume application and a number of lower-volume applications. They are the heart of the personal computer (PC). First introduced by IBM in the summer of 1981, the personal computer was based on the Intel 8088 microprocessor. Internally, the 8088 microprocessor is a 16-bit processor, but externally it uses an 8-bit bus. This feature allowed the first PCs to be developed using lower-costs external parts. However, the 8088's internal 16-bit architecture makes the PCs upwardly compatible with newer version of the PC which is based on the 16-bit 80286 microprocessor or the 32-bit 386,486, and Pentium microprocessors.

The introduction of a microcomputer based on the microprocessors created a large base of development systems and applications software. It has also caused many manufacturers to produce PCcompatible machines and PC-compatible accessories. The great rush to become involved with personal computing through the use of a PC or PC compatible has produced a wide variety of application for PCs. Most of the applications use a complete PC rather than just one of the microprocessors in dedicated hardware. Therefore are, however, applications, especially within the industrial, scientific, and medical application area's where special products are being built that use these microprocessor. One area is robotics. The controls of a Five- or six-axis-of-freedom robotic arm require a sophisticated controller. The 16-bit and 32-bit microprocessors are ideal for this application. In addition to the Intel family or microprocessor, the Motorola 6800 family is used as the basis for a number of advanced personal computers. The Apple Macintosh is bases on this microprocessor family. The 6800 is also the basis of a number of industrially oriented microcomputer systems. These systems use an advanced systems software package known as UNIX. The microcomputer created for these industrial computers are frequently used as computer-aided design (CAD) or computer-aided manufacturing (CAM) workstations. Thirty-tow-bit microprocessors are needed in these applications because of the great use of graphic displays. A great deal of computing power is required, for example, to display a two-or-three-dimensional drawing in color. . In the above examples, you can see that the 16-bit and 32-bit microprocessors are mainly used as the microprocessors to build microcomputers. Again, there is some use of these microprocessors in non microcomputer systems, but the use is limited. There is a reasonable amount of use of these microprocessors at the card level. This means that the printed circuit cards such as the CPU card or memory (RAM) card from a PC may be used. Most of these uses are in industrial applications where a full microcomputer is not required to do the job. Basically, these applications use only parts of the microcomputers (CPU card, I/O card, memory card, etc.) needed to do the job and no more. The 32-bit microprocessors are outgrowth of the 16-bit microprocessors. Both the Intel and the Motorola families have full 32-bit parts: the 80386 and 68020 series microprocessors. Although these two products are quite capable of being used in special purpose designs, their main applications have been to create 32bit microcomputers. Both products are used to create extensions of personal computer designs. Why does the world need 32-bit microcomputers? If you only look at the need for a 32-bit data word, the biggest reasons become speed for certain calculations and speed of data handling. Why is the 32-bit microprocessor faster in these situations? A 32- bit word gives the user a resolution of 1 part in 4 billion. The 8-bit word only has a resolution of 1 part in 256, and the 16-bit word has a resolution of 1 part of 65,536. The great resolution of the 32-bit word is in many cases sufficient for complex commercial, industrial, and scientific calculations. Figure 4-2 compares 8-bit, 16-bit, and 32-bit words. As you can see, the 32-bit word has enormous data-handling capability when compared with either the 8-bit or 16-bit data words. The use of the 32-bit means that the calculations can be performed in a single-rather than multipleprecision operation. Multiple-precision calculations are much slower than single precision calculations are much slower than single-precision calculations. Therefore, if the end application can use the resolution provided by a 32-bit word, the 32-bit microprocessor is much faster than either an 8-bit or 16-bit microprocessor doing the same calculations. The 32-bit is also faster at data handling. Each time that the 32-bit microprocessor takes data from its memory, it gets four times as much data as the 8-bit microprocessor gets data from memory 1 byte at a time. The 32-bit microprocessor gets data 4 bytes at a time. This means that the same speed 32-bit microprocessor handles data four times faster than the 8-bit microprocessor, as we will see later, increasing the microprocessor's speed is difficult. Therefore the speed increase achieved by doubling two word lengths is a very real improvement. Does this mean that the 64-bit microprocessor is just another extension of this design? Yes, it does. When microcomputer applications are slowed down by the time that the 32-bit microprocessor take to get data from external devices, a 64-bit microprocessor becomes a real solution. As we examine the internal architecture of some 32-bit microprocessor, we will see that the 64-bit architecture is already is use.

2-3 Addressable Memory As we discussed earlier, the amount of memory which a particular microprocessor can address is also part of its architecture. The early microprocessors had very limited memory addressing capability compared with current designs. The earliest 4-bit microprocessor, the Intel 4004, could only address 16,384 memory locations, ft ontv nad 14 memory address lines (2A14 = 16,384). Most of 8-bit microprocessor use 16 address lines and can therefore address 65,536 memory locations (2A16 = 65,536). Many of the single-chip microcomputer can only address the number of memory locations which are actually on the chip. Often, this is only 1 to 8K locations of ROM (read-only memory) for program storage and 64 to 512 RAM (random-access memory) locations for storing variable data. Other singlechip microcomputers are capable of addressing all of their internal memory locations and can also address enough memory locations and can also address enough memory locations outside the chip to give them a full 64-kbyte (65,536) memory address space. How much memory-addressing capability is needed? Once again, we will find that the more addressing capability the microprocessor has, the greater the associated costs may be. The rule is still to avoid overkill. Therefore, we must ask the question, "How much memory do the various applications require?" In sec. 4-2, we looked at a number of applications which use 4-bit microprocessor. How much memories do applications like these needs? Before we look at an application, we must review the need of ROM and Ram. We know the microprocessor stores two different kinds of information in its memory. First, it stores the program steps it is to perform. Second, it stored variable data that it receives or generates from working on the data. For example, let's look at a microprocessor which is performing the function of a digital alarm clock. The program steps are instructions which tell the microprocessor how to tell time. They also tell it how to compare the current time to the alarm set time and how to ring the alarm if a match is found. These program steps must be stored in memory before the microprocessor knows how to start acting as digital alarm clock. Before the microprocessor can begin to work as a digital alarm clock, you must tell it at what time it is to start and at what time the alarm is to ring. You must enter data called the start time and data called the alarm time. This data will be in hours, minutes, and seconds, and it will have an AM or PM flag. The microprocessor will then follow the program and calculate new data - the current time. The program will also perform a check every second to see if the current time equals the alarm time. If the current does equal the alarm set time and the alarm is turned one, the microprocessor rings the alarm. How will this information be stored in the microprocessor's memory? We do not need to change the programming information. That is, once the program to calculate time is designed and proven to wok properly, it can be permanently stored in the microprocessor's memory. However, the set time, the current, the alarm time, the alarm On/Off flags, and clock mode flags are all data that can change. The set time changes each time the user starts the clock. The current time changes once each second. The alarm time changes each time the user wants to ring the alarm at a new time and the alarm On/Off flag changes each time the user wants to activate the alarm function. The mode flags change each time the user is setting the clock. Because the program never changers, we can store this information in ROM. Because the time and alarm set data, the current time and the flags change, this information must be stored in read-write memory. In today's terminology, this is usually called RAM. We can now ask the question, "how much ROM and how much RAM does my application require?' In this example, the application program is the set of microprocessor instruction which tell the microprocessor how to perform the digital alarm clock function. A typical digital alarm clock application can be written in less than IK instruction. Therefore, the microprocessor in this application will require a ROM which can store about 1000 instructions.

If we allow one memory location for each unit of information we store (4 bit BCD data), each time group requires 7 bytes (2 for hours, 2 for minutes, 2 for seconds, and 1 for the AM-PM flag). Additionally, we need four locations to store the control (Alarm On/Off, Alarm Set On/Off, Time SET On/Off and Run On/Off) data. This means we need a total of 25 RAM locations. In a real-life application, a few more RAM locations are needed for some programming requirements, but a 4-bit microprocessor with 64 RAM locations will do the job. We find that our microprocessor-based digital alarm clock needs a 4-bit microprocessor with 64 RAM locations and 1000 ROM locations. In this application, we have no need for a microprocessor which has a memory address architecture that gives us greater capability. In other words, an 8-bit microprocessor with 64-kbyte addressing capability is truly overkill. Let's now look at an application where we depend on a microprocessor architecture where depend on a microprocessor architecture which has extensive memory addressing capability. Some of the microprocessors in use are very powerful. In fact, for many applications, they are so powerful that a number of users can use the microprocessor at one time. To do this, we need a microprocessor with extensive memory-addressing capability. Even thougn it appears that many users are working with the microcomputer at the same time, the microprocessor is really only able to do one thing at a time. How does the control program multiple users? The answer to this question is that the microprocessor has a microprocessor which sees that each uses I given a small slice of processing time. Once, one user's time slice is over the control program stores the current condition of the user's application and switches in the next user's application. In order to make the switch from one user to the next user very quickly, each user's application permanently resides in the microprocessor's memory. The control program only selects which area of memory it is currently executing instructions from. Many of the application programs in use today, such as word processors, spreadsheets, and data bases, require a minimum of 128 Kbytes of memory. If we are to build a multiprogramming system such as the one described above, and the system, is to support four users, we require a minimum memoryaddressing capability of 128 Kbytes times' four users, or 512 Kbytes. Fortunately, applications of this sort are very common for both the Z80 8-bit microprocessor and the 8088 16-bit microprocessor. The Z80 architecture allows the processor to address 64kbytes of memory. Unfortunately, this is not enough memory for even single user! However, the 8088 has a 1-Mbyte (1,048,576 bytes) addressing capability. Therefore, this 16-bit architecture provides us with twice the memory-addressing capability we need. The 8-bit microprocessor is used in may control applications. The size of control application program varies widely; however, it is common to find such control programs with sizes between 4 and 32kbytes. The RAM requirements also vary widely; however, the typical control application does not usually storage. Often, you will find such 8-bit control microprocessor application us with either 2 Kbytes or 8 Kbytes of RAM. When the 8-bit microprocessor is used as a general-purpose computer, it is best to have as generalpurpose computer, it is best to have as much Ram as possible. Of course, the microprocessor needs some initial program to get started. This initial program is called a boot program. This initial program must be in a small ROM, which may be replaced by RAM once the microprocessor has been booted. Once booted, the microprocessor program loads additional programs from mass storage into the RAM. From that point forward, the microprocessor can continue to execute programs form RAM until power is lost. From these two examples, we see that there are two common ROM-RAM combinations used with the 8bit microprocessor. In the first example, we learned that control systems typically use a large amount of ROM to store the permanent control program and a small amount of RAM to store variable data. In the second example, we learned the general-purpose systems use the maximum possible amount of RAM. This is done because the general-purpose microcomputer does not execute any fixed program. The general-purpose microcomputer is designed to load executable programs from a mass storage device into RAM whenever the user decides to use a particular program. However, when the microcomputer is powered up, there is no program stored in the RAM. Therefore, the first executable program, called the boot program, must be stored in ROM.

In first example, we see that the amount of memory-addressing space require by 8-bit control application can vary from a few kilobytes to the full 64-kbyte addressing limit of the microprocessor. In the second example, we see that the amount of memory-addressing space required by 8-bit generalpurpose applications is usually the full 64-kbyte addressing limit of the microprocessor. In a similar manner, we find that the memory-addressing requirement for microprocessor used in 16-, 32-, and 64bit applications can vary as well. When these microprocessor are used in a general-purpose application such as the basis for a PC, the maximum amount of memory possible is desirable. Many of the newer applications programs written for the PC require many hundreds of kilobytes of memory to accommodate the data generated by or used by the application program. The 8088 architecture, as you have learned, allows this microprocessor to address IMbyte of memory. When the 8088 is used in the PC, some for the memory address space is devoted to RAM. Other sections are devoted to the ROM, which contains the initializations (boot) programs and other permanent programs (called the BIOS) which the microcomputer always needs to be able to access. Memory mopThis shows the user the microprocessor's memory architecture. When 16-bit microprocessors are used in control applications, the memory requirements are not usually as great as they are in the general-purpose application. If the application and system programs are fixed, then a great deal of the memory space may be occupied by ROM. If the application programs change frequently, then the memory space will be occupied by RAM so that the user can change the program which is to be executed. This, for example, is common in process control computer which may be used to monitor and control a number of different processes, in this example the 16-bit microprocessor architecture may be chosen to provide rapid calculation and access to a large program-addressing space. Two major 32-bit microprocessors, the 68020 and 80386, have architectures which allow them to address 4Goytes of memory (1 Gbyte equal 1 billion bytes). These architectures are intended to support large multiprogramming applications or scientific application which generates very large amounts of data. 2-4 The Microprocessor's Speed The speed with which a microprocessor executed its instruction is often used as a way to compare the performance of two microprocessor. Speed may be measured in two different ways. The first is the microprocessor's clock speed. This is the frequency at which the microprocessor's clock oscillator operates. Typically this is expressed in megahertz (1 megahertz (MHz) equals 1 million cycles per second). A second method of rating a microprocessor's speed is the number of instructions it can execute per second). A second method of rating a microprocessor's speed is the number of instructions it can execute per second. Since the job we are asking the microprocessor to accomplish is the execution of instructions, this becomes a good measure of its processing speed. Processing speed is usually expressed in millions of instructions per second (MIPS). As is frequently the case, no measure of a microprocessor's power is exact. If you use MIPS, you must ask what instruction the processor is being asked to execute. Some instructions take longer tan others to execute. Therefore, the MIPS rating for microprocessor can only tell you the average processing rate for a fairly large program. The data in Fig. 4-6 shows the clock frequency and the MIPS rating for some common microprocessor. As you can see, the MIPS rating depend on both the clock frequency and the word size. As the clock frequency is increased, the microprocessor executes more instructions per second. However, you should note that the number of instruction that a z80, for example, executed in 1 s only improves by 50 percent as we increase the clock speed from 4.0MHz (Z80A) to 6.0 MHz (Z80BO. However, if we can double the word size and keep the clock frequency the same, the MIPS rate is nearly doubled. This is so because the average instruction length is greater than 1 byte. This means that, on the average, the 8-bit microprocessor must access memory at least twice to fetch a complete instruction. On the other hand, the 16-bit microprocessor only needs one memory access in the same amount of time, and then the 16bit microprocessor will be twice as fast as the 8-bit microprocessor. The frequency at which the microprocessor's clock operated depends largely on the semiconductor manufacturing technology used to build the microprocessor. The semiconductor manufacturing

processes which are used to build a large-scale integrated (LSI) circuit are very much like the processes used to develop a photograph. The frequency at which the microprocessor will operate and the complexity of the microprocessor depends on how many transistors can be put on the IC.Microprocessors and other LSI circuits which must operate at a high frequency must be made with a semiconductor manufacturing process that makes very small parts. The processes used to build the very fast and very dense microprocessor today are able to make parts as close as a few tenths of one millionth of an inch. Most microprocessors are constructed using one of two semiconductor technologies. These two technologies are NMOS and CMOS. NMOS stand for N-channel metal-oxide semiconductor, CMOS stand for complementary metal-oxide semiconductor. NMOS processors typically allow clock frequencies from few megahertz to nearly quinces from a few megahertz to nearly 20 MHz The NMOS process produces the less expensive devices, but the NMOS devices typically draw more power (current) and therefore run hotter. Devices produced using the CMOS technology are much lower in power, will operate over a wider temperature and voltage range, and as, noted cost more. There are some VLSI^ very large scale integration) circuits which have so many circuits on them that they cannot be produced by NMOS technology because they would run so hot they would burn up. These devices must be produces by CMOS technology. The Intel 386 is an example of such a device. CMOS processors typically will operate over a greater frequency range than the NMOS devices. In both cases, an increase in operating frequency requires a like decrease in the size of the VLSI's internal parts. As the requirement for processor speed increase, the need for very difficult to make sub micrometer semiconductors increases. This means that increased processors frequencies are becoming harder and harder to come by. Clock frequencies of 20 to 100MHz are common, and a few microprocessors are reaching clock frequencies near 300MHz. 2-5 Other Microprocessor Architectural Characteristics Some other microprocessor architectural techniques being used to increase speed include Parallel processing Coprocessing Cache memory tecnniques Pipelining techniques Wider buses Although some of these techniques are only just beginning to be used, other are quite advanced. This will briefly introduce you to these techniques. Parallel processing means just what it says. It is a description of any microprocessor architecture which permits two parts of the computing process to occur at the same time. One of the most obvious implementation of parallel processing involves the use of two microprocessor in the same product. To be considered parallel processing, both the microprocessor must be working on a job which could be done by a single microprocessor but which can be done by a single microprocessor but which can be done faster with the two microprocessor. Parallel processing is also used within the microprocessor itself. In the course of designing the control logic to execute an instruction, the microprocessor architect looks for a way to divide the execution process into two sections. The architect looks for processes which if done by a single element of the control logic would have to be done one after the other, but which can be done at the same time if two pieces of control logic are provided. Advanced microprocessor architecture may include multiple execution units within the microprocessor design. This form of parallel form of parallel processing is called a superscalar architecture. Coprocessing is very much like parallel processing. The coprocessor is a separate processor which works with the main processor to perform special functions. Because the coprocessor is typically limited to special function

processing, it can be built to perform those particular function much faster that the general-purpose processor might. Many conventional microprocessors are supported with a separate 1C which performs a coprocessing function. For example, the 386 is supported with the 80387 numeric data coprocessor. The 80387 is wired in parallel with the 386 microprocessor. When the 80387 is in place, the combined system has extra high-level mathematical instructions which let it perform multiple-precision addition, subtraction, multiplication, and division much faster that can be done with 386 alone, Additionally, the 80387 coprocessor gives the 386 other mathematical functions such as logarithms, trigonometric functions, and square roots. A 386 system using an 80387 numeric data coprocessor. Other coprocessors used within a microcomputer system may be no more than dedicated .microprocessors assigned a specific task such as managing the serial I/O, disk drives, and video display. Part of the microprocessor speed limitation which faces every microprocessor architect is the speed with which the memory can supply the data the microprocessor requested. One technique to overcome the problems of slow memory is to use a cache memory. A cache memory is a very fast memory. This fast memory may be located very close to the microprocessor, or it may be included within the microprocessor on new microprocessor architectures. To use the cache memory, an instruction fetch, for example, not only fetches the instruction at the addressed memory location but also fetches enough of the next location's contents to fill the cache memory. After the initial fetch, the microprocessor will always look in the cache memory first because it is a much faster-responding memory. If the instruction is not found in the cache memory, the microprocessor then looks in the slower main memory for the instruction. To offer a speed improvement, the cache memory must have more hits than misses. That is, the cache memory only offers a speedup if it can offer enough cached instructions to overcome the time lost to instruction fetches which must be looked for twice - first in the cache memory and then in the memory then in the main memory, because they were not in the cache memory. Figure 4-9 shows a bus-oriented microprocessor system which uses a 16-kbyte cache memory to provide a speed improvement over operations with the main 4-Mbyte memory. Pipelining is another architectural technique where the name describes the function it performs. Like the assembly line, the pipelined architecture processes a number of instructions at one time. Each instruction is processed a little at each station on an assembly line. The use of a pipelined architecture allows the designer to build faster, more dedicated logic at each station and therefore the microprocessor completes the desired process quicker. As you have learned earlier, when the microprocessor has the ability to process wider data, it is naturally faster. Wide data buses are used inside the microprocessor as well as in the microcomputer design. We have seen examples of this architectural technique when microprocessors use double-wide accumulator. The double-wide accumulator allows the user to process certain functions faster because it eliminates the need to perform an intermediate storage in memory. In summary, we find there are many ways to speed up the microprocessor. If possible, we just make it go faster by increasing the microprocessor's clock frequency. This is not done without expense, because parts which work at higher frequencies cost more. IF we cannot speed up the microprocessor's clock frequency, mere are a lumber of architectural techniques which add hardware to the microprocessor but which result in faster operation. Again, remember that performance costs money. If you don't need the speed, don't select high-speed microprocessor. You will be paying for performance you don't need. 2-6 The Microprocessor's Registers The microprocessor's registers are important and distinctive part of its architecture. The registers are temporary data storage devices found inside the microprocessor. Some have special, single-purpose functions and other are used for general purpose data storage. In the next chapter, we will learn that there certain basic registers in every microprocessor. We will learn that a microprocessor may have many register beyond these basic registers. We look at registers that are used in a number of different

microprocessors. At this time, it is only important to understand that the number and type of register in any particular microprocessor will be different from those in another microprocessor. The number of register in microprocessor is important because the more registers that the programmer has available, the more registers there are to assign to specific tasks. IF the microprocessor architecture does not have enough register to allow the programmer to assign register to a specific task, the programmer must transfer the data in the register into a temporary memory location for storage when the task is complete. The data is then retrieved from the temporary location when the task is going to use the register again. Each of the data transfers from a register to a memory or from memory to a register is wasted instructions. The types of registers available to the programmer can also represent a performance issue. There are many ways to determine what memory location the microprocessor should be addressing. Certain types of register can be provided which make the job of selecting the memory address for program data easier than could be done without these registers, For example, the index register allows the programmer to add a word to the current index register value to compute a memory address value. In a microprocessor without an index register, the memory address value must be computed using conventional registers, which use more instructions to get the job done. There are, as you will learn, many different types of register in a microprocessor. Not all microprocessor have all the registers, and there are some types of registers which do no exist in a microprocessor that has other types of registers. That is, you cannot have both types in one microprocessor. As wfth any other performance improvement, additional register cost money. Register take space and cause other increases in the microprocessor's complexity. Both of these factors may call for additional parts to be used outside the microprocessor as support. 2-7 The Microprocessor's Instructions Like the registers, the number and kind of the microprocessor's instruction are a measure of the microprocessor's power. Additional microprocessor instructions can only be in the microprocessor if the microprocessor has the necessary logic circuits to execute the instruction. This means that more instruction means a bigger microprocessor, and bigger microprocessors are more complex. For example, comparing the instruction set of an 8-bit single-chip microprocessor - the Intel 8051- and the popular 8bit Zilog Z80 - we find that the 8051 has 11 different instructions and the Z80 has 178. What additional instructions do we get when we use a microprocessor instead of a single-chip microcomputer? When we examine the two instruction set, we find that the Z80 offers some extended capabilities. First, it is able to perform a number of 16-bit data transfers between register pairs and between register pairs and memory. To do this, the microprocessor must have special control logic to recognize register pair instruction and to execute the instruction in two parts (the High byte and the Low byte). Second, the Z80 instruction set includes a series of block transfer and block search instruction. These instructions let the programmer move data in blocks instead of 1 byte at a time. The programmer specifies the beginning and ending addresses for the block and then the start addresses fit the block and then the start address where the block of data is to move. The Z880 cal also search a selected block memory for specified data. Both the 15-bit data transfer instructions and the block move instructions are made possible by the addition of special logic to the ZSO's control logic and memory addressing logic. Needless to say, the 851 does not have this logic: thus it does not have the instruction. For the programmer with a need to perform 16-bit data transfers or block moves, the Z80 has a significant advantage over the 8051. On the other hand, because of the special circuits, the 8051 does have some instructions that the Z80 does not have. The 8051 has a built-in serial port and therefore has the instructions to receive or transmit data via this serial port. The 8051 costs less than half as much to put into a system as the Z80 does, and it is more powerful in that respect than the Z80. 2-8 Memory Addressing Architecture Part of the programming flexibility for each microprocessor is the number and different kinds of ways the programmer can refer to the data stored in memory. At first, one would think that all memory reference instructions in an 8-bit microprocessor would simply be a byte of instruction followed by 2

bytes of memory address. Although most 8-bit microprocessors do have such a direct addressing mode, it is not the most efficient. In the 8-bit microprocessor, for example, such a direct addressing instruction takes 3 bytes. If ones uses the indexed addressing discussed in Sec. 4-4 the complete instruction and 1 byte which is either added to or subtracted from the index register. Of course, indexed addressing is only available to the programmer if an index register is available. In general, it is fair to assume that the more complicated the microprocessor's architecture, the more memory addressing modes there will be. For example, as the complexity of the microprocessor grows, the number of different addressing modes also grows. Once again, the need for a wide variety of addressing modes depends on the job you are doing with the microprocessor. For simple control applications which have, for example, 2 Kbytes of ROM and 4kbytes of RAM, you may well not require great flexibility in the addressing. On the other hand, when you are building the control system for a sophisticated data gathering and signal analysis instrument, you may need extensive memory-addressing capability to build and then analyze large arrays of signal data in memory. 2-9 The Microprocessor's Support Circuits The microprocessor's architecture does not just include its internal structure; it also includes other circuits and devices intended to work with the microprocessor. For example, to be useful, the microprocessor must communicate with the outside world. As we will learn in detail in Chap. 13, this is often done with a special I/O subsystem called serial I/O. What does the microprocessor use to perform the serial I/O function? Although the serial I/O function can be built from gates and flip-flops, it almost never is. Instead, the architects of microprocessor systems use a special LSI circuit known as a DART. There are two different kinds of UARTs available to the microprocessor system architect. During the design process one can use a general-purpose UART or, if the microprocessor's architecture includes a special UART developed for that microprocessor, that UART may be used. The special UART often includes many bus- and system-related features which make it much easier than the universal UART to connect to the microprocessor. Special support circuits included in the microprocessor's architecture are not limited to UARTs. Often, the support circuits are so important that they will cause the microprocessor system designer to choose one microprocessor over another. 4-10 Microprocessor Development and Maintenance Systems As we saw in Sec. 4-9, not all of the microprocessors architectural features are limited to those inside the chip itself. The systems used to develop and maintain products built with a particular microprocessor are another very important architectural feature. Because the functions which the microprocessor can perform can be changed by changing the microprocessor's program, microprocessor maintenance includes not only repair but possibly correcting programming errors and adding new features and function. For this reason, the tools used to develop and maintain the microprocessor-based system are frequently the same. A microprocessor development system include the software, which allows a programmer to write and modify programs for the microprocessor; the hardware tools, which allow one to examine the microprocessor action to see that it is doing the desired job; and the documentation and support available, which allow development and maintenance people to solve problems when they come up in the process of using the particular microprocessor. These are essential tools for the individuals charged with developing and maintaining a microprocessor-based system. To the person responsible for developing and maintaining the software, the number and quality of programming languages are very important. The programming language chose to implement a particular application depend highly on the application. As we will learn in Chaps. 14 and 15, there are two major types of programming languages: assemblers and high-level languages. We will also learn that there are

many different high-level languages in use today, but all microprocessors have their own assembly language. An assembler is a computer program which allows the programmer to put a group of the microorocessor's instructions together into a program. However, the programmer must ask what or microprocessor the assembler works on. For example, does the assembler for the desired microprocessor only run on a special microcomputer designed to develop software for that particular microprocessor, or does the assembler run on a general-purpose microcomputer, such as a PC? The assembler is called a cross assembler if the microprocessor that it runs on is not the microprocessor for which it assembles programs. Some microprocessors only have assemblers. They do not have any high-level languages. Others provide one or two languages, and others have choice of almost any programming language desired. For example, because the Intel X 86 families of microprocessors is the basis of the PC, many different languages have been written for this family. This means that a software developer may have a wide choice of languages to implement a given function on these microprocessors. On the other hand, as we have learned earlier, this is not inexpensive microprocessor architecture. Due to cost, this may not be the right microprocessor family for the particular project. One other important part of the microprocessor development system is the in-circuit emulator. The incircuit emulator is a special test instrument which allows the person testing the microprocessor system to examine how the microprocessor is functioning in the circuit. It is often referred to as an ICE, which is Intel's trademark for their in-circuit emulator. With the in-circuit emulator, one can stop in the middle of executing a program and examine the contents of memory and register. The in-circuit emulator can also be used to trace the path of program execution. This allows you to see the steps the program followed to reach a certain condition. This is an invaluable tool for the person trying to find out why the program or hardware is not performing as expected. Again, the cost, flexibility, and availability of in-circuit emulation tools vary from microprocessor to microprocessor. Typically, in circuit emulation equipment is expensive. A minimal development station for one of the 16- 32-bit microprocessor can cost as much as $50,0000. Additionally, both the hardware and software tools for any microprocessor are relatively complex. IT takes time to know the tools well enough to use them effectively. The learning time is also a cost. It too must be considered when looking at the possibility of using a new microprocessor.