Chapter 3
Chapter 3
Chapter 3
Chapter 3
3
Register Set
> Registers are used to create and store the results of CPU
operations.
4
Register types
5
Status register (Program Status Word)
The PSW contains bits that are set by the CPU to indicate the
current status of an executing program (arithmetic operations,
interrupts, processor status).
> Typical:
— Sign of last result
— Zero
— Carry
— Equal
— Overflow
— Interrupt enable/disable
— Supervisor mode (enable privileged instructions)
8
Example of Register Organizations (8086)
9
Arithmetic and Logic Unit (ALU)
> The component that performs the arithmetic and logical operations
> Load the operands into memory – bring them to the processor –
perform operation in ALU – store the result back to memory or
retain in the processor.
10
CPU Instruction cycle
12
Fetch Cycle
13
Execution Cycle : Execute Simple Arithmetic
Operation
Add R1, R2, R0
This instruction adds the contents of source registers R1 and R2, and stores
the results in destination register R0. This addition can be executed as follows:
1. The registers R0 , R1 , R2 , are extracted from the IR.
2. The contents of R1 and R2 are passed to the ALU for addition.
3. The output of the ALU is transferred to R0.
14
Instruction format
15
Example of Program Execution (1)
16
Control Unit operation
> The timing signals that govern the I/O transfers are also
generated by the control unit.
Register
File ALU
Control Unit
18
Timing & Control (1)
> All sequential circuits in the Basic Computer CPU are driven by a
master clock.
> At each clock pulse, the control unit sends control signals to control
inputs of the bus, the registers, and the ALU.
Machine
Cycle
1 2 3 4 5 6 7
19
Timing & Control (2)
20
Control unit design and implementation
> Control unit design and implementation can be done by two general
methods:
21
Hardwired Control Organization
> This approach is to physically connect all of the control lines to the
actual machine instructions.
> The instructions are divided up into fields, and different bits in the
instruction are combined through various digital logic components to
drive the control-lines.
22
Microprogrammed Control Organization
23
Example
24
CPU Performance
25
Performance Measures
> We denote the number of CPU clock cycles for executing a job to be
the Cycle Count (CC), the Cycle Time by CT, and the clock
frequency by f = 1 / CT.
> The time taken by the CPU to execute a job can be expressed as:
CPU time = CC * CT = CC / f
27
Performance Measures
28
Performance Measures
29
Performance Measures
30