You are on page 1of 930
Tue 80386, 80486, .np PENTIUM® PROCESSOR Aa et) The 80386, 80486, and Pentium® Processors Hardware, Software, and Interfacing WALTER A. TRIEBEL Intel Corporation PRENTICE HALL Upper Saddle River, New Jersey Columbus, Ohio To my father, Adolf A. Triebel Lanary of Congress Cataloging-n-Pubiiation Data “Treel, Walter A. “The BUSH, 0896, and Penton processors: hardware, software, and interfacing? Walle A Tiebe. ecm. Inlades siogaphial referenes and index ISBN 05-5307 1 let SSG (Microprocemor)_ 2 atl ADHS5 (Mixoprocssor) ‘QMieroproceser) T. Tie QavasanTs I958 e2i3816—aa srasies ar Photo Credit: © 1996 PhotoDisk, Inc. Editor: Charles E. Stewart, Ir Production Editor: Mary M. Irvin Production Coordination: bookworks Design Coordinator: Karrie M. Converse Cover Designer: Ken MacKay Production Manager: Deidra MI. Schwartz Marketing Manager: Debbie Yarnell ‘This book was set in Times Roman by Bi-Comp and was printed and bound by Courier! Westford. Tae cover was printed by Phoenix Color Corp. FEE © 1998 by Prentice-Hall, Inc. ‘Simon & Schuster/A Viacom Company Upper Saddle River, New Jersey 07458 {All sights reserved. No part of this book may be reproduced, in any form or by any ‘means, without permission in writing from the publisher. Printed in the United States of America 10987654321 ISBN: 0-13-533225-7 Prentice-Hall International (UK) Limited, London Prentice-Hall of Australia Pry. Limited, Sydney Prentice-Hall of Canada, Inc., Toronto Prentice-Hall Hispanoamericana, S. A., Mexico Prentice-Hall of India Private Limited, New Delhi Prentice-Hall of Japan, Ine., Tokyo Simon & Schuster Asia Pte. Ltd. Singapore Editora Prentice-Hall do Brasil, Lida., Rio de Janeiro Preface ‘Today Intel's 80X86 family of microprocessors i the most widely used architecture in modern microcomputer systems. The family includes both 16-bit microprocessors, such a8 the 8088, 8086, 80186, 80188, and 80286 processors, and 32-bit microprocessors, such as the 80386, 80486, and Pentium® processors. The 8088, whieh is the &-it bus version of the 8086, js the microprocessor employed in the original IBM personal computer (PC). The 8088 and 8086 microprocessors were also used by many other manufacturers to make personal computers compatible with IBM’s original PC. Moreover, IBM's original personal computer, advanced technology (PC/AT) was designed with the 80286 microprocessor. Like tne PC, PCIAT-compatibie personal computers were made by many other manufacturers, and today they are built with Pentium®-processor-based microcomputers. Intel's 80X86 family of microprocessors are also used in a wide variety of other electronie equipment. The 80386, 80486, and Pentium® Processors: Hardware, Software, and Interfacing isa thorough study of the 32-bit microprocessors of the 80X86 family, their microcomputer system architectures, and the circuitry used inthe design of a PC/AT compatible microcom- puter. This book is written for use asa textbook in courses on microprocessors at community colleges, colleges, and universities. The intended use is in a one- or two-semester course in microprocessor technology that emphasizes both assembly language software and microcom- puter circuit design Individuals involved in the design of microprocessor-based electronic equipment need systems level understanding ofthe 80X86 microcomputer—that is. thorough understand- ing of both their software and hardware. The fist part of this book explores the software architecture of the 80386, 80486, and Pentium® processors and teaches the reader how to write, execute, and debug assembly language programs. In order to be successful at writing assembly language programs for the 80X86 family of microprocessor, one must learn: 1. Software architecture: the internal registers, flags, memory organization, and stack, ‘and how they are used from a software point of view. 2. Software-development tools: how to use the commands of the program debugser (DEBUG) that is available in DOS to assemble, execute, and debug instructions and programs, 3. Instruction set: the function of each of the instructions in the instruction set, the permissible operand variations, and how to write statements using the instructions. 4. Programming techniques: basic techniques of programming, such as flowcharting, jumps, loops, strings, subroutines, and parameter passing. 5. Applications: a step-by-step study of the process of writing programs for several prac- tical applications. Al this material is developed in detail in Chapters 2 through 8, ‘The software section includes many practical concepts and practical software applica- tions, For instance, examples are used to demonstrate applications such as 32-bit addition and subtraction, masking of bits, and the use of branch and loop operations to implement IF-THEN-ELSE, REPEAT-UNTIL, and WHILE-DO program structures. In addition, the various steps of the assembly language program development cycle are explored, ‘The study of software architecture, instruction set, and assembly language program- ‘ming is closely coupled with use of the DEBUG program on the PC/AT-compatible micro- computer. That is, the line-by-line assembler in DEBUG is used to assemble instructions and programs into the memory of the PC/AT, while other DEBUG commands are used to execute and debug the programs, The use of a practical 80X86 assembler program, the Microsoft MASM Assembler, is also covered. Using MASM and other PC/AT-bascd Soft- ‘ware development tools, the student learns how to ereate a source program; assemble the program; form a run module; and load, run, and debug a program. Chapter 8 isa thorough study of the 80386DX's protected-address mode architecture. Here we begin by introducing the protected-mode register model. This is followed by a detailed study of the function of the 80386DX’s memory-management unit, segmentation and paging, virtual addressing, andthe translation of virtual addresses to physical addresses. ‘The various types of descriptor table and page table entries supported by the 80386DX are covered, as is how they relate to memory management and the protection model. The instructions of the protected-mode system control instruction set are described. Finally, the concepts of protection, the task, task switching, the multitasking system environment, and virtual 8086 mode are explored. ‘The second part of the book examines the hardware architecture of microcomputers built with the 80886, $0486, and Pentium® processors. To understand the hardware design ‘of a microcomputer system, the reader must begin by first understanding the function and ‘operation of each of the micropracessor’s hardware interfaces: memory, input/output, and interrupt, After this, the role of each of these subsystems can be explored relative to overall microcomputer system operation. Is this material that is presented in Chapters 9 through 14, ‘We begin in Chapter 9 by examining the architecture of the 80386DX and 80386SX microprocessors from a hardware point of view. Included is information such as pin layout, signal interfaces, signal functions, and clock requirements. ‘The latter part of the chapter covers the memory and input/output interfaces of the 80986DX. This material includes extensive coverage of memory and input/output bus cycles, pipelining, address maps, mem- ‘ory and input/output interface circuits (address latches and buflers, data bus transceivers, ‘and address decoders), use of programmable logic devices in implementing bus-control logic, types of input/output, and input/output instructions and programs, “This hardware introduction is followed by separate studies of the architecture, opera- wv Preface tion, devices, and typical circuit designs for the memory, input/output, and interrupt inter- faces of the 80386DX-based microcomputer in Chapters 10, 11, and 12, respectively. For instance, in Chapter 10, we cover devices and circuits for the program storage memory (ROM, PROM, EPROM, and FLASH), data storage memory (SRAM and DRAM), and cache memory subsystems. Practical bus interface circuit and memory subsystem desiga techniques are also examined, including parity checker/generator circuitry and wait state ‘generator circuitry, Chapter 11 covers input/output interface circuits and LSI peripheral devices. The ‘material on core I/O interfaces includes detail studies of diserete parallel input/output circuits, 82C55A, 82C54, and 82C37A peripheral ICs. Practical parallel input/output design techniques are illustrated with examples such as circuits and programs for polling switches, lighting LEDs, scanning displays and keyboards, and printing characters at a parallel printer port. The chapter also explores a number of special purpose peripheral IC devices and interfaces. For instance, serial communication and the 16450 UART controller are studied and keyboard scanning and display driving are demonstrated with the 8279 keyboard! display controller ‘The topic of interrupt and exception processing is examined in Chapter 12. This chapter introduces the interrupt context switching mechanism and related topics such as priority, interrupt vectors, the interrupt vector table, interrupt acknowledge bus eyele, and interrupt service routine. External hardware interrupt interface circuits are demonstrated using both diserete circuitry and the 82C59 programmable interrupt controller peripheral IC. Also included is coverage of special interrupt functions such as software interrupts, the snonmaskable interrupt, reset operation, and internal interrupt and exception processing. The hardware design section continues in Chapter 13 with a thorough study of an '80386DX-based microcomputer design of a main processor board for a PC/AT-compatibile personal computer. The microcomputer design examined employs Intel Corporation's $2340 hiigh-integration PC/AT-compatible chip set. Each of the ICs in the 82340 chip set (82345 data buffer, 82346 system controller, 82344 ISA controller, and 82341 peripheral combo) are described in detail from a hardware point of view. This material includes their block diagram, signal interfaces, and interconnection to implement the PC/AT-compatible micro- computer. Moreover, the circuitry used in the design of the eache memory subsystem, DRAM array and BIOS EPROM, floppy disk drive interface, IDE hard disk drive interface, serial communication interface, and parallel printer interface is described. This chapter ‘demonstrates a practical implementation of the material presented in the prior chapters on rierocomputer interfacing techniques. ‘The hardware section concludes with Chapter 14, which covers PC bus interfacing and techniques for circuit construction, testing, and troubleshooting, The last part of the textbook provides detailed coverage of the other 32-bit micropro: ‘cessors of the 80X86 family, the SO486SX, 80486DX, 80486DX2, 80486DX4, und Pentium® processors, Throughout these chapters, the focus is on how these processors’ software und hardware architecture differs from that of the earlier family members. Advanced topics introduced include: RISC, CRISP, and superscaler processor architectures, clock scaling, big and litte endian data organization and conversion, dynamic bus sizing, burst, pipelined, and cached bus cycles, address and data parity, and on-chip code and data caches. The Pentium® Pro Processor and Pentium® Processor with MMX™ technology are also intro- duced, WAT, Preface v Supplements An extensive package of supplementary materials are available to complement the 80X86 microprocessor program offered by this textbook. They include materials for the student, Instructor, and for easy implementation of a practical PC/AT-hosted laboratory program, They include: 1, 80X86 Microprocessor Experiments Laboratory Manual, ISBN 0-13-367913-6, Prentice Hall, Upper Saddle River, NI 07458 Laboratory manual that contains 24 skill-building laboratory exercises that explore the software architecture of the 80X86 microcomputer in the PCIAT, assembly language program development, the internal hardware of the PC/AT, and interface circuit ‘operation, design, testing, and troubleshooting. 2. Instructor's Solution Manual with Transparency Masters to accompany The 80386, 80486, ‘and Pentium® Processors: Hardware, Software, and Interfacing, ISBN 0-13-3783995, Pren- tice Hall, Upper Saddle River, NJ 07458 Provides the answers (0 all the student exercises in the textbook and transparency masters for more than 400 ofthe illustrations in the textbook. 43. Instructor's Solution Manual to accompany the 80X86 Microprocessor Experiments Laboratory Manual, ISBN 0-13-700154-1, Prentice Hall, Upper Saddle River, NJ 07458 Contains detailed solutions for each of the 24 exercises in the laboratory manual, including all computer printouts, program listings, and circuit drawings. 4, Laboratory Program Diskete, ISBN 0-13-788555-5, Prentice Hall, Upper Saddle River, NJ 07458 Contains all the programs needed by the student to perform the exercises in the laboratory manual, Included are files that contain the source program, source listing, object code, and run module. These files have been produced by assembling the source program with the Microsoft Macro Assembler. 5. Laboratory Solutions Diskette, ISBN 0-13-788563-6, Prentice Hall, Upper Saddle River, NJ 07458 Contains all the programs and executable files that are created by the student in the process of performing the 24 exercises in the laboratory manual. Based on the method ‘identified in the exercise, the programs have been created with either the assembler in DEBUG ot the Microsoft Macro Assembler, 6, PCULAB, Microcomputer Directions, Ine, P.O, Box 15127, Fremont, CA 94539 ‘An easy-to-use and versatile, external hardware expansion environment for any PC ‘or PC/AT-compatible personal computer for experimenting with microcomputer inter- face circuits, It extends the ISA bus external to the PC/AT, thereby forming a bench top laboratory test unit for building, testing, and troubleshooting interface circuits. It includes a large solderless breadboard arca for working with student-constructed circuitry: a single PC/AT-compatible ISA bus slot for installation of commercially available or custom-built add-on cards, and built-in 1/0 devices, LEDs, switches, and a speaker. The PCuLAB also has a contimuity tester and logic probe for testing circuit operation 7, Microsoft MACRO Assembler, Microsolt Corporation, Redmond, WA 98052 A popular assembler for converting 80X86 assembly language programs to machine code. This assembler enables the student to perform professional-caliber assembly language program development for the 80X86 microcomputer architecture. This soft- ware development tool runs on PC/AT-compatible microcomputer systems. Supplements vii Contents PREFACE INTRODUCTION TO MICROPROCESSORS AND MICROCOMPUTERS 1 13 4 Introduction 1 ‘The IBM and IBM Compatible Personal Computers: Reprogrammable Microcomputers 2 General Architecture of a Microcomputer System 5 Evolution of the Intel Microprocessor Architecture 8 REALADDRESSED MODE SOFTWARE ARCHITECTURE OF THE 80386DX MICROPROCESSOR 17 24 22 23 24 26 27 28 29 210 2 212 213 viii Introduction 17 Internal Architecture of the 80386DX Microprocessor 18, ReakMode Software Model of the 80386DX Microprocessor 20 Real-Mode Memory-Address Space and Data Organization 22 Data Types 25 Segment Registers and Memory Segmentation 29 Instruction Pointer 31 General-Purpose Data Registers 32 Pointer and Index Registers. 33, Flags Register. 4 Generating a Real-Mode Memory Address 36 ‘The Stack 40 Real-Mode Input/Output Address Space 43, 4 3 ASSEMBLY LANGUAGE PROGRAMMING — 48 3. Introduction — 48 32. Software: The Microcomputer Program 48 3.3. Assembly Language Program Development on the IBM-Compatible PC/AT 54 34 The 80386DX Microprocessor Instruction Set 62 35. Addressing Modes of the 80386DX Microprocessor 63, ‘A 4 MACHINE LANGUAGE CODING AND THE DEBUG SOFTWARE DEVELOPMENT PROGRAM OF THE PC/AT-COMPATIBLE MICROCOMPUTER 86 4.1 Introduction — 86 42 Converting Assembly Language Instructions to Machine Code 8&7 43 Encoding a Complete Program in Machine Code 101 44° The PC/AT and Its DEBUG Program 105 45. Examining and Modifying the Contents of Memory 112, 46 Input and Output of Data 122 47 Hexadecimal Addition and Subtraction 123 48 Loading, Verilying, and Saving Machine Language Programs 124 49 Assembling Instructions with the ASSEMBLE Command 130 4.10. Executing Instructions and Programs with the TRACE and GO Commands 133 4d1 Debugging a Program 138 A 5 REAL-MODE 80386DX MICROPROCESSOR PROGRAMMING | 145, 3.1 Introduction 145 52. Data-Transfer Instructions 145 53 Arithmetic Instructions 163 54 Logie Instructions 188 55 Shift Instructions 192 56 Rotate Instructions 197 5.7 Bit Test and Bit Scan Instructions 201 A 6 REAL-MODE 80386DX MICROPROCESSOR PROGRAMMING Il 211 61 Introduction 211 62. Flag-Control Instructions 211 63 Compare and Set Instructions 217 64 Jump Instructions 223 65 Subroutines and Subroutine-Handling Instructions 241 66 The Loop and the Loop-Handiing Instructions 259 6.7 Strings and String-Handling Instructions 267 A 7 ASSEMBLY LANGUAGE PROGRAM DEVELOPMENT WITH THE MICROSOFT MASM ASSEMBLER 280 7.1 Introduction 280 72 Statement Syntax for the Source Program 280 73 Pseudo-Operations 290 Contents ix 74 75 16 71 Creating a Source File with an Editor 301 Assembling Source Programs with MASM_ 307 Creating a Run Module with the Link Program 317 Loading and Executing a Run Module 321 A 8 PROTECTED-MODE SOFTWARE ARCHITECTURE OF THE 80386DX 327 81 82 83 8a 85 86 87 Introduction 327 Protected-Mode Register Model 327 Protected-Mode Memory Management and Address Translation 338 Descriptor and Page Table Entries 346 Protected-Mode System-Control Instruction Set 353 Multitasking and Protection 356 Virtual 8086 Mode 368 4 9 THE 80386DX MICROPROCESSOR AND ITS MEMORY AND INPUT/OUTPUT INTERFACES 372 on 92 93 oa 95 96 97 98 99 9.10 on 9.12, 913 Introduction 372 The S0386DX Microprocessor 373, Interfaces of the S0386DX 375 System Clock 383 Bus States and Pipelined and Nonpipelined Bus Cycles 384 Read and Write Bus Cycle Timing 387 Hardware Organization of the Memory Address Space 392 Memory Interface Circuitry 397 Programmable Logic Arrays: Bus-Control Logie 405 Types of Fapur/Output 419 The Isolated Input/Output Interface 422 Input and Output Bus Cycle Timing 427 Input/Output Instructions — 429 410 MEMORY DEVICES, CIRCUITS, AND SUBSYSTEM DESIGN 440 101 102 103 104 10s 106 107 108 109 Introduction 440 Program and Data Storage Memory 440 Read-Only Memory 442 Random Access Read/Write Memories 452 Parity, Parity Bit, and Parity-Checker/Generator Circuit 464 FLASH Memory 469 Wait-State Circuiuy 482 S0386DX/SX Microcomputer System Memory Interface Circuitry 483, Cache Memory 4%) 10.10 The 8238SDX Cache Controller and the Cache Memory Subsystem 495 A 11 INPUT/OUTPUT INTERFACE CIRCUITS AND LSI PERIPHERAL DEVICES 512 na 2 x Introduction 512 Core and Special-Purpose 1/0 Interfaces S13 Contents 3 na us 116 7 us 9 110 ALU 12 13 14 1s Byte-Wide Output Ports Using Isolated VO _ S13 Byte-Wide Input Ports Using Isolated 1/0519 Input/Output Handshaking and a Parallel Printer Interface $23, 82C5SA Programmable Peripheral Interface (PPI) 529 Implementing Isolated L/O Parallel Input/Output Ports Using the 82CS5A. S44 Implementing Memory-Mapped I/O Parallel Input/Output Ports Using the RCSA 548 82C54 Programmable Interval Timer S2C37A Programmable Direct Memory Access Controller 566 B0386DX Microcomputer System 0 Circuitry 579 Serial Communications Interface S81 Programmable Communication Interface Controllers 589 Keyboard and Display Interface 603, ‘The 8279 Programmable Keyboard/Display Controller 608 A 12. INTERRUPT AND EXCEPTION PROCESSING OF THE 80386DX MICROPROCESSOR 621 a 122 123 124 125 126 127 128 129 1210 wai 122 1213 Introduction 621 Types of Interrupts and Exceptions 621 Interrupt Vector and Interrupt Descriptor Tables 623, Interrupt Instructions 627 Enabling/Disabling of Interrupts 631 External Hardware-Interrupt Interface 631 External Hardware-Interupt Sequence 633 82CS9A Programmable Interrupt Controller 643, Interrupt Interface Cteuits Using the 82C59A 656 Software Interrupts 662 Nonmaskable Interrupt 663 Reset 664 Internal Interrupt and Exception Functions 667 ‘A 13 80386DX PC/AT MICROCOMPUTER SYSTEM HARDWARE 677 134 132 133, Ba 13S 136 137 138. 139 Introduction 677 Architecture of the System Processor Board in the Original IBM PC/AT 677 ‘High-Integration PC/AT-Compatible Peripheral ICs 683 Core 80386DX Microcomputer 684 82345 Data Buffer 695 82346 System Controller 702 82344 ISA Controller 713 82341 High-Integration Peripheral Combo 728 S2077AA Floppy Disk Controller 735 ‘A 14 PC/AT BUS INTERFACING, CIRCUIT CONSTRUCTION, TESTING, AND TROUBLESHOOTING — 746 MA Introduction 746 142 PCIAT Bus-based Interfacing 746 Contents M3 4 145 146 ‘The PCuLAB Laboratory Test Unit 748 Experimenting with the On-board Circuitry of the PCuLAB 75S Building, Testing, and Troubleshooting Circuits 764 Observing Microcomputer Bus Activity with a Digital Logic Analyzer 780 A 15 THE 80486 MICROPROCESSOR FAMILY 787 154 152 153 134 155 156 437 158 159 1510 151 15.12 1513 Introduction 787 “The 80486 Microprocessor Family 788 Internal Architecture of the 80486 789 Real-Mode Software Model and Iastruction Set of the SO486SX_ 791 Protected-Mode Software Architecture of the S0486SX 796 Hardware Architecture of the 80486 Microprocessor 801 Signal Interfaces of the 80436SX MPU 801 Memory and 1/O Software Organization, Hardware Organization, and Interface Girevits 806 Nonburst and Burst Bus Cycles S13 Cache Memory of the 80486SX._ 815 High-Integration Memory/Input/Output Peripheral—R400EX 820 Interrupts, Reset, and Internal Exceptions 822 “The 80486DX2 and SIM6DX4 Microprocessors 826 A 16. THE PENTIUM® PROCESSOR FAMILY 833 164 162 163 164 165 166 167 168 169 16.10 16.1 Introduction 833 The Pentium® Processor Family $33 Internal Architecture of the Pentium® Processor 835, Software Architecture of the Pentium" Processor $36 Hardware Architecture of the Pentium® Processor 842 Signal Interfaces of the Pentium® Processor 843, Memory Subsystem Circuitry 846 Bus Cycles: Nonpipelined, Pipelined, and Burst 850 Cache Memory of the Pentium Processor $56 Interrupts, Reset, and Internal Exceptions 859 ‘The Pentium® Pro Processor and Pentiuon" Processor with MMX"™ Technology 862 ANSWERS TO SELECTED ASSIGNMENTS 868. BIBLIOGRAPHY 903 INDEX 905 contents a Introduction to Microprocessors and Microcomputers INTRODUCTION Inthe past decade, most ofthe important advanees in computer system technology have been closely related to the development of high-performance I6:bit and 32-bit microprocessor architectures and the microcomputer systems built with them. During this period, there has been a major change in the drestion of businesses away from minicomputers to smaller, lower-cost microcomputers. The IBM personal compuier (the PC, as it has become known), Which was introduced in mid-I9S1, was one of the earliest microcomputers that used a 16-bit microprocessor, the R088, as its central processing unit. A few years later it was followed by another IBM personal computer, the PC/AT (personal computer advanced technology). This new system was implemented using the more powertul 81286 mictopro- The PC and PCIAT quickly became cornerstones of the evolutionary process from minicomputer to microcomputer. In 1985 an even more powerful microprocessor, the 80386DX, was introduced. The 80386DX was Intel Corporation's frst 32-bit member of ‘the 8086 family of microprocessors. Availability of the 80386DX led to a new generation of higher performance PC/ATS. Inthe yeas that followed, Intel expanded its 32-bit architec: ture offering with the 80486 and Pentium® processor families. These processors Brought new levels of performance and capabilities to the personal computer marketplace. Today Pentium? processor—based PC/AT microcomputers represent the industry standard com- puter platform for the new computer industry Since the introduction of the IBM PC, the microprocessor market has matured signi cantly. Today, several complete families of 16- and 52-bit microprocessors are avaiable. They all include support products, such as very large-scale integrated (VLSI) peripherals devices, emulators, and high-level software languages. Over the same period of ime, these higher-performance microprocessors have become more widely used in the design of new 1 electronic equipment and computers. This book presents a detailed study of the software and hardware architectures of Intel Cosporation’s 32-bit 80X86 microprocessors, that is, the 80386, 80486, and Pentium® processor families. In this chapter we begin our study with an introduction to microprocessors and micro. computers, The following topics are discussed: 1. The IBM and IBM-compatible personal computers: reprogrammable microcom puters 2. General architecture of a microcomputer system 3, Evolution of the Intel microprocessor architecture AA 1.2 THE IBM AND IBM-COMPATIBLE PERSONAL COMPUTERS: REPROGRAMMABLE MICROCOMPUTERS ‘The IBM personal computer (the PC), which is shown in Fig. 1.1, was IBM's first entry into the microcomputer market. After its introduction in mid-1981, market acceptance of the PC grew by leaps and bounds so that it soon became the leading personal computer architecture, One of the important keys to its success is that an enormous amount of pplication software became available for the machine. Today, there are more than 50,000 off-the-shelf software packages available for use with the PC. They include business applica tions, software languages, educational programs, games, and even alternative operating systems. ‘Another reason for the IBM PC's success was the fact that it was an open system. By ‘open system, we mean that the functionality of the PC can be expanded by simply adding boards into the system. Some examples of add-in hardware features are additional memory, a modem, serial communication interfaces, and local area network interfaces. This system ‘expansion is provided by the PC’s expansion bus—five card slots in the original PC's chassis IBM defined an &-bit expansion bus standard known as the I/O channel and provided its specification to other manufacturers so that they could build different types of add-in products for the PC. Just as for software, a wide variety of add-in boards quickly became Figure 11 Original 1BM personal computer, (Courtesy of International Business Machines Corporation) 2 Introduction to Microprocessors ana Microcomputers Chap. 1 Figure 12 PCXT personal computer. (Courtesy of International Business Machines Corporation) available. The result was a very flexible system that could be easily adapted to a wide variety of applications. For instance, the PC can be enhanced with add-in hardware to permit its use as. graphics terminal, to synthesize music, and even for the control of industrial equipment, ‘The success of the PC caused IBM to introduce additional family members. IBM's PCXT is shown in Fig. 1.2, and an 80286-based PC/AT is illustrated in Fig. 1.3. The PCXT employed the same system architecture as that ofthe original PC. It was also designed with the 8088 microprocessor, but one of the floppy disk drives was replaced with « 10-M-byte (10,000,000-byte) hard disk drive. The original PC/AT was designed with a 6-MHz 80286 ‘microprocessor and defined a new open-system bus architecture that today is called the industry standard architecture (ISA). This architecture provides a 16-bit, higher-performance W/O expansion bus. Figure 13. PC/AT personal computer. (Courtesy of International Business Machines Corporation) Sec. 1.2 The IBM and 1BV-Compatible Persona Computers| 3 Figure 14 Dell Opti Plex GXMT 5133 Pentium! processor-based PC/ AT compatible personal computer (Courtesy of Dell Computer Carp.) Today, Pentium® processor-hased ISA PC/ATS are the mainstay of the personal computer marketplace. Figure 1.4 shows a popular Pentium® processor-based PC/AT- compatible personal computer. Most of the system that are implemented with the Pentium’ processor have an ISA and a second bus known as the peripheral component interface (PCI) bus. This new bus isa high-speed IO data bus intended for connection of high-performance VO interfaces, such as graphics, video, and high-speed local area networks (LAN). The PCT bus supports 32-bit and 64-bit data transfers, and its data-transfer rate is more than 10 times that of the ISA bus. These machines offer a wide variety of computing capabilities, range of performance, and software base for use in business and at home. “The PC/AT-compatible is an example of areprogrammable microcomputer. By repro- rammable microcomputer we mean one that is intended to run programs for a wide variety of applications. For example, one could use the PC with a standard application package for accounting or inventory control. In this type of application, the primary task of the microcomputer is to analyze and process a large amount of data, known as the database Another user could be running a word-processing software package. This is an example of ‘a data input/output-intensive task. The user enters text information, which is reorganized by the microcomputer and then output to a diskette or printer. AS a third example, a programmer uses a language, such as C, to write programs for a scienifl application. Here the primary function of the microcomputer is to solve complex mathematical problems. Te personal computer used for each of these applications is the same; the difference is in the software application that the microcomputer is zunsing. That is, the microcomputer is simply reprogrammed to run the new application. Let us now look at what @ microcomputer is and how it differs from the other classes of computers. Evolution of the computer marketplace over the last 25 years has taken us from very large mainframe compuers to smaller minicomputers, and now to even smaller ‘microcomputers. These three classes of computers did not originally replace each other. They all coexisted in the marketplace. Computer users had the opportunity to select the computer that best met their needs. The mainframe computer was used in an environment where it serviced a large number of users. For instance, a large university or institution would select a mainframe computer for its data-processing center. Here it would service 4 Inveduction to Mlcroprocessors and Microcomputers Chap. | ‘many hundreds of users. Mainframes are sill widely used today to satistylarge-computer requirements ‘The minicomputer had been the primary computer solution for the small, multiuser business envisonment. In this environment, from several to a hundred users connect to the system with terminals. In this way, they all share the same computer system, and many of these users may be actively working on the computer at the same time. Aa important characteristic ofthis computer system configuration is that all computational power resides atthe minicomputer. The user terminals are what are known as dumb terminals; hat is, they are not selsuficient computers. Ifthe minicomputer is not working, all users are down and cannot do any work at their terminals. Examples of a community that would traditionally use a minicomputer are a department at a university and a business with maltuser-dedicated need, such as application software development Managers ina department may select a microcomputer, such as the PC/A'T, for theit personal needs, such as word processing and database management. The original IBM PC ‘was called a personal computer because it was initially intended tobe a single-user system— that is, the user’ personal computer. Several people could use the same computer, but only ‘one ata time. Today, the microcomputer has taken over most of the traditional minicomputer user base. High-featue, high performance PC/ATS have replaced the minicomputer as a file server. Many users have their personal computers attached to the file server through & “cal area nenvork, However, inthis more modera computes system architecture, all users also have local computational power in their own PCIATS. The file server extends the computational power and system resources such as memory available tothe user. I the fle server is not operating, users can still do work with thei individual personal computers. ‘Along the evolutionary path from mainframes to microcomputers, the basic concepts of computer architecture have not changed. Just ike the mainframe and minicomputer, the microcomputer is a general-purpose electronie data-processing system intended for use in a wide variety of applications. The key difference is that microcomputers, sch as the PC! AT-compatible, employ the newest very largescale integration (VLSI) circuit technology ‘microprocessing unt (MPU) to implement the systom. Microcomputers, such s a Pentium? processor-based PC/AT, which are designed for the high-performance end of the mierocom- pputer market, are physically smaller computer systems, outperform comparable minicom- puter systems, and are available at a much ower cost A 1.3 GENERAL ARCHITECTURE OF A MICROCOMPUTER SYSTEM ‘The hardware of a microcomputer system can be divided into four functional seetions: the input unit, microprocessing unit, memory unit, and. ouput unit. ‘The block diagram of Fig. 1.5 shows this general microcomputer architecture. Each ofthese units has a special function in terms of overall system operation. Next we will lok at each ofthese sections in more detail The heart of a microcomputer is its microprocessing unit (MPU). The MPU of a ‘microcomputer is implemented with a VLSI device known as a microprocessor. A micropro- cessor is a general-purpose processing unit built into a single integrated circuit (IC), The MPU used most widely in PC/ATs today is Intel Corporation's Pentium® processor, which is shown in Fig. 16 ‘The MPU is the part of the microcomputer that executes instructions of the program. and processes data. Itis responsible for performing all arithmetic operations and making the logical decisions initiated by the computer's program. In addition to arithmetic and logic functions, the MPU controls overall system operation, Sec. 1.3 General Architecture of a Microcomputer System 5 r Toot wre Ou om oe Figure 18 General architecture of aa microcomputer system, ‘The input and output units are the means by which the MPU communicates with the outside world, Input units, such as the keyboard on the PC/AT, allow the user to input information or commands to the MPU. For instance, a programmer could key in the lines of a BASIC program from the keyboard. Many other input devices are available for the PCIAT, two examples being a mouse, for implementing a more user-friendly input interface, and a joystick, for use when playing video games. ‘The most widely used output devices of a PC/AT are the display and printer. The ‘output unit in a microcomputer is used to give feedback to the user and for producing documented results. For example, key entries from the keyboard are echoed back to the display. By looking at the screen of the display, the user can confirm that the correct ent was made, Moreover, the results produced by the MPU’s processing can be either display or printed, For our earlier example of a BASIC program, once itis entered and corrected, a listing of the instructions could be printed. Alternative output devices are also available for the microcomputer; for instance, it can be equipped with a color video display instead of the monochrome video display ‘The memory unit in a microcomputer is used to store information, such as number ‘or character data. By store we mean that memory has the ability to hold this information for processing or for outputting at a later time. Programs that define how the computer is to operate and process data also reside in memory. Figure L6_ Pentium processor (Courtesy of Intel Corporation) 6 Introution to Microprocessors and Microcomputers Chap. 1 In the microcomputer system, memory can be divided into two different types, called primary storage memory and secondary storage memory. Secondary storage memory is used for long-term storage of information that is not currently being used. For example, it can hold programs, files of data, and files of information, In the original IBM PC/AT. the floppy disk drive is one of the secondary storage memory subsystems. It was a Sinch drive that used double-sided, quad-density floppy diskette storage media that could each store up to 1.2 Mbytes (1,200,000 bytes) of data. This floppy diskette is an example of a removable ‘media. That is, t0 use the diskette itis inserted into the drive and locked in place. If the diskette is ether full or one with a different file or program is needed, the diskette is simply ‘unlocked and removed and another diskette installed. The IBM PCIAT also employs a second type of secondary storage device called a hard disk drive. Typical hard disk sizes are 20 Mbyte (20 milion bytes), 40 Mbyte, 80 Mbyte, 420 Mbyte, and 1.2 Gbyte (1200 million bytes). Earlier we pointed out that the original IBM PCIAT was equipped with a 20Mbyie hard disk drive. The hard disk drive differs, from the floppy disk drive in that the media is fixed, which means that the media cannot be removed, However, being fixed is not a problem because the storage capacity of the ‘media is so much larger. Today PC/ATs are quipped with a 1.2-Gbyte hard disk drive. Both the floppy diskette and hard disk are examples of read/ite media, That i, a fle of data can be read in from or written out to the storage media in the drive. Another secondary storage device that is becoming very popula in personal computers today is a CD drive, Here a removable compact disk (CD) is used as the storage media, This media has very large storage capacity, more than 600 Kbytes, but is read-only. This means you cannot write information onto a CD for storage. For this reason, itis normelly used for storage of large programs or files of data that are not to be changed. Primary storage memory is normally smaller in size and is used for temporary storage of active information, such asthe operating system of the microcomputer, the program that is currently being run, andthe data that tis processing In Fig. 15 we se that primary storage memory is further subdivided into program-storage memory and data-storage memory. The program section of memory is used to store instructions of the operating system and applica- tion programs. The data section normally contains data that are to be processed by the programs as they are executed: for example, text files for a word-processor program or & database for a database-management program. ‘Typically, primary storage memory is implemented with both read-only memory (ROM) and random-access read/write memory (RAM) integrated circuits. The original IBM PC/AT had 64 Kbytes of ROM and can be configured with either 256 Kbytes or 512 Kbytes cof RAM without adding a memory-expansion board. Modern PC/ATS made with the Pentium® processor are typically equipped with 16 Mbyte of RAM. Data, whether they represent numbers, characters, or instructions of a program, can be stored in either ROM or RAM. In the IBM PCIATT a small part of the operating sytem and BASIC language ate made resident to the computer by supplying them in ROM. By using ROM, this information is made nonvolatile—that is, the information is not lost, Power is tuned off. This type of memory can only be read from: it cannot be written into. On the other hand, data that are to be processed and information that frequently changes ‘must be stored in a type of primary storage memory from which they can be read by the microprocessor, modified through processing, and written back for storage. This requires ‘type of memory that can be both read from and written into, For this reason, such data ate stored in RAM instead of ROM, Earlier we pointed out that the instructions ofa program can also be stored in RAM. In fact, the DOS 5.0 operating system for the PCIAT is provided on diskettes, but to be used it must be loaded into the RAM of the microcomputer. Normally the operating system, Sec. 1.3 General Architecture of @ Microcomputer System 7 ‘supplied on floppy diskettes, is frst read from the diskettes and written onto the hard disk ‘This iscalled copying the operating system onto the hard disk. After this, the foppy diskette version of the DOS may not be used again. The PC is set up so that when itis tumed on, ‘the DOS program is automatically read from the hard disk, written into the RAM, and then run, RAM is an example of a volatile memory. That is, when power is turned off, the data that it holds are lost. This is why the DOS program must be reloaded from the hard disk cach time the PC is turned on, ‘1.4 EVOLUTION OF THE INTEL MICROPROCESSOR ARCHITECTURE The principal way in which microprocessors and microcomputers are categorized isin terms of the maximum number of binary bits in the data they process—that is, their word length. Over time, five standard data widths have evolved for microprocessors and microcomputers: bit, Sit, 16-bit, 32-bit, and 64-bit Figure 1.7 illustrates the evolution of Intel's microprocessors since their introduction in 1972. The first microprocessor, the 4004, was designed to process data arranged as 4-bit words. This organization is also referred 0 as a nibble of data The 4004 implemented a very low-performance microcomputer by today’s standards. This low performance and limited system capability restricted its use to simpler, special purpose applications, A common use was in electronic calculators. Beginning in 1974 a second generation of microprocessors was introduced. These devices, the 8048, 8080, and 8085, were 8-bit microprocessors. That is, they were all designed to process S-bit (J-byte-wide) data instead of 4-bit data. The 8080, identified in Fig. 1.7, ‘was introduced in 1975, ‘These newer S-bit microprocessors were characterized by higher-performance opera tion, larger system capabilities, and greater ease of programming. They were able to provide the system requirements for many applications that could not be satisfied with the earlier 4-bit microprocessors. These extended capabilities led to widespread acceptance of multichip S-bit microcomputers for special-purpose system designs. Examples of these dedicated applications are electronic instruments, cash registers, and printers. Plans for development of third-generation 16-bit microprocessors were announced by many of the leading semiconductor manufacturers in the mid-1970s. Looking at Fig. 1.7, wwe see that Intel’s first 16-bit microprocessor, the 8086, became available in 1979 and was followed the next year by its S-bit bus version, the SO88, This was the birth of Intel's 8086 family architecture. Other family members, such as the 802865, 80186, and 80188, were introduced in the years that followed. ‘These 16-bit microprocessors provided higher performance and! had the ability 10 satisfy a broad scope of special-purpose and general-purpose microcomputer applications. ‘They all have the ability to handle S-bit, 16-bit, and spetial-purpose data types. Moreover, their powerful instruction sets are more in line with those provided by a minicomputer. In 1985, Intel Corporation introduced its first 32-bit microprocessor, the 81386DX, The 80386DX microprocessor brought true minicomputer-level performance to the micto- ‘computer system, This device was followed by a 16-bit external bus version, the 80386SX, in 1988, Intel's second generation of 32-bit microprocessors, called the SO486DX and 81486SX, became available in 1989 and 1990, respectively. They were followed by yet higher- performance family, the Pentium® processors, in 1998. 8 Introduction to Mleropracessors and Microcomputers Chap. 1 Periormance (MIPS) 100 + Penta processor aose_o0Te0 097189 fener 1971 1073 1975 1077 1979 1961 1069 1905 1087 1900 1991 1868 1905 Your Figure 1.7 Evolution of the Tate! microprocessor architecture, Microprocessor Performance: MIPS and iCOMP In Fig. 1.7 the $086 microprocessor families are illustrated relative to ther performance. Here performance is measured in what are called MIPS—that is, how many million instrue- tions they can execute per second, Today, the number of MIPS provided by a microprocessor is the standard most frequently used to compare performance. Notice that performance has vastly increased with each new generation of microprocessor. For instance, the performance identified for the 80386 corresponds to a 80386DX device operating at 33 MH? and equals approximately 11 MIPS. With the introduction of the 80486, the level of performance capability of the architecture was raised t0 approximately 27 MIPS, This shows that perfor- Sec. 14 Evolution ofthe Intel Microprocessor Architecture 9 "HB6DX® -100 CPU ies Dx4-75 CPU es Dx2-66 CPU a6 0x0 PU ies Dx2-50 CPU Has 0x22 CPU i496 sx29 CPU Was 0x25 CPU das 8x25 CPU 498 Sx-20 CPU inaee Dx-23 CPU laas sx. FU i298 x25 600 ‘ae SL-25 CPU (996 8x25 ¢PU 1986 $X-20 0PU Figure 18 iCOMP index rating chert. (Reprinted by permission of Intel Corp. Copyright! Intel Corp. 1993) mance of the 8086 architecture was more than doubled with the introduction of the 33-MHz ‘S0486DX microprocessor. The MIPS used in this chart are known as Drystone V1.1 MIPS. That is, they are measured by running a test program called the Drystone program, and the resulting perfor- mance measurements are normalized to those of a VAX 1.1 computer (VAX 1.1 was a ‘minicomputer manufactured by Digital Equipment Corporation). Therefore, we say that the 8486DX is capable of delivering up to 27 VAX MIPS of performance. ‘Another method, called the {COMP index, is provided by Intel Corporation for com: parison of the performances of their 32-bit microprocessors in a personal computer applica tion, In the iCOMP index chart of Fig. 1.8, a bar is used to represent a measure of the performance for each of Intel's MPUs. Instead of being related to the performance of test program, such as the Drystone program, the (COMP rating of an MPU is based on a variety of 16-bit and 32-bit MPU performance components important to the personal comi- juter, That is, the iCOMP rating encompasses performance components that represent jleger mathematics, loating-point mathematics, graphics, and video. The contribution by 10 Introduction to Microprocessors and Microcomputers Chap. 1 ‘each of these categories is also weighted based on an estimate of their normal occurrence in widely used software applications. In this way, we see that iCOMP is a more broad: based rating of MPU performance for the personal computer applications. ‘The higher the iCOMP rating, the higher the performance offered by the MPU. Notice that the members of the 80386 family offer low performance when compared to the newer £80486 and Pentium! processor families. In fact, the slowest 80386SX MPU shown in Fig, 118, the -20, has a performance rating of 32, whereas the fastest 80386DX, the -33, is rated at 68. In this way, we see that by selecting between the various members ofthe 80386, 80486, and Pentium’ processor families, we can achieve a wide range of system-performance levels. Transistor Density ‘The evolution of microprocessors is made possible by advances in semiconductor process technology. Semiconductor device geometry decreased from about 5 microns in the carly 1970s to submicrons today. Smaller-device geometry permits integration of several orders of magnitude more transistors into the same-size chip and at the same time has led tohhigher operating speeds. In Fig. 1.9 we sce thatthe 4004 contained about 10,000 transistors. ont prover Tanscn pr sec 10006) 0 o_o orem oe eet ea Figure 19° Device complexity Sec, 14 Evolution ofthe intel Microprocessor Architecture W en 55 | [rene se snns | rresoprocese Lt U an att OAM ALLLOALLL LD LMAMLULLNAALLALLALL AAAI Emontied [aow |! 2 |_[eores|_[ ancien | lacmsexl— «+ recess feet [eos | eotene Figure 140 Processors for embedded control and eprogrammuble appl cations. ‘Transistor density was increased fo about 30,000 with the development of the 8086 is 1979; with the introduction of the 80286, the transistor count was further increased to approximately 140,040; and the 275,000 transistors of the 80386DX almost doubled transistor density, The S0486DX is the first family member with a density above the | million transistor Jevel (1,200,000 transistors); with the Pentium® processor's complexity, density has risen to more than 3 million transistors Reprogrammable and Embedded Microprocessors Microprocessors can be classified according to the type of application for which they have been designed. In Fig. 1.10 we have placed Intel microprocessors into two application- oriented categories: reprogrammable microprocessors and embedded microprocessors and ‘microcontrollers. Initially devices such as the 8080 were most widely used as special-purpose ‘microcomputers. By special-purpose microcomputer we mean a system that has been tailored to meet the needs of a specific application. These special-purpose microcomputers were used in embedded control applications—that is, applications in which the microcomputer performs a dedicated control function, ‘Embedded control applications are further divided into those that involve primarily event control and those that require data control. An example of an embedded control pplication that is primarily event control is a microcomputer used for industrial process ‘control. Here the program of the microprocessor is used to initiate a timed sequence of fevents. On the other hand, an application that focuses more on data control than event ‘controlis.a hard disk controller interface. In this case, a block of data that is to be processed — for example, a file of data—must be quickly transferred from secondary storage memory to primary storage memory. ‘The spectrum of embedded control applications requires a wide variety of system features and performance levels, Devices developed specifically for the needs ofthis market- place have stressed low cost and high integration. In Fig. 1.10 we see that the earlier multichip ‘080 solutions were intially replaced by highly integrated 8-bit, single-chip microcomputer devices such as the 8048 and 8051. These devices were tailored to work best as event controllers. For instance, the 8051 offers one-order-of-magnitude-higher performance than the 8080, 4 more powerful instruction set, and special on-chip functions such as ROM, RAM, an interval/event timer, a universal asynchronous receiver/transmitter (UART). and programmable paralle! I/O ports. Today these type of embedded control devices are called ‘microcontrollers. Later, devices such as the S0CLS6XL, SOCIS8XL, and 80386EX were designed to better meet the needs of data-control applications. They are also highly integrated, but they have additional features, such as string instructions and direct-memory access channels, which better handle the movement of data. They are known as embedded microprocessors. 12 Introduction to Microprocessors and Microcomputers Chap. 1 Figure 1.411 Code and system-level compatibility ‘The category of reprogrammable microprocessors represents the class of applications in which a microprocessor is used to implement a general-purpose microcomputer. Unlike a special-purpose microcomputer, a general-purpose microcomputer is intended to run a Wide variety of software applications; that is, while its in use itean be easily reprogrammed ‘o run a different application program. Two examples of reprogrammable microcomputers are the personal computer and file server. In Fig. 1.10 we see that the 8086, S088, 80286, ‘80386, 80486, and Pentium processor are the Intel microprocessors intended for use in this type of application. Architectural compatibility isa critical need of microprocessors developed for use in ‘teprogrammable applications. As shown in Fig. 1.11, each of the new members ofthe 8086 ‘8088 family provides a superset of the earlier device's architecture. That is, the features offered by the 80386 microprocessor are a superset of the 80286 architecture, and those of the 80286 are a superset of the original 8086/8088 architecture, ‘Actually, the 80286, 80386, 80486, and Pentium™ processors can operate in either of two modes—the realaddress mode or protected-address mode. When in the real mode, they operate like a high-performance 8086/8088. They can execute what is called the base insiruction se, which is object code compatible with the 8086/8088, For tis reason, operating, systems and application programs written for the 8086 and S088 run on the 80286, 80386, ‘80486, or Pentium* processor architectures without modification, Further, a number of new instructions has been added in the instruction sets of the 80286, 80386, 80486, and Pentium® processors to enhance their performance and functionality. We say that object code is ‘upward compatible within the 8086 architecture, This means that 8086/8088 code will run ‘on the 80286, 80386, S0486, and Pentium’ processors, but the reverse is not true if any of the new instructions are in use. ned for implementing general-purpose microcomputers must offer more advanced system features than those of a microcontroller. For example, it needs to support and manage a large memory subsystem. The 80286 is capable of managing a 1 GB (1 gigabyte) address space and the 80386 supports 64 T-byte (64 terabytes) of memory, ‘Moreover, a reprogrammable microcomputer, such as a personal computer, normally runs ‘an operating system. The architectures ofthe 80286, 80386, 80486, and Pentium? processors hhave been enhanced with on-chip support for operating system functions such as memory ‘management, protection, and multitasking. These new features become active only when the MPU is operated in the protected mode. The 80386, 80486, and Pentium® processors also have a special mode of operation known as virtual 8086 mode that permits 8086/8088 code to be run in the protected mode. Sec. 1.4 Evolution of the intel Microprocessor Architecture 13 «949 40) uoddas reioyduog Ze aan moustin ay ut Reprogrammable microcomputers, such as those based on the S086 family, require a wide variety of input/output resources. Figure 1.12 shows the kinds of interfaces that are frequently implemented in a personal computer or other microcomputer system, A large family of VLSI peripheral ICs is needed to support reprogrammable microprocessors such as the 8086, 80286, 80386, 80486, and Pentium® processors. Examples are floppy disk control- lers, hard disk controllers, local area network controllers, and communication controllers. For this reason, the 8086, 8088, 80286, 80386, 80486, and Pentium® processors are designed to implement a multichip microcomputer system. In this way a system can easily be config- ured with the appropriate set of 1/0 interfaces, ASSIGNMENTS Section 1.2 1 Which TBM personal computer employs the 8088 microprocessor? 2. What is meant by the term open system? 3. What is the 1] expansion bus of the original IBM PC called? 4. What does PC/AT stand for? 5. What does ISA stand for? 6. What is a reprogrammable microcomputer? 7. Name the three classes of computers, 8 What are the main similarities and differences between the minicomputer and the microcomputer? 9. What does VLSI stand for? Section 1.3 10, What are the four building blocks of a microcomputer system? 1, What is the heart of the microcomputer system called? 12, Is the 8088 an 8-it or 16-bit microprocessor? 13, What is the primary input unit of the PC/AT? Give two other examples of input units available for the PC/AT. 14, What are the primary output devices of the PC/AT? 15. Into what two sections is the memory of a PCIAT partitioned’? 16, What is the storage capacity of the standard S-inch floppy diskette of the original PC/AT? What is the storage capacity of its standard hard disk drive? 17. What do ROM and RAM stand for? 18, How much ROM was provided in the original PC/AT’s processor board? What was the maximum amount of RAM that could be implemented on this processor board? 19, Why must DOS be reloaded from the hard disk each time power is turned on? Section 1.4 20, What are the standard data word lengths for which microprocessors have been developed? 21, What was the first 4-bit microprocessor introduced by Intel Corporation? Eight-bit microprocessor? Sixteen-bit microprocessor? Thirty-two-bit microprocessor? Assignments 15 22, Name five 16-bit members of the 8086 family architecture. . What does MIPS stand for? ‘Approximately how many MIPS are delivered by the 33 MElz S0486DX” What is the name of the program that is used {0 run the MIPS measurement test for the data in Fig. 18? What is the iCOMP rating of an 80386SX-25 MPU? An 80386DX-25 MPU? Approximately how many transistors are used to implement the 8088 ‘microprocessor? The 80286 microprocessor? The 80386DX microprocessor? The '80486DX microprocessor? The Pentium® processor? 28, What is an embedded microcontroller? 29, Name the two groups into which embedded processors are categorized based on applications. 30, What is the difference between a multichip microcomputer and a single-chip ‘microcomputer? 31, Name six 8086 family microprocessors intended for use in reprogrammable ‘microcomputer applications. 432, Give the names for the 80386DX's two modes of operation. 3. What is meant by upward software compatibility relative to 8086 architecture microprocessors? 34, List three advanced architectural features provided by the 80386DX microprocessor. 36. Give three types of VLSI peripheral support devices needed in a reprogrammable sicrocomputer system. 3 SRORE 16 Intraduction to Microprocessors and Microcomputers Chap. 1 a Real-Addressed Mode Software Architecture of the 80386DX Microprocessor ‘A 2.1 INTRODUCTION In this chapter we begin our study of the 80386DX microprocessor and its assembly language programming. To program the 80386DX with assembly language, we must understand how the microprocessor and its memory subsystem operate from a software point of view. Remember that the 80386DX can operate in either of two modes, called the real-addressed ‘mode (real mode) and the protecied-addressed mode (protected mode). Moreover, we pointed out in Chapter 1 that when in the real mode, the 80386DX operates like a very high-performance 8086 microprocessor. In fact, a 16:MElz 80386DX provides more than 10 times higher performance than that of the standard 5-MHz. 8086. Here we will examine just the real-mode software architecture. The 80386DX's protected mode is presented in Chapter 7. The following topics are covered in this chapter: 1. Internal architecture of the 80386DX microprocessor 2, Realsmode software model of the 80386DX microprocessor 3. Real-mode memory address space and data organization 4. Data types ‘5. Segment registers and memory segmentation 6 Instruction pointer 7. General-purpose data registers 8, Pointer and index registers 9, Flags register 10, Generating a real-mode memory address 11. Tho stack 12, Real-mode input/output address space ‘A 2.2 INTERNAL ARCHITECTURE OF THE 80386DX MICROPROCESSOR The internal architecture of the 8086 family of microprocessors has changed a lol as part of the evolutionary process from the original 8086 to the 80386, All members of the S086 family employ what is called parallel processing. That is, they are implemented with simulta- neously operating multiple processing units. Each unit has a dedicated function and they ‘operate at the same time, The more the parallel processing, the higher the performance of the microprocessor. “The 8086 microprocessor contains just two processing units: the bus interface unit and ‘execution unit, In the 80286 microprocessor, the internal architecture was further partitioned into four independent processing elements’ the bus unit the instruction unit, the execution tant, and the address unit. This additional parallel processing provided an important contri- bution to the higher level of performance achieved with the 80286 architecture. ‘The 80386DX’s internal architecture is illustrated in Fig. 2.1. Here we see that to enhance the performance, more parallel processing elements are provided. Notice that now there are six functional units; the execution unit, the segment unit, the page unit, the bus aunt, the prefetch unit, and the decode unit. Let us now look more closely at each of the processing units of the 80386DX. he bus tnit is the S0386DX's interface to the outside world. By interface, we mean the path by which it connects to external devices. The bus interface provides a 32-bit data bus, a 32-bit address bus, and the signals needed to control transfers over the bus. In fact, S-bit, 16-bit, and 32-bit data transfers are supported. These buses are demultiplexed like those of the 80286, That is, the 80386DX has separate pins for its address and data bus lines. This demultiplexing of address and data results in higher performance and easier hardware design. Expanding the data bus width to 32 bits further improves the performance of the 80386DX's hardware architecture as compared to that of either the 8086 or 80286. "The bus unit is responsible for performing all external bus operations. This processing. ‘unit contains the lateles and drivers for the address bus, transceivers for the data bus, and Figure 241 Internal architecture ofthe SIS86DX microprocessors. (Re printed with permission of Intel Corp. Copyright /Intel Corp. 1986) 18 ReatAcdressed Mode Sontware Architecture ofthe BO3B6DX Microprocessor Chap. 2 control logic for signaling whether a memory, input/output, or interrupt-acknowledge bus cycle is being performed. Looking at Fig. 2.1, we find that for data accesses, the address of the storage location that is to be accessed is input from the paging unit, and for code accesses the address is provided by the prefetch unit ‘The prefetch unit implements a mechanism known as an instruction stream queue. This queue permits the 80386DX to prefetch up to 16 bytes of instruction code. Whenever the queue is not full—that is, it has room for at least 4 more bytes and, atthe same time, the execution unit is not asking it to read or write operands from memory—the profetch "unit supplies addresses to the bus interface unit and signals it to look ahead ia the program by fetching the next sequential instructions, Prefected instructions are held in the FIFO gueue for use by the instruction decoder. Whenever bytes are loaded at the input end of the queue, they are automatically shifted up through the FIFO to the empty locations near the output, With its 32-bit data bus, the 80386DX fetches 4 bytes of instruction code in a single memory cycle. Through this prefeteh mechanism, the feteh time for most instructions is hidden. Ifthe queue in the prefetch unit is full and the execution unit is not requesting access to operands in memory, the bus interface unit does not need to perform any bus cycle. ‘These intervals of no bus activity, which occur between bus eyeles, are known as idle states, ‘The prefetch unit prioritizes bus activity. Highest priority is given to operand accesses for the execution unit, However, ithe bus unit is already in the process of fetching instruction ‘ode when the execution unit requests it to read or write operands from memory or I/O, the current instruction fetch is first completed before the operand read/write cycle is initiated In Fig. 2.1, we see that the decode unit accesses the output end of the prefetch unit's instruction queue. It reads machine code instructions from the output side of the prefetch «queue and decodes them into the microcode instruction format used by the execution unit. ‘That is, it off-loads the responsibility for instruction decoding from the execution unit. ‘The instruction queue within the 80386DX’s instruction unit permits three fully decoded instructions to be held waiting for use by the execution unit, Once again the result is improved performance for the MPU. ‘The execution unit includes the arithmetic/logic unit (ALU), the 80386DX’s registers, special multiply, divide, and shift hardware, and a control ROM. By registers, we mean the '80386DX’s general-purpose registers, such as EAX, EBX, and ECX. The control ROM. contains the mictocode sequences that define the operation performed by each of the '80386DX's machine code instructions. The exccution unit reads decoded instructions fom the instruction queue and performs the operations that they specify, It is the ALU that performs the arithmetic, logic, and shift operations required by an instruction. If necessary, during the execution of an instruction, it requests the segment and page units to generate ‘operand addresses and the bus interface unit to perform read or write bus cycles to access data in memory or 1/0 devices. The extra hardware that is provided to perform multiply, divide, shift, and rotate operations improves the performance of instructions that employ these functions. ‘The segment and page units provide the memory-management and protection services {or the 80386DX. They off-load the responsiblity for address generation, address translation, and segment checking from the bus interface unit, thereby further boosting the performance of the MPU. The segment unit implements the segmentation model of the 80386DX's memory management. That is, it contains dedicated hardware for performing high-speed address calculations, logical-to-linear address translation, and protection checks. For in- stance, when in the real moe, the execution unit requests the segment unit to obtain the address of the next instruction to be fetched by adding an appended version of the current contents of the code segment (CS) register with the value in the instruction pointer (IP) See. 2.2 Internal Architecture of the 80386DX Microprocessor 19 register to obtain the 20-bit physical address that is to be output on the address bus. This address is passed on to the bus unit, For protected mode, the segment unit performs the logical-to-Hinear address translation and various protection checks needed when performing bus eyeles. t contains the segment registers and the 6-word % 64-bit cache that is used to hold the current descriptors within the 80386DX, “The page unit implements the protected mode paging model of the 80386DX's memory management, It contains the translation lookaside buffer that stores recently used page directory and page table entries, When paging is enabled, the linear address produced by the segment unit is used as the input of the page unit. Here the linear address is translated into the physical address of the memory or 1/O location to be accessed. This physical memory of 1/0 address is output to the bus interface unit. ‘A 2.3 REAL-MODE SOFTWARE MODEL (OF THE 80386DX MICROPROCESSOR “The purpose of a software model isto aid the programmer in understanding the operation cf the microcomputer system from a software point of view. To be able to program a microprocessor, one does not necessarily nced to know all ts hardware architecture features. For instance, we do not need to know the function of the signals at its various pins, their clectrical connections, or their electrical switching characteristics. The function, interconnee- tion, and operation of the internal circuits of the microprocessor also need not normally bbe considered, What is important to the programmer is to know the various registers within the device and to understand their purpose, functions, operating capabilities, and limitations. Furthermore, itis essential to know how external memory is organized and how itis accessed to obtain instructions and data. ‘The software architecture of the 80386DX microprocessor is illustrated with the soft- ‘ware model shown in Fig. 22. Looking at this diagram, we find that it includes six 16-bit registers and twenty-four 32-bit registers. The registers (or parts of registers) that are important to real-mode application programming are highlighted in the diagram. Nine of them—the data registers (EAX, EBX, ECX, and EDX), the pointer registers (EBP and ESP), the index registers (ESL and EDD), and the flag register (FLAGS)—are identical to the corresponding registers in the 8086 aad 80286 software models except that they are row all 32 bits in length. On the other hand, the instruction pointer (IP) and segment resisters (CS, DS, $S, and ES) are stil 16 bits in Iength. From a software point of view. all these registers serve functions similar to those they performed in the S086 and 80286 architectures, For instance, CS:IP points to the next instruction that is to be fetched. Several new registers are found in the 80386DX’s software model. For example, it has ‘wo more data segment registers, denoted FS and GS. These registers are not implemented in either the 8086 or 80286 microprocessors. Another new register is called control register zero (CR)). The 5 least significant bits of this register are called the machine status word (MSW) and are identical to the MSW of the 80286 microprocessor, However, only one bit, in the MSW is active in real mode. This is the protection enable (PE) bit. PE is used to switch the 80386DX from real to protected mode, At reset, PE is set (0 0 and selects the rea-addressed mode of operation. Looking at the software model in Fig. 2.2, we see that the S0386DX architecture implements independent memory and I/O address spaces. Notice that the memory address space is 1,048,576 bytes (1 Mbyte) in length and the 1/0 address space is 65,536 bytes (64 bytes) in length, We are concerned here with what can be done with this architecture and 20 ReatAcdrested Mode Sofware Architecture of the 80386DX Microprocessor Chap, 2

You might also like