Processor Organization and Architecture: Deepti Lawand
Processor Organization and Architecture: Deepti Lawand
Processor Organization
and Architecture
Deepti Lawand
CPU Architecture
PROCESSOR
ORGANIZATION
Deepti Lawand
Deepti Lawand
Deepti Lawand
Deepti Lawand
Deepti Lawand
REGISTER
ORGANIZATION
Deepti Lawand
User-Visible Registers
A user-visible register is one that may be referenced by
means of the machine language that the processor
executes.
We can characterize these in the following categories:
General purpose
Data
Address
Condition codes
Deepti Lawand
INSTRUCTION CYCLE
Deepti Lawand
Deepti Lawand
Instruction formats
Deepti Lawand
Deepti Lawand
Instruction Length
The most basic design issue to be faced is the instruction
format length.
This decision affects, and is affected by, memory size,
memory organization, bus structure, processor complexity,
and processor speed.
This decision determines the richness and flexibility of the
machine as seen by the assembly-language programmer.
The most obvious trade-off here is between the desire for a
powerful instruction repertoire and a need to save space.
Deepti Lawand
Deepti Lawand
Allocation of Bits
A difficult issue is how to allocate the bits in that format.
The trade-offs here are complex.
For a given instruction length, there is clearly a trade-off
between the number of opcodes and the power of the
addressing capability.
More opcodes obviously mean more bits in the opcode field.
For an instruction format of a given length, this reduces the
number of bits available for addressing.
There is one interesting refinement to this trade-off, and
that is the use of variable-length opcodes.
In this approach, there is a minimum opcode length but, for
some opcodes, additional operations may be specified by
using additional bits in the instruction.
For a fixed-length instruction, this leaves fewer bits for
addressing.
Thus, this feature is used for those instructions that require
fewer operands and/or less powerful addressing.
Deepti Lawand
ADDRESSING MODES
Deepti Lawand
Deepti Lawand
Deepti Lawand
Deepti Lawand
Immediate Addressing
The simplest form of addressing is immediate addressing, in
which the operand value is present in the instruction
This mode can be used to define and use constants or set
initial values of variables.
Typically, the number will be stored in twos complement
form; the leftmost bit of the operand field is used as a sign
bit.
When the operand is loaded into a data register, the sign
bit is extended to the left to the full data word size.
Deepti Lawand
Deepti Lawand
Direct Addressing
A very simple form of addressing is direct addressing, in
which the address field contains the effective address of the
operand:
The technique was common in earlier generations of
computers but is not common on contemporary
architectures.
It requires only one memory reference and no special
calculation.
The obvious limitation is that it provides only a limited
address space.
Deepti Lawand
Indirect Addressing
With direct addressing, the length of the address field is
usually less than the word length, thus limiting the address
range.
One solution is to have the address field refer to the
address of a word in memory, which in turn contains a fulllength address of the operand.
This is known as indirect addressing:
The parentheses are to be interpreted as meaning contents
of.
The obvious advantage of this approach is that for a word
length of N, an address space
of is now available.
The disadvantage is that instruction execution requires two
memory references to fetch the operand: one to get its
address and a second to get its value.
Deepti Lawand
Deepti Lawand
Deepti Lawand
Register Addressing
Register addressing is similar to direct addressing.
The only difference is that the address field refers to a
register rather than a main memory address:
EA = R
To clarify, if the contents of a register address field in an
instruction is 5, then register R5 is the intended address,
and the operand value is contained in R5.
Typically, an address field that references registers will have
from 3 to 5 bits, so that a total of from 8 to 32 generalpurpose registers can be referenced.
Deepti Lawand
Deepti Lawand
Deepti Lawand
Deepti Lawand
Displacement Addressing
A very powerful mode of addressing combines the
capabilities of direct addressing and register indirect
addressing.
It is known by a variety of names depending on the context
of its use, but the basic mechanism is the same.
We will refer to this as displacement addressing:
EA = A + (R)
Displacement addressing requires that the instruction have
two address fields, at least one of which is explicit.
The value contained in one address field (value = A) is used
directly.
The other address field, or an implicit reference based on
opcode, refers to a register whose contents are added to A
to produce the effective address.
Deepti Lawand
Stack Addressing
The final addressing mode that we consider is stack
addressing.
A stack is a linear array of locations.
It is sometimes referred to as a pushdown list or last-in-firstout queue.
The stack is a reserved block of locations.
Items are appended to the top of the stack so that, at any
given time, the block is partially filled.
Associated with the stack is a pointer whose value is the
address of the top of the stack.
Deepti Lawand
Deepti Lawand
Deepti Lawand
MICRO-OPERATIONS
The operation of a computer, in executing a program,
consists of a sequence of instruction cycles, with one
machine instruction per cycle.
This sequence of instruction cycles is not necessarily the
same as the written sequence of instructions that make up
the program, because of the existence of branching
instructions.
The execution time sequence of instructions is referred
here.
Each instruction cycle is made up of a number of smaller
units.
One subdivision is fetch, indirect, execute, and interrupt,
with only fetch and execute cycles always occurring.
To design a control unit, however, we need to break down
the description further.
In fact, each of the smaller cycles involves a series of steps,
each of which involves the processor registers.
We will refer to these steps
micro-operations.
Deeptias
Lawand
Deepti Lawand
Control Unit
HARDWIRED IMPLEMENTATION
In a hardwired implementation, the control unit is
essentially a state machine circuit.
Its input logic signals are transformed into a set of output
logic signals, which are the control signals.
Control Unit Inputs
The key inputs are the instruction register, the clock, flags,
and control bus signals. In the case of the flags and control
bus signals, each individual bit typically has some meaning
(e.g., overflow).
The other two inputs, however, are not directly useful to the
control unit.
Microinstructions
The control unit seems a reasonably simple device.
Nevertheless, to implement a control unit as an
interconnection of basic logic elements is no easy task.
The design must include logic for sequencing through
micro-operations, for executing microoperations, for
interpreting opcodes, and for making decisions based on
ALU flags.
It is difficult to design and test such a piece of hardware.
Furthermore, the design is relatively inflexible.
For example, it is difficult to change the design if one
wishes to add a new machine instruction.
An alternative, which has been used in many processors, is
to implement a microprogrammed control unit.
Deepti Lawand
Deepti Lawand
Deepti Lawand
Deepti Lawand
Deepti Lawand
Microprogrammed
Control Unit
Deepti Lawand
Deepti Lawand
Deepti Lawand
Deepti Lawand
Deepti Lawand
Deepti Lawand
Deepti Lawand