Unit No: III: Micro Programmed Control
Unit No: III: Micro Programmed Control
LECTURE NOTES
SUBJECT: CAO BRANCH/YR/SEM: TEACHER:
ECE/4/I –SEM Dr, A.V.N.C.SEKAHR
1
When the configuration and the microprogrammed
control unit of the computer are established, the
designer's task is to generate the microcode for the
control memory. This code generation is called
microprogramming.
Computer Configuration
To explain the microprogramming process, we present a
simple digital computer similar but not identical to the
basic computer introduced.
This computer consists of:
1. A main memory ( 2048 × 16 ) for storing instructions
and data.
2. A control memory (128 × 20 ) for storing the
microprogram.
3. Four registers associated with the processor unit;
there function is similar to the corresponding registers
in the basic computer introduced in chapter 6. These
registers are :
micro
a. The Accumulator Register (AC).
program
b. The Program Counter Register (PC).
example
c. The Address Register (AR).
d. The Data Register (DR).
4. Two registers associated with control unit:
a. The Subroutine Register (SBR).
b. The Control Address Register (CAR).
5. The Arithmetic Logic and Shift Unit.
6. Two multiplexers for transfer of information among
the registers and the registers and main memory.
From the diagram, it's clear that DR can receive
information from AC, PC, or main memory. AR can
receive information either from PC or DR.
PC receives information from AR only. The arithmetic,
logic, and shift unit performs microoperations with data
from AC and DR and places the result in AC. The
memory receives its address from AR. Data written to
memory comes from DR, while DR receives the data read
from memory.
2
Instruction Format
Figure presents the instruction format for the assumed
computer.
The instruction format consists of three fields:
1. The 1-bit field specified for addressing mode
symbolized by I.
2. The 4-bit field specified for operation code (Opcode).
3. The 11-bit field specified for the address.
3
The address selection part is called the micro program
sequencer
For each instruction, the control unit causes the CPU to execute
a sequence of steps correctly. In reality, there must be control
signals to assert lines on various digital components to make
things happen. For example, when we perform an Add
instruction in assembly language, we assume the addition takes
place because the control signals for the ALU are set to "add"
and the result is put into the AC. The ALU has various control
lines that determine which operation to perform. The question
we need to answer is, "How do these control lines actually
become asserted?" We can take one of two approaches to
Hardwired ensure control lines are set properly. The first approach is to
and
physically connect all of the control lines to the actual machine
Microprogr
instructions. The instructions are divided up into fields, and
ammed
Control different bits in the instruction are combined through various
digital logic components to drive the control lines. This is
called hardwired control, and is illustrated in figure (1) The
control unit is implemented using hardware (for example:
NAND gates, flip-flops, and counters).We need a special
digital circuit that uses , as inputs, the bits from the Opcode
field in our instructions, bits from the flag (or status) register,
signals from the bus, and signals from the clock. It should
produce, as outputs, the control signals to drive the various
components in the computer.
The advantage of hardwired control is that is very fast. The
4
disadvantage is that the instruction set and the control logic are
directly tied together by special circuits that are complex and
difficult to design or modify. If someone designs a hardwired
computer and later decides to extend the instruction set, the
physical components in the computer must be changed. This is
prohibitively expensive, because not only must new chips be
fabricated but also the old ones must be located and replaced.
5
The control memory address register specifies the
address of the microinstruction and the control data
register holds the microinstruction read from memory
the microinstruction contains a control word that
specifies one or more microoperations for the data
processor. Once these operations are executed, the
control must determine the next address. The location of
the next microinstruction may be the one next in
sequence, or it may be locate somewhere else in the
control memory. For this reason it is necessary to use
some bits of the present microinstruction to control the
generation of the address of the next microinstruction.
The next address may also be a function of external
input conditions. While the microoperations are being
executed, the next address is computed in the next
address generator circuit and then transferred into the
control address register to read the next
microinstruction.
The next address generator is sometimes called a
microprogram sequencer, as it determines the address
sequence that is read from control memory, the address
of the next microinstruction can be specified several
ways, depending on the sequencer inputs. Typical
functions of a microprogram sequencer are incrementing
the control address register by one, loading into the
control address register an address from control
memory, transferring an external address or loading an
initial address to start the control operations.
The main advantages of the microprogrammed control
are the fact that once the hardware configuration is
established; there should be no need for further
hardware or wiring changes. If we want to establish are
different control sequence for the system, all we need to
do is specify different set microinstructions for control
memory. The hardware configuration should not be
changed for different operations; the only thing that
must be changed is the microprogram residing in control
memory.
Microinstructions are stored in control memory in
groups, with each group specifying routine. Each
computer instruction has microprogram routine in
control memory to generate the microoperations that
execute the instruction. The hardware that controls the
address sequencing of the control memory must be
capable of sequencing the microinstructions within a
routine and be to branch from one routine to another.
The address sequencing capabilities required in a
6
control memory are:
1. Incrementing of the control address register.
2. Unconditional branch or conditional branch,
depending on status bit conditions.
3. A mapping process from the bits of the instruction to
an address for control memory.
4. A facility for subroutine call and return.
Figure (3) shows a block diagram of control memory and
the associated hardware
needed for selecting the next microinstruction address.
The microinstruction in control memory contains a set
of bits to initiate microoperations in computer registers
and other bits to specify the method by which the
address is obtained. The diagram shows four different
paths from which the control address register (CAR)
receives the address. The incrementer increments the
content of the control address register by one, to select
the next microinstruction in sequence. Branching is
achieved by specifying the branch address in one of the
fields of the microinstruction. Conditional branching is
obtained by using part of the microinstruction to select
a specific status bit in order to determine its condition.
An external address is transferred into control memory
via a mapping logic circuit. The return address for a
subroutine is stored in a special register whose value is
then used when the microprogram wishes to return from
the subroutine.