CH 7
CH 7
Dynamic microprogramming:
A more advanced development known as dynamic microprogramming permits a microprogram
to be loaded initially from an auxiliary memory such as a magnetic disk. Control units that use
dynamic microprogramming employ a writable control memory. This type of memory can be
used for writing.
Control Memory:
Control Memory is the storage in the microprogrammed control unit to store the microprogram.
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.
Micro instruction:
A symbolic microprogram can be translated into its binary equivalent by means of an
assembler.
Each line of the assembly language microprogram defines a symbolic microinstruction.
Each symbolic microinstruction is divided into five fields: label, microoperations, CD, BR,
and AD.
Micro program:
A sequence of microinstructions constitutes a microprogram.
Since alterations of the microprogram are not needed once the control unit is in
operation, the control memory can be a read-only memory (ROM).
ROM words are made permanent during the hardware production of the unit.
The use of a micro program involves placing all control variables in words of ROM for use
by the control unit through successive read operations.
The content of the word in ROM at a given address specifies a microinstruction.
Microcode:
Microinstructions can be saved by employing subroutines that use common sections of
microcode.
For example, the sequence of micro operations needed to generate the effective
address of the operand for an instruction is common to all memory reference
instructions.
This sequence could be a subroutine that is called from within many other routines to
execute the effective address computation.
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.
Thus a microinstruction contains bits for initiating microoperations 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 microoperations 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.
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 microoperations that execute the instruction fetched
from memory.
The microoperation 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.
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.
Above figure 4.2 shows a block diagram of a 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 next 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 micro-program wishes to return from the subroutine.
Swati Sharma , CE Department | 2140707 – Computer Organization 5
Unit 4 – Microprogrammed Control
The branch logic of figure 4.2 provides decision-making capabilities in the control unit.
The status conditions are special bits in the system that provide parameter information
such as the carry-out of an adder, the sign bit of a number, the mode bits of an
instruction, and input or output status conditions.
The status bits, together with the field in the microinstruction that specifies a branch
address, control the conditional branch decisions generated in the branch logic.
A 1 output in the multiplexer generates a control signal to transfer the branch address
from the microinstruction into the control address register.
A 0 output in the multiplexer causes the address register to be incremented.
One can extend this concept to a more general mapping rule by using a ROM to specify
the mapping function.
The contents of the mapping ROM give the bits for the control address register.
Swati Sharma , CE Department | 2140707 – Computer Organization 6
Unit 4 – Microprogrammed Control
In this way the microprogram routine that executes the instruction can be placed in any
desired location in control memory.
The mapping concept provides flexibility for adding instructions for control memory as
the need arises.
The BR (branch) field consists of two bits. It is used, in conjunction with the address field
AD, to choose the address of the next microinstruction shown in Table 4.2.
l0 Input 3 2 1 0
Load
l1 Logic S1 MUX 1 SBR
T S0
Test Increment
1 MUX 2 er
L Clock CAR
Select
Control Memory
Microops CD BR AD
Boolean Function:
S0 = I0
S1 = I0I1 + I0’T
L = I0’I1T
Typical sequencer operations are: increment, branch or jump, call and return from
subroutine, load an external address, push or pop the stack, and other address
sequencing operations.
With three inputs, the sequencer can provide up to eight address sequencing
operations.
Some commercial sequencers have three or four inputs in addition to the T input and
thus provide a wider range of operations.