You are on page 1of 15

Section 3: Processor Design

3.1 Introduction
• The CPU will execute or supervise the execution of the various
instructions making up a program. Its design has a major effect on system
performance
• The processor is made up from a number of functional units including:-
A register set An A.L.U A Control unit
PC R0

IR R1

WP R2
ALU

Register R3
Set

R4

R5

ALU Control
CONTROL
Routing Control
UNIT
Bus Control

Components of a CPU
Advanced Computer Architecture 1
Section 3.1
• The processor should:-
• Be capable of high performance
• Be easy to use as a system component
• Offer features which assist in the execution of programs written in
a high-level language

• Major design decisions include:-


• Number, width and rules for use of the register set
• Addressing capability
• Device technology
• Instruction set
• Design of the control unit - hard-wired or microcoded?
Advanced Computer Architecture 2
Section 3.2
3.2 The Control Unit
• The instruction in the Instruction Register (IR) determines the action of the
control unit
• The execution of each instruction involves a sequence of steps:-
Instruction Fetch (IF)
Instruction Decode (ID)
Operand Fetch (OF)
Opertation Execution (OE)
Operand Store (OS)
• Most instructions are either register-memory or register-register
• In each case a sequence of discrete steps is required
• The function of the control unit - controlling the sequence of steps in the
decoding and execution of an instruction - may be viewed as a problem
which can be solved either in hardware or in software.
Advanced Computer Architecture 3
Section 3.2.1
3.2.1 Hard-Wired Control
• The control unit is implemented as a sequential circuit - that is, in
hardware (using NAND, NOR flip-flops, counters etc.).
• Hardwired systems will be fast but are rigid and inflexible..
Control functions are fixed, so that, for example, if extra machine
instructions are to be accommodated then the circuitry must be
redesigned.

• Some RISC processors and 'supercomputer' processors use hardwired


control units for speed.
• Today’s processors use a combination of hard-wired control for simple,
often used instructions and microcode for less frequent, more complex
instructions.
Advanced Computer Architecture 4
Section 3.2.2
3.2.2 Microcoded Control
• May be viewed as a 'software approach' to the control of the machine.
• A Microcoded (or Microprogrammed) control unit may be regarded as an
'inner' computer implementing the functions required by the instruction
set of an 'outer' computer.
• A sequence of microinstructions execute a macroinstruction
• Code to implement all the little elemental tasks needed to realise a
macroinstruction are stored in the microprogram memory
• The microprogram memory is sometimes referred to as the control store.
Its contents are called firmware

Advanced Computer Architecture 5


Section 3.2.2
• A microinstruction has two primary parts:-
Definition and control of all micro-operations to be carried out (ALU
Control etc)
Definition and control of the next micro-instruction to be executed
Clock
The Basic Structure of a Microprogrammed Control Unit
Conditional
Information
NEXT-ADDRESS (ALU Result =0 etc)
LOGIC
Instruction
Register

MICROPROGRAM
STORE
Control
Machine
Unit
MICROINSTRUCTION
Control
REGISTER

Advanced Computer Architecture 6


Section 3.2.2
• The value in the microinstruction register is used directly in the control of
the processor.
For example:- The function of the ALU
Bus control
Routing of information between ALU, registers, etc
within the processor
Microinstruction Formats
• A microinstruction is normally broken into various field definitions
• An example of a 32-bit microinstruction made up of 9 fields is shown

5 8 4 4 3 3 3
Field 1 2 3 4 56 7 8 9

Field Definitions in Microinstruction Register


Advanced Computer Architecture 7
Section 3.2.2
• The fields in the above instruction must specify the control parameters of
the 'outer' machine
• For example:-
Field 7 - ALU Source Operand Control
Field 8 - ALU Function Control
Field 9 - ALU Destination Control
Field 4 - Interrupt Control
• The microinstruction must also define the address of the next
microinstruction in the sequence to implement the current
macroinstruction
• For example:-
Field 3 - Next Address Control
Field 2 - Branch Address
• The definition and content of each field will vary greatly from machine to
machine. Advanced Computer Architecture 8
Section 3.2.2
Horizontal Microinstruction Format
R0
Selecting
A ALU Inputs
B I1
• Consider controlling
R1 the input to the ALU above where either input may

be connected to registers R0,C R1, R2 by the gates A - F


R2
A.L.U.
D

E I2

Advanced Computer Architecture 9


Section 3.2.2
• The field in the microinstruction controlling the ALU source operand
would look like:-
A B C D E F

1 0 0 0 0 1

Horizontal Microinstruction Format

• Each bit of the microinstruction controls a single gate. The value shown
will connect R0 to I1 and R0 to I2

• There is no encoding of functions in purely horizontal microcoding, hence


instructions are wide.

Advanced Computer Architecture 10


Section 3.2.2
Vertical Microinstruction Format
• In horizontal format, certain groups of bits are mutually exclusive, in that
only one bit in a group may be set to '1’ eg. the pattern 1 1 0 0 0 1 is
illegal for the ALU source field above.
• The possible values may be encoded so that only one from a set of N gates
may be specified using only Log2N bits
Decoding an encoded field from
Field N a vertical microinstruction

Decoding
Logic

Individual Control Signals

Advanced Computer Architecture 11


Section 3.2.2
• The term Vertical Microinstruction essentially describes a format with a
high degree of encoding. This produces a shorter microinstruction length
therefore saving on store.
• However, the extra time taken to decode makes it slower than horizontal
format.
• It is possible for both formats to coexist within a given microinstruction -
some fields encoded and some in 'straight' form

Control store or Microprogram memory


• The flexibility of a microprogrammed machine depends on the way in
which the control store is implemented.

Advanced Computer Architecture 12


Section 3.2.2
• There are two extremes:-
'Hard' - The control store is implemented in ROM
'Soft' - The control store is implemented in RAM
Here the Microprogram is loaded from backing store
during a bootstrap process when the machine is turned on

Also called Writable Control Store.

Results in a 'soft machine' whose architecture can be


readily altered.

• PROM and EPROM implementations lie between the two extremes.

Advanced Computer Architecture 13


Section 3.2.3
3.2.3 Hard-Wired Control vs Microcoded Control
• Basic Hardware - Software trade-off:-
Hardware - fast but rigid and inflexible
Software - slow but flexible and easily changed
• For most general purpose processors the software approach (microcoding)
is favoured.
• Microcoding claims to reduce design time:-
– Control store has a regular structure
Simplifies the chip layout
Saves time during the layout stage
Errors are less likely

Advanced Computer Architecture 14


Section 3.2.3
– Once the control structure is determined microcode may be written in
parallel with circuit design.
– Regularity tends to decrease the complexity of the interconnection
within the control unit leading to a physically smaller system.
– Regularity facilitates detailed simulation and testing

• Microcoding eases the problems of design changes and design errors


• Microcoding offers a suitable route towards upward compatibility

Advanced Computer Architecture 15

You might also like