1 1 2102440 Introduction to 2102440 Introduction to Microprocessors Microprocessors Suree Suree Pumrin Pumrin , Ph.D. , Ph.D. Chapter 1 Chapter 1 Intro to 80x86 Intro to 80x86 2102440 Introduction to Microprocessors 2102440 Introduction to Microprocessors 2 2 Topics Topics Introduction Introduction Goals Goals Brief History of Microprocessors Brief History of Microprocessors Microprocessor Systems Overview Microprocessor Systems Overview Microprocessor Data Types Microprocessor Data Types Intro to 80x86 Intro to 80x86 2102440 Introduction to Microprocessors 2102440 Introduction to Microprocessors 3 3 Topics (cont.) Topics (cont.) Inside the computer Inside the computer Inside the 8086 Inside the 8086 Physical address calculation examples Physical address calculation examples Segments in the 8086 Segments in the 8086 2102440 Introduction to Microprocessors 2102440 Introduction to Microprocessors 4 4 Goals Goals Goals Goals Understanding what make microprocessors work Understanding what make microprocessors work Assembly programming Assembly programming Design, implementation, and integration experience Design, implementation, and integration experience on microprocessor board and microcomputer on microprocessor board and microcomputer Basic Input/output interfacing microprocessors with Basic Input/output interfacing microprocessors with memory system, serial and parallel ports memory system, serial and parallel ports Debugging HW/SW Debugging HW/SW Interrupt and DMA Interrupt and DMA
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
11
2102440 Introduction to 2102440 Introduction to Microprocessors Microprocessors
Suree Suree PumrinPumrin, Ph.D., Ph.D.
Chapter 1Chapter 1Intro to 80x86Intro to 80x86
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 22
TopicsTopics
IntroductionIntroductionGoalsGoalsBrief History of MicroprocessorsBrief History of MicroprocessorsMicroprocessor Systems OverviewMicroprocessor Systems OverviewMicroprocessor Data TypesMicroprocessor Data TypesIntro to 80x86Intro to 80x86
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 33
Topics (cont.)Topics (cont.)
Inside the computerInside the computerInside the 8086Inside the 8086Physical address calculation examplesPhysical address calculation examplesSegments in the 8086Segments in the 8086
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 44
GoalsGoals
GoalsGoalsUnderstanding what make microprocessors workUnderstanding what make microprocessors workAssembly programmingAssembly programmingDesign, implementation, and integration experience Design, implementation, and integration experience on microprocessor board and microcomputeron microprocessor board and microcomputerBasic Input/output interfacing microprocessors with Basic Input/output interfacing microprocessors with memory system, serial and parallel portsmemory system, serial and parallel portsDebugging HW/SW Debugging HW/SW Interrupt and DMAInterrupt and DMA
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 55
Brief History of MicroprocessorsBrief History of Microprocessors
The mechanical ageThe mechanical ageThe electrical ageThe electrical ageThe microprocessor ageThe microprocessor ageThe modern microprocessorThe modern microprocessor
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 66
The Mechanical Age (I)The Mechanical Age (I)500 B.C. 500 B.C.
Chinese : Abacus Chinese : Abacus –– a a wooden rack holding two wooden rack holding two horizontal wires with bead horizontal wires with bead stung on themstung on them
16421642BlaiseBlaise Pascal: Calculator Pascal: Calculator ––mechanical adder and mechanical adder and subtractersubtracter using of gears using of gears and wheelsand wheels
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 77
The Mechanical Age (II)The Mechanical Age (II)
18231823Charles Babbage: Charles Babbage:
•• Difference engine Difference engine ––mechanize the mechanize the calculation of calculation of polynomial functions polynomial functions
•• Analytical engine Analytical engine ––perform any perform any mathematical operation mathematical operation automaticallyautomatically
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 88
The Electrical Age (I)The Electrical Age (I)
18891889HollerithHollerith: The punched : The punched card card –– counted, sorted, counted, sorted, and collated and collated informationinformation
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 99
The Electrical Age (II)The Electrical Age (II)
19431943Turing: The first Turing: The first special purpose special purpose computer (Colossus) computer (Colossus) ––a fixed program a fixed program computer system computer system
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 1010
The Electrical Age (III)The Electrical Age (III)
19461946The University of The University of Pennsylvania: the first Pennsylvania: the first general purpose general purpose computer computer –– ENIAC ENIAC (Electronics Numerical (Electronics Numerical Integrator and Integrator and Calculator)Calculator)
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 1111
The Microprocessor AgeThe Microprocessor Age
19451945von Neumann: von Neumann machines von Neumann: von Neumann machines ––revolutionizes the way people think about revolutionizes the way people think about computer designcomputer design
1950s1950sTransistor and magnetic core memoryTransistor and magnetic core memory
1990s1990s91: MIPS Computer Systems 91: MIPS Computer Systems –– 6464--bit R4000 RISC bit R4000 RISC machinemachine92: Digital92: Digital’’s Alpha 21064 s Alpha 21064 –– 6464--bit at 300 MHzbit at 300 MHz95: Intel Pentium at 133 MHz95: Intel Pentium at 133 MHz97: Intel Pentium II97: Intel Pentium II99: Intel Pentium III at 500 MHz99: Intel Pentium III at 500 MHz
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 1414
The Modern Microprocessor (III)The Modern Microprocessor (III)
2000s2000s00: Intel 1 GHz00: Intel 1 GHz01: Intel Pentium 4 at 1.7 and 2 GHz01: Intel Pentium 4 at 1.7 and 2 GHz02: Intel Mobile Processor at 1 GHz (low 02: Intel Mobile Processor at 1 GHz (low power)power)05: 05: The Intel Itanium The Intel Itanium
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 1515
The Future of MicroprocessorsThe Future of Microprocessors
No one can accurately predict!No one can accurately predict!MulticoreMulticore processor processor –– multiple processor multiple processor cores on a single piece of siliconcores on a single piece of silicon????
The new challenge is functionalityThe new challenge is functionalityBalancing in clock frequency, design Balancing in clock frequency, design complexity, and power consumptioncomplexity, and power consumption
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 1616
MooreMoore’’s Laws Law
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 1717
The Intel MicroprocessorsThe Intel Microprocessors
42,000,0002000Pentium 4 processor
24,000,0001999Pentium III processor
7,500,0001997Pentium II processor
3,100,0001993Pentium® processor
1,180,0001989486™ DX processor
275,0001985386™ processor
120,0001982286
29,00019788086
5,00019748080
2,50019728008
2,25019714004
TransistorsYear of introduction
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 1818
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 1919
Microprocessor Systems OverviewMicroprocessor Systems OverviewInstruction set Instruction set
Complex instruction set computers (CISC)Complex instruction set computers (CISC)Reduced instruction set computers (RISC)Reduced instruction set computers (RISC)
Basic computer systemBasic computer systemCentral processing unit (CPU) Central processing unit (CPU) –– Registers, Arithmetic Logic Unit (ALU), Registers, Arithmetic Logic Unit (ALU), control unitcontrol unitMemory Memory –– program & dataprogram & dataInput and Output (I/O) systemInput and Output (I/O) systemPeripherals Peripherals –– Analog to digital converter, timer unit, serial Analog to digital converter, timer unit, serial communications interface, etc.communications interface, etc.Data path Data path –– address bus, data bus, control busaddress bus, data bus, control bus
WhatWhat’’s the difference in microprocessors, microcontrollers, and s the difference in microprocessors, microcontrollers, and microcomputers?microcomputers?
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 2020
CISC CISC vsvs RISCRISCComplex instruction set computer (CISC), e.g., Complex instruction set computer (CISC), e.g., x86, 680x0x86, 680x0
Typical PC architectureTypical PC architectureMany operations, some of them very complexMany operations, some of them very complex
Reduced instruction set computer (RISC), e.g., Reduced instruction set computer (RISC), e.g., PIC, ARM, SPARCPIC, ARM, SPARC
Simpler instructions can be executed at higher speedSimpler instructions can be executed at higher speedRISC is common used in workstations for higher RISC is common used in workstations for higher performanceperformancePentium is a combination of CISC and RISC.Pentium is a combination of CISC and RISC.
Modern Modern CISCsCISCs implemented as implemented as RISCsRISCs internallyinternallyOnly the total system performance mattersOnly the total system performance matters
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 2121
von Neumann Architecture (I)von Neumann Architecture (I)
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 2222
von Neumann Architecture (II)von Neumann Architecture (II)
Memory stores programs and dataCentral processing unit (CPU) fetches and executeInput/output unit interface with input and output devices, e.g., printer, disk, CRT, keyboard
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 2323
Harvard ArchitectureHarvard Architecture
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 2424
von Neumann (Princeton) von Neumann (Princeton) vsvsHarvardHarvard
Data and instructions mixed in the same Data and instructions mixed in the same memory: Princeton architecturememory: Princeton architectureData and instructions in separate memory: Data and instructions in separate memory: Harvard architectureHarvard architecturePrinceton architecture simpler to Princeton architecture simpler to implementimplementMost Most DSPsDSPs use Harvard architecture for use Harvard architecture for streaming data streaming data
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 2525
MicroprocessorsMicroprocessors
Typically external program memoryTypically external program memoryRange from devices with few thousand Range from devices with few thousand transistors to 5transistors to 5--10 million transistors10 million transistorsTo implement complete computer must still To implement complete computer must still include input/output subsystems, memory, etc.include input/output subsystems, memory, etc.The components connected via system busThe components connected via system busIntel: x86 family, 8088, 80286, Intel: x86 family, 8088, 80286, ……, Pentium, PentiumZilogZilog: Z80: Z80Motorola: 680x0 familyMotorola: 680x0 family
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 2626
MicrocontrollersMicrocontrollersIncludes microprocessor, I/O subsystemsIncludes microprocessor, I/O subsystemsTypically include peripherals, e.g., timers, serial Typically include peripherals, e.g., timers, serial communications channels, Analog to digital conversion, communications channels, Analog to digital conversion, digital to analog conversion, direct memory access digital to analog conversion, direct memory access (DMA)(DMA)Memory subsystem may or may not be includedMemory subsystem may or may not be includedMicrocontroller Microcontroller = Microprocessor + = Microprocessor +
MCSMCS--51 family (Intel, Dallas, 8032, 89C52, 8051,51 family (Intel, Dallas, 8032, 89C52, 8051,……), ), 68HC11 family (Motorola)68HC11 family (Motorola)
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 2727
MicrocomputersMicrocomputers
Similar to microcontroller but used as part of a Similar to microcontroller but used as part of a larger embedded systemlarger embedded systemComplete computerComplete computerImplemented using microprocessorImplemented using microprocessorTypically constructed utilizing numerous Typically constructed utilizing numerous integrated circuitsintegrated circuitsComplexity varies: simple microcomputer can be Complexity varies: simple microcomputer can be implemented on single chip with limited onboard implemented on single chip with limited onboard memory, simple I/O systemmemory, simple I/O system
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 2828
Microprocessor Data Types (I)Microprocessor Data Types (I)
Signed and unsigned binary integersSigned and unsigned binary integersBinary coded decimal (BCD)Binary coded decimal (BCD)American Standard Code for Information American Standard Code for Information Interchange (ASCII)Interchange (ASCII)FloatingFloating--point numbers point numbers
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 2929
Microprocessor Data Types (II)Microprocessor Data Types (II)
Signed binary integersSigned binary integersTwoTwo’’s complement forms complement form•• 88--bit signed number: FFbit signed number: FF16 16 = = --11•• 1616--bit signed number: bit 15 represents the sign bit signed number: bit 15 represents the sign
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 3030
Microprocessor Data Types (III)Microprocessor Data Types (III)
ASCIIASCII77--bit code represents alphanumeric (alpha characters bit code represents alphanumeric (alpha characters and numbers) and special symbolsand numbers) and special symbols
FloatingFloating--point point Three components: sign, exponent, and mantissaThree components: sign, exponent, and mantissaExample: Example: --4.5x104.5x10--22
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 3737
Internal Organization Internal Organization of Computers (I)of Computers (I)
CPU
Read/write
Memory(RAM, ROM)
I/O(monitor,
printer, etc.)
Address bus
Data bus
Control bus
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 3838
Internal Organization Internal Organization of Computers (II)of Computers (II)
CPU (central processing unit): Registers, CPU (central processing unit): Registers, Arithmetic Logic Unit (ALU), control unitArithmetic Logic Unit (ALU), control unit
Execute (process) information stored in memoryExecute (process) information stored in memoryMemoryMemory
Store program and dataStore program and dataI/O devicesI/O devices
Provide means of communicating with CPUProvide means of communicating with CPUData path (bus): address bus, data bus, control Data path (bus): address bus, data bus, control busbus
Carry information from place to placeCarry information from place to place
For a device (memory or I/O) to be recognized by the For a device (memory or I/O) to be recognized by the CPU, it must be assigned anCPU, it must be assigned an addressaddress..
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 3939
PipeliningPipelining
Pipelining: the CPU fetches and executes at Pipelining: the CPU fetches and executes at the same timethe same time
fetch 1 exec 1 fetch 2 exec 2non-pipelined
pipelined fetch 1 exec 1
fetch 2 exec 2
fetch 3 exec 3
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 4040
BusBus
Data bus: a pathway between the CPU Data bus: a pathway between the CPU and its external devicesand its external devices
Bidirectional: CPU uses data bus either to Bidirectional: CPU uses data bus either to receive or to send data.receive or to send data.
Address bus: identify the devices and Address bus: identify the devices and memory connected to the CPUmemory connected to the CPU
Unidirectional: CPU uses the address bus Unidirectional: CPU uses the address bus only to send out addresses.only to send out addresses.For x address lines, the number of locations, For x address lines, the number of locations, which CPU can communicate, = 2which CPU can communicate, = 2x x ..
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 4141
Memory MapMemory Map
Video RAM(128 k)
ROM(256k)
A0000
BFFFFC0000
FFFFF
BIOS (Basic Input Output System) (64k)
User RAM(640 k)
00000
9FFFF
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 4242
Generating a Memory AddressGenerating a Memory Address
Segment
Offset
0 0 0 0
20-bit Physical address
ADDER
19 0
15 0
19 0
4
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 4343
Boundaries of segmentBoundaries of segment
DS
BX
Memory
DS:FFFFH
Data segment
DS:0000H
DS:BX
8086
Highestaddressed byte
Lowestaddressed byte
Byte addressable CPU
2102440 Introduction to Microprocessors2102440 Introduction to Microprocessors 4444
All Intel microprocessors and many All Intel microprocessors and many minicomputers use the little minicomputers use the little endianendian convention convention (high byte goes to high address).(high byte goes to high address).Motorola microprocessors and mainframes use Motorola microprocessors and mainframes use big big endianendian (high byte goes to low address).(high byte goes to low address).