MP - UNIT 1 and 2
MP - UNIT 1 and 2
210254:MICROPROCESSOR
Savitribai Phule Pune University
Ganeshkhind Rd, Ganeshkhind, Pune, Maharashtra
Presented by:
1974 - 8080
• Intel’s first general purpose microprocessor (8 bit)
x86 Evolution
• 80286
– 16 bit
• 8086
– much more powerful
– 16 bit • 80386
– instruction cache, prefetch few – 32 bit
instructions – Support for multitasking
– 8088 (8 bit external bus) used in first
IBM PC • 80486
– sophisticated powerful cache and
instruction pipelining
– built in maths co-processor
x86 Evolution
• Pentium • Pentium III
• Superscalar • Additional floating point instructions for 3D
graphics
• Multiple instructions executed in parallel
• Pentium 4
• Pentium Pro
• Note Arabic rather than Roman numerals
• Increased superscalar organization
• Further floating point and multimedia
• Aggressive register renaming enhancements
• branch prediction
• data flow analysis
• Core
• speculative execution • First x86 with dual core
• Pentium II • Core 2
• MMX technology • 64 bit architecture
• graphics, video & audio processing • Core 2 Quad – 3GHz – 820 million transistors
• Four processors on chip
Refer Intel web pages for detailed information on processors
80386 DX Features and Architecture,
Programmers Model
Features of 80386DX
• Flexible 32-bit Microprocessor
– 8, 16, 32-Bit Data Types • Hardware Debugging Support
– 8 General Purpose 32-Bit Registers
– 32 bit ALU • 3 stage Pipeline
– 32 bit Data Bus(4 memory Bank)
• Multitasking
– 32 bit Address Bus( 4 GB Memory)
• Operating Speed-16,20,25,33 MHz
• Very Large Address Space
– 4 Gigabyte Physical • SX (16 bit Data Bus)
– 64 Terabyte Virtual DX(32 bit Data Bus)
– 4 Gigabyte Maximum Segment Size
• Integrated Memory Management Unit
– Segmentation and Paging
– 4 Levels of Protection
– Fully Compatible with 80286
80386DX Architecture
• A bus interface.
• offers address pipelining, dynamic data bus sizing, and direct Byte Enable signals for
each byte of the data bus
Execution Unit
• The execution unit contains the
Eight 32-bit general purpose registers which are used for both address calculation, data
operations and
A 64-bit barrel shifter used to speed shift, rotate, multiply, and divide operations.
• The multiply and divide logic uses a 1-bit per cycle algorithm.
• The multiply algorithm stops the iteration when the most significant bits of the multiplier are
all zero.
The instruction unit decodes the instruction opcodes and stores them in the decoded
instruction queue for immediate use by the execution unit.
Segmentation Unit:
Segmentation allows the managing of the logical address space by providing an extra
addressing component, one that allows
easy code
data relocatability, and
efficient sharing
Paging Unit
• The paging mechanism operates beneath and is transparent to the segmentation
process, to allow management of the physical address space.
Instruction pointer
Flags register
Register Organization of 80386
Flags Register
Operating modes, Addressing modes
and data types
Processing Modes
• The Intel386 DX modes of operation: • Protected mode:
– Real Address Mode (Real Mode), and – Natural 32-bit environment, in which all
– Protected Virtual Address Mode instructions and features are available.
(Protected Mode). – It provides access to the sophisticated
– Virtual 8086 mode (V86 Mode). memory management, paging and privilege
capabilities of the processor
• The 8/16/32 bit data required to execute an instruction is present in 8/16/32 bit register is
given along with the instruction is called “Register addressing mode.”
• The 8/16/32 bit data required to execute an instruction is given directly along with the
instruction is called “Immediate addressing mode”.
• Based Index addressing Mode with Displacement: The contents of a BASE register is added
to the contents of an INDEX register to form the effective address of an operand.
• Based Scaled Index addressing Mode with Displacement: The contents of an INDEX register
are multiplied by a SCALING factor, the result is added to the contents of a BASE register and a
DISPLACEMENT to form the operand's offset.
• Various Classes
o General purpose data movement instructions
o Stack manipulation instructions
o Type-conversion instructions
General Purpose data movement
instructions
• MOV (Move): Transfers a byte, word or doubleword from the source operand
to the destination operand
• Operand options
– To a register from memory
– To memory from a register
– Between general registers
– Immediate data to a register
– Immediate data to a memory
• PUSHA
• POP
• POPA
Type Conversion Instructions
• AND:
Bit scan instructions
• OR:
Rotate and shift instructions
• XOR:
Unconditional Transfer
• JMP (Jump)- one way transfer of execution
Instructions
No-operation instruction
• NOP (No operation)
Translate instruction
• XLAT
Microprocessor
Initialization
Initialization
Page 0:
• Certain I/O instructions can only perform
operations to ports in this part of the address
range.
• Other I/O instructions can input/output data
for ports anywhere in the address space.
Separate I/O address space
(An Isolated I/O)
Advantages: -
1 MByte memory address space is available for use
with memory.
Special instructions have been provided in the
instruction set of 8088/8086 to perform isolated
I/O input and output operations.
These instructions have been tailored to maximize
I/O performance.
Disadvantages: -
All input and output data transfers must take place
between AL or AX register and the I/O port
Memory-mapped I/O
Disadvantages:
Memory instructions tend to execute
slower than those specifically designed
for isolated I/O.
Part of the memory address space is lost
I/O Instructions
• The block (or string) I/O instructions INS and OUTS move blocks of
data between I/O ports and memory space.
• After a bus idle state, the processor always • Terminating a read cycle or write cycle, like
uses non-pipelined address timing. any bus cycle, requires acknowledging the
cycle by asserting the READY# input.
• However, the NA# (Next Address) input may
be asserted to select pipelined address • Until acknowledged, the processor inserts
timing for the next bus cycle. wait states
Non-pipelined read & write
cycles
Non-pipelined read & write
cycles
• At the end of the second bus state within the bus cycle,
READY# is sampled
• Else the cycle continues another bus state (a wait state) and
READY# is sampled again at the end of that state.
System Architecture
Systems Registers
• EFLAGS
• Control Registers
• Debug Registers
• Test Registers
Systems Registers
EFLAGS
• Control Registers
• Debug Registers
• Test Registers
EFLAGS
• Control Registers
• Debug Registers
• Test Registers
Memory-Management Registers
• Four registers of the 80386 locate the data structures that control segmented
memory management:
GDTR Global Descriptor Table Register
LDTR Local Descriptor Table Register
• These registers point to the segment descriptor tables GDT and LDT.
• TR Task Register
This register points to the information needed by the processor to define the
current task.
Systems Registers
• EFLAGS
Control Registers
• Debug Registers
• Test Registers
Control Registers
Systems Registers
• EFLAGS
• Control Registers
Debug Registers
• Test Registers
Debug Registers
• Six registers: to control debug
features
• Accessed by variants of the MOV
instruction
• debug registers are privileged
resources
Registers are:
Debug Address Registers (DRO-
DR3)
Debug Status Register (DR6)
Debug Control Register (DR7)
Systems Registers
• EFLAGS
• Control Registers
• Debug Registers
Test Registers
Test Registers
• Two test registers are provided for the purpose of testing.
• TR6 is the test command register, and TR7 is the test data
register.
• Physical Address: This is the data field of the TLB. On a write to the TLB, the TLB
entry allocated to the linear address in TR6 is set to this value. On a TLB lookup, if
HT is set, the data field (physical address) from the TLB is read out to this field. If
HT is not set, this field is undefined.
• HT: For a TLB lookup, the HT bit indicates whether the lookup was a hit (HT <- 1)
or a miss (HT <- 0). For a TLB write, HT must be set to 1.
• REP: For a TLB write, selects which of four associative blocks of the TLB is to be
written. For a TLB read, if HT is set, REP reports in which of the four associative
blocks the tag was found; if HT is not set, REP is undefined.
Test Operations
To write a TLB entry
• Move a doubleword to TR7 that contains the desired physical address, HT, and
REP values. HT must contain 1. REP must point to the associative block in
which to place the entry
• Move a doubleword to TR6 that contains the appropriate linear address, and
values for V, D, U, and W. Be sure C=0 for "write" command.