New1_ Chapter 5 - Basic Processing Unit
New1_ Chapter 5 - Basic Processing Unit
Basic
Processing Unit
Overview
Instruction Set Processor (ISP)
Central Processing Unit (CPU)
A typical computing task consists of a series
of steps specified by a sequence of machine
instructions that constitute a program.
An instruction is executed by carrying out a
sequence of more rudimentary operations.
Some Fundamental
Concepts
Fundamental Concepts
Processor fetches one instruction at a time and
perform the operation specified.
Instructions are fetched from successive memory
locations until a branch or a jump instruction is
encountered.
Processor keeps track of the address of the memory
location containing the next instruction to be fetched
using Program Counter (PC).
Instruction Register (IR)
Executing an Instruction
Fetch the contents of the memory location pointed
to by the PC. The contents of this location are
loaded into the IR (fetch phase).
IR ← [[PC]]
Assuming that the memory is byte addressable,
increment the contents of the PC by 4 (fetch phase).
PC ← [PC] + 4
Carry out the actions specified by the instruction in
the IR (execution phase).
Fundamental Concepts
Processor (CPU): the active part of the
computer, which does all the work (data
manipulation and decision-making).
Datapath: portion of the processor which
contains hardware necessary to perform all
operations required by the computer (the
brawn).
Control: portion of the processor (also in
hardware) which tells the datapath what needs
to be done (the brain).
The setting of the control signals depends on:
Contents of the step counter
Contents of the instruction register
The result of a computation or a comparison
operation
External input signals, such as interrupt
requests
Microprogrammed
Control
Instead of employing such circuits, it is possible to use a
“software" approach, in which the desired setting of the
control signals in each step is determined by a program
stored in a special memory.
The control program is called a microprogram to
distinguish it from the program being executed by the
processor.
The microprogram is stored on the processor chip in a
small and fast memory called the microprogram memory
or the control store.
Suppose that n control signals are needed. Let each
control signal be represented by a bit in an n-bit word,
which is often referred to as a control word or a
microinstruction.
Each bit in that word specifies the setting of the
corresponding signal for a particular step in the
execution flow.
Step Action
Overview
Figure 7.6. Control sequencefor executionof the instruction Add (R3),R1.
Overview
MDRout
WMFC
MAR in
Select
Read
PCout
R1out
R3out
Micro -
End
PCin
R1in
Add
Z out
IRin
Yin
Zin
instruction
1 0 1 1 1 0 0 0 1 1 1 0 0 0 0 0 0
2 1 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0
3 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0
language programs.
Figure 7.15 An example of microinstructions for Figure 7.6.
Clock PC
Control
store CW
Overview
Figure 7.16. Basic organization of a microprogrammed control unit.
Control store
One function
cannot be carried
out by this simple
organization.
Hardwired Vs. Microprogrammed
In hardwired control, these signals are generated by circuits that interpret
the contents of the IR as well as the timing signals derived from a step
counter.
In microporgrammed control a “software" approach, in which the desired
setting of the control signals in each step is determined by a program stored
in a special memory, is used.
Microprogrammed control is simple to implement and provides considerable
flexibility in controlling the execution of machine instructions. But, it is slower
than hardwired control. Also, the flexibility it provides is not needed in RISC-
style processors.
As the discussion in this chapter illustrates, the control signals needed to
implement RISC-style instructions are quite simple to generate.
Since the cost of logic circuitry is no longer a significant factor, hardwired
control has become the preferred choice.