MICROPROGRAMMED CONTROL
CONTROL MEMORY
Control Memory is the storage in the micro-programmed control unit to store the micro-program.
Writeable Control Memory
Control Storage whose contents can be modified, allow the change in micro-program and
instruction set can be changed or modified is referred as Writeable Control Memory.
Control Word
The control variables at any given time can be represented by a control word string of 1's and 0's
called a control word.
The general configuration of a micro-programmed control unit is demonstrated in the block
diagram of Figure below. The control memory is assumed to be a ROM, within which all control
information is permanently stored.
Micro-programmed Control memory organization
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 micro-operations
for the data processor. Once these operations are executed, the control must determine the
next address.
Prepared by M.Venkatesam, Asst.Professor, KIST, KAKUTUR, Nellore, A.P Page 1
The location of the next microinstruction may be the one next in sequence, or it may be
located somewhere else in the control memory.
While the micro-operations 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 micro-instruction. Thus a micro-instruction contains bits for initiating micro-
operations in the data processor part and bits that determine the address sequence for the
control memory.
The next address generator is sometimes called a micro-program sequencer, as it
determines the address sequence that is read from control memory.
Typical functions of a micro-program 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 control data register holds the present microinstruction while the next address is
computed and read from memory.
The data register is sometimes called a pipeline register. It allows the execution of the
micro-operations specified by the control word simultaneously with the generation of the
next microinstruction.
This configuration requires a two-phase clock, with one clock applied to the address
register and the other to the data register.
The main advantage of the micro programmed control is 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 a different control sequence for the system, all we need to do is
specify a different set of microinstructions for control memory.
Prepared by M.Venkatesam, Asst.Professor, KIST, KAKUTUR, Nellore, A.P Page 2
ADDRESS SEQUENCING
Microinstructions are stored in control memory in groups, with each group specifying a
routine.
The address sequencing capabilities required in a 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
To appreciate the address sequencing in a micro-program control unit, let us specify the
steps that the control must undergo during the execution of a single computer instruction.
Prepared by M.Venkatesam, Asst.Professor, KIST, KAKUTUR, Nellore, A.P Page 3
Step-1:
An initial address is loaded into the control address register when power is turned on in
the computer. This address is usually the address of the first microinstruction that
activates the instruction fetch routine.
The fetch routine may be sequenced by incrementing the control address register through
the rest of its microinstructions.
At the end of the fetch routine, the instruction is in the instruction register of the
computer.
Step-2:
The control memory next must go through the routine that determines the effective
address of the operand.
A machine instruction may have bits that specify various addressing modes, such as
indirect address and index registers.
The effective address computation routine in control memory can be reached through a
branch microinstruction, which is conditioned on the status of the mode bits of the
instruction.
When the effective address computation routine is completed, the address of the operand
is available in the memory address register.
Step-3:
The next step is to generate the micro-operations that execute the instruction fetched from
memory.
The micro-operation steps to be generated in processor registers depend on the operation
code part of the instruction.
Each instruction has its own micro-program routine stored in a given location of control
memory.
The transformation from the instruction code bits to an address in control memory where
the routine is located is referred to as a mapping process.
A mapping procedure is a rule that transforms the instruction code into a control
memory address.
Prepared by M.Venkatesam, Asst.Professor, KIST, KAKUTUR, Nellore, A.P Page 4
Step-4:
Once the required routine is reached, the microinstructions that execute the instruction
may be sequenced by incrementing the control address register.
Micro-programs that employ subroutines will require an external register for storing the
return address.
Return addresses cannot be stored in ROM because the unit has no writing capability.
When the execution of the instruction is completed, control must return to the fetch
routine. This is accomplished by executing an unconditional branch microinstruction to the first
address of the fetch routine.
MICROPROGRAM EXAMPLE
Prepared by M.Venkatesam, Asst.Professor, KIST, KAKUTUR, Nellore, A.P Page 5
Design of Control Unit
Control unit generates timing and control signals for the operations of the computer. The control
unit communicates with ALU and main memory. It also controls the transmission between
processor, memory and the various peripherals. It also instructs the ALU which operation has to
be performed on data.
Control unit can be designed by two methods which are given below:
Hardwired Control Unit
It is implemented with the help of gates, flip flops, decoders etc. in the hardware. The inputs to
control unit are the instruction register, flags, timing signals etc. This organization can be very
complicated if we have to make the control unit large.
If the design has to be modified or changed, all the combinational circuits have to be modified
which is a very difficult task.
Prepared by M.Venkatesam, Asst.Professor, KIST, KAKUTUR, Nellore, A.P Page 6
Micro-programmed Control Unit
Microprogramming is a process of writing microcode for a microprocessor. Microcode is low-
level code that defines how a microprocessor should function when it executes machine-
language instructions. Typically, one machine language instruction translates into several
microcode instruction, on some computers, the microcode is stored in ROM and can not be
modified;
1) A control unit with its binary control values stored as words in memory is called as micro-
programmed control. Each word in the control memory contains microinstruction that specifies
one or more micro-operations for the system. A sequence of microinstructions constitutes a
micro program.
2) Micro-programmed implementation is a software approach in contrast to the hardwired
approach.
3) It deals with various units of software but at the micro level i.e. micro-operation, micro-
instruction, micro-program etc.
4) Different key elements used for implementation of a control unit using microprogrammed
approach is shown in fig. below:
5) Control Memory
The set of microinstruction is stored in control Memory (CM) also called as control store.
Prepared by M.Venkatesam, Asst.Professor, KIST, KAKUTUR, Nellore, A.P Page 7
6) Control Address Register (CAR)
It contains the address of next microinstruction to be read. This is similar to the program counter
(PC) which stores the address of the next instruction.
7) Control Buffer Register (CBR):
When microinstruction is read from the control memory, it is transferred to a control Buffer
Register (CBR), which is similar to the instruction Register (IR) that stores the op-code of the
instruction read from the memory.
8) Sequencing:
It loads the control Address register with the address of the next instruction to be read and issues
a read command to control memory.
Micro-programmed Control Unit Organization:
Figure: Basic Organization of Micro-programmed Control Unit
The micro-routines for all instruction in the instruction set of a computer are stored in a special
memory called the control memory (CM). The control unit can generate the control signals for
Any instructions by sequentially reading the control words of the corresponding micro-routine
from the control store. To read the control words sequentially from the control memory, a micro-
program counter (µPC) is used. Every time a new instruction is loaded into the IR the output of
the block labeled ‘starting Address Generator’. Is loaded into the µPC. The µPC then
automatically incremented by one, by the clock. So that successive microinstructions are fetched
from the control memory.
Prepared by M.Venkatesam, Asst.Professor, KIST, KAKUTUR, Nellore, A.P Page 8
Difference between Hardwired Control and Micro-programmed Control
Prepared by M.Venkatesam, Asst.Professor, KIST, KAKUTUR, Nellore, A.P Page 9