Docsity

Processor Unit Design-Computer Architechture-Lecture Slides, Slides of Computer Architecture and Organization

Partial preview of the text

Download Processor Unit Design-Computer Architechture-Lecture Slides and more Slides Computer Architecture and Organization in PDF only on Docsity!

Processor Unit Design

Chapter 5

CPU Basics

^ A typical CPU has three major components:^ ■^ Register Set,^ ■^ Arithmetic Logic Unit, and^ ■^ Control Unit (CU). ^ The register set is usually a combination ofgeneral-purpose and special-purposeregisters.^ ■^ General-purpose registers are used for anypurpose.^ ■^ Special-purpose registers have specific functionswithin the CPU.

Structure - The CPU Computer

ArithmeticandLogin UnitInternal CPUInterconnectionControlUnit Registers I/O^ CPUSystemBus Memory

CPU

Structure - The Control Unit CPU

SequencingLogin Control UnitRegisters andDecodersControlMemory ALU^ ControlInternalUnitBus Registers

Control Unit

©Javaid Khurshid

Computer Components: Top Level View

Simple Execution Cycle  A typical and simple execution cycle in a CPU is asfollows: ■ The next instruction to be executed, whose address isobtained from the PC, is fetched from the memory andstored in the IR. ■ Instruction is decoded. ■ Operands are fetched from the memory and stored inCPU registers, if needed. ■ Instruction is executed. ■ Results are transferred from CPU registers to thememory, if needed.  The execution cycle is repeated as long as thereare more instructions to execute.  A check for pending interrupts is usually included inthe cycle.

Memory Access Registers  Two registers are essential in memory write andread operations: ■ memory data register

( MDR ) and ■^ memory address register

( MAR ). ^ The^ MDR

and^ MAR^

are used exclusively by the CPU and are not directly accessible toprogrammers.

Memory Access Registers…  In order to perform a write operation into a specifiedmemory location, the MDR and MAR are used asfollows: ■ The word to be stored into the memory location is firstloaded by the CPU into

MDR ■^ The address of the location into which the word is to bestored is loaded by the CPU into a

MAR.

^ Similarly, to perform a memory read operation, theMDR and MAR are used as follows:^ ■^ The address of the location from which the word is to beread is loaded into the MAR.^ ■^ The required word will be loaded by the memory into theMDR ready for use by the CPU.

©Javaid Khurshid

Example of Program Execution

Condition Registers

^ Condition registers, or flags, are used to maintainstatus information. ^ Some architectures contain a special ProgramStatus Word (PSW) register. ^ The PSW contains bits that are set by the CPU toindicate the current status of an executing program. ^ These indicators are typically for arithmeticoperations, interrupts, memory protectioninformation, or processor status.

Special Purpose Address Registers… ^ Stack Pointer:^ ■^ A stack is a data organization mechanism in which thelast data item stored is the first data item retrieved.^ ■^ Two specific operations can be performed on a stack.These are the

Push^ and the

Pop^ operations. ■^ A specific register, called the

stack pointer (SP),

is used

to indicate the stack location that can be addressed. ■ In the stack push operation, the SP value is used toindicate the location (called the top of the stack). ■ After storing (pushing) this value, the SP is incremented(In some architectures a SP is decremented (i.e. x86) asthe stack grows low in memory).

80x86 Registers

^ the Intel basic programming model of the386, 486 and the

Pentium

consists of three

register groups:^ ■^ General-purpose registers,^ ■^ Segment registers, and^ ■^ The instruction pointer (program counter) & theflag register.

^ ???????????

CPU Connection

^ Reads instruction and data ^ Writes out data (after processing) ^ Sends control signals to other units ^ Receives (& acts on) interrupts

So We need Datapath