文档介绍:Dr. Lo’ai Tawalbeh
Chapter 8: Central Processing Unit
1
cpe 252: anization
CENTRAL PROCESSING UNIT
Introduction
General anization
anization
Instruction Formats
Addressing Modes
Data Transfer and Manipulation
Program Control
Reduced Instruction puter (RISC)
2
cpe 252: anization
PONENTS OF CPU
ponents:
Registers
Flip-flops
Execution (Processing) Components:
Arithmetic Logic Unit (ALU):
Arithmetic calculations, putations, Shifts/Rotates
ponents:
Bus
ponents:
Control Unit
Register
File
ALU
Control Unit
3
cpe 252: anization
GENERAL ANIZATION
MUX
SELA
{
MUX
}
SELB
ALU
OPR
R1
R2
R3
R4
R5
R6
R7
Input
3 x 8
decoder
SELD
Load
(7 lines)
Output
A bus
B bus
Clock
4
cpe 252: anization
OPERATION OF CONTROL UNIT
The control unit directs the information flow through ALU by:
- Selecting ponents in the system
- Selecting the Function of ALU
Example: R1 <- R2 + R3
[1] MUX A selector (SELA): BUS A R2
[2] MUX B selector (SELB): BUS B R3
[3] ALU operation selector (OPR): ALU to ADD
[4] Decoder destination selector (SELD): R1 Out Bus
Control Word
Encoding of register selection fields
Binary
Code SELA SELB SELD
000 Input Input None
001 R1 R1 R1
010 R2 R2 R2
011 R3 R3 R3
100 R4 R4 R4
101 R5 R5 R5
110 R6 R6 R6
111 R7 R7 R7
SELA
SELB
SELD
OPR
3
3
3
5
5
cpe 252: anization
ALU CONTROL
Encoding of ALU operations
OPR
Select Operation Symbol
00000 Transfer A TSFA
00001 Increment A INCA
00010 ADD A + B ADD
00101 Subtract A - B SUB
00110 Decrement A DECA
01000 AND A and B AND
01010 OR A and B OR
01100 XOR A and B XOR
plement A
10000 Shift right A SHRA
11000 Shift left A SHLA
Examples of ALU Microoperations
Symbolic Designation
Microoperation SELA SELB SELD OPR Control Word
Control
R1 R2 - R3 R2 R3 R1 SUB 010 011 001 00101
R4 R4 R5 R4 R5 R4 OR 100 101 100 01010
R6 R6 + 1 R6 - R6 INCA 110 000 110 00001
R7 R1 R1 - R7 TSFA 001 000 111 00000
Output R2 R2 - None TSFA 010 000 000 00000
Output Input Inpu