Chapter-2(Microprogrammed Control)
Chapter-2(Microprogrammed Control)
Chapter-2(Microprogrammed Control)
A control unit whose binary control values are saved as words in memory is called a
microprogrammed control unit.
2.1 Control Memory
Control Memory is the storage in the microprogrammed control unit to store the
microprogram.
Microprogram consists instruction in the strings of 0’s and 1’s and these are called
microinstructions.
Microprogramming is the method of control unit design in which the control
selection and sequencing information is stored in ROM or RAM called a control
memory.
Microinstructions are fetched from control memory in similar way as an instruction
is fetched from main memory.
Each microinstruction also explicitly or implicitly specifies the next
microinstruction to be used thereby providing the necessary information for
sequencing.
When the power of a computer is turned on, we have to first load an initial address
into the CAR (control address register). This address can be described as the first
microinstruction address. With the help of this address, we are able to activate the
instruction fetch routine.
Then, the control memory will go through the routine, which will be used to find out
the effective address of operand.
In the next step, a micro-operation will be generated, which will be used to execute
the instruction fetched from memory.
We are able to transform the bits of instruction code into an address with the help of control
memory where routine is located. This process can be called the mapping process. The
control memory required the capabilities of address sequencing, which is described as
follows:
On the basis of the status bit conditions, the address sequencing selects the
conditional branch or unconditional branch.
Addressing sequence is able to increment the CAR (Control address register).
It provides the facility for subroutine calls and returns.
A mappings process is provided by the addressing sequence from the instructions
bits to a control memory address.
In the above diagram, we can see a block diagram of a control memory and associative
hardware, which is required for selecting the address of next microinstruction. The
microinstruction is used to contain a set of bits in the control memory. With the help of
some bits, we are able to start the micro-operations in a computer register. The remaining
bits of microinstruction are used to specify the method by which we are able to obtain the
next address.
In this diagram, we can also see that the control address register is able to recover their
address with the help of four different directions. The CAR is incremented with the help
of incrementer and then chooses the next instruction. The branching address will be
determined in the multiple fields of microinstruction so that they can provide results in
branching.
If there are status bits of microinstruction and we want to apply conditions on them, in this
case, we can use conditional branching. An external address can be shared with the help of
a mapping logic circuit. The return address will be saved by a special register. This saved
address will be helpful when the micro-program requires returning from the subroutine. At
that time, it requires the value from the unique register.
Conditional Branching
In the above diagram, the branch logic is used to provide the decision-making capabilities
in the control unit. There are special bits in the system which is described by the status
conditions. These bits are used to provide the parameter information such as mode bits, the
sign bit, carry-out, and input or output status.
If these status bits come together with the microinstruction field, they are able to control
the decision of a conditional branch, which is generated in the branch logic. Here the
microinstruction field is going to specify a branch address. The multiplexer is used to
implement the branch logic hardware. If the condition is met, it will be branch to the initial
address. Otherwise, it will increment the address register.
If we load the branch address into the control address register from the control memory,
we are able to implement the unconditional branch microinstruction. If the condition is
true, it will go to the branch, which is referred to as the address from the next address field
of the current microinstruction. Otherwise, it will fall through. There are various types of
conditions that need to be tested: Z(zero), C(carry), O(overflow), N(negative), etc.
Mapping of Instruction-Subroutines
In the control memory, if the microinstruction specifies a branch to the first work, in
this case, there will be a special type of branch. Here an instruction contains their
micro-program routine. For this special branch, the status bits will be the bits in the
operation code, which is the part of instruction.
The above image shows a type of easy mapping process which are going to convert
the 4-bit operation code into the 7-bit address for control memory. In the mapping
process, the 0 will be placed in the most significant bit of address. After that, the
four operation code bits will be transferred. Lastly, the two least significant bits of
CAR will be cleared.
With the help of this process, a micro-program will be provided to each computer
instruction. The micro-program contains the capacity of four microinstructions. If
less than four microinstructions are used by the routine, the location of unused
memory can be used for other routines. If more than four microinstructions are used
by the routine, it will use the addresses 1000000 through 1111111.
This concept can be extended to a more general mapping rule with the help of PLD
(Programmable logic device) or ROM (Read-only memory).
The above image shows the mapping of address of microinstruction from the OP-
code of an instruction. In the execution program, this microinstruction is the starting
microinstruction.
Subroutines:
A microinstruction format includes 20 bits in total. They are divided into four
elements as displayed in the figure.
Symbolic Microprogram
The equivalent binary form of the microprograms is listed in Table below. The
addresses for control memory are given in both decimal and binary
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.
A control unit works by receiving input information to which it converts into control
signals, which are then sent to the central processor. The computer’s processor then tells
the attached hardware what operations to perform. The functions that a control unit
performs are dependent on the type of CPU because the architecture of CPU varies from
manufacturer to manufacturer. Examples of devices that require a CU are:
Central Processing Unit (CPU)
Graphical Processing Unit(GPU)
A control unit has a set of input values on the foundation of which it produces an
output control signal which in turn performs micro-operations. These output signals
control execution of a program. A general model of control unit is displayed in
Figure 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.
The basic data of an opcode (operation code of an instruction) is sent to the
instruction decoder for decoding. The instruction decoder is the set of
decoders to decode different types of data in the opcode. This results in output
signals which contain values of active signals that are given as the input to the
matrix generator to generate control signals for the execution of a program by
the processor of the computer.
The matrix generator provides states of controls unit and the signals out from
the processor (interrupt signals). Matrix is built as the programmable logic
array. The control signals generated by the matrix generator are given as the
input to the next generator matrix and combines with the timing signals of the
timing unit that contains rectangular patterns.
For fetching of new instruction, the control unit turns into an initial stage for
the execution of new instruction. The control unit remains in the initial stage
or first stage as long as the timing signals, input signals, and states of
instruction of a computer are unchanged. The change in the state of the control
unit can be raised if there any change in any of the generated signals.
When an external signal or interrupt occurs, the control unit goes to the next
state and performs the processing of the interrupt signal. The flags and states
are used to select the desired states to perform the execution cycle of
instruction.
In the last state, the control unit fetches the next instruction and sends the
output to the program counter, then to the memory address register, to the
buffer register, and then to the instruction register to read the instruction.
Finally, if the last instruction (which is fetched by the control unit) is end
instruction, then it goes to the operating state of the processor and waits until
the user directs the next program.
Microprogram Sequencer
The basic components of microprogrammed control unit are are the control
memory and the circuits that select the next address.
The task of Microinstruction sequencing is done by Microprogram sequencer.
The address selection part is called microprogram sequencer.
Microprogram sequencer can be constructed with digital function to to suit a
particular application.
Two important factors that must be considered while designing the
microinstruction sequencer. i.e the size of the microinstruction and the address
of generation time.