You are on page 1of 15

Microinstruction Format & Concept of Horizontal and

Vertical Microprogrammed Control Unit

What is a control unit?


A control unit is a group of circuits that provides timing and signals
to all the operations in the computer and controls the data flow.
Control unit generates control signals. Control signals provide
control inputs for the multiplexers in the common bus, control
inputs in processor registers and micro-operations for
accumulator.
The general model or block diagram of control unit is given in the
diagram:

The inputs are:


• Clock: This is how the control unit “keeps time.” The control unit
causes one micro-operation (or a set of simultaneous micro-
operations) to be performed for each clock pulse. This is
sometimes referred to as the processor cycle time, or the clock
cycle time.
• Instruction register: The opcode and addressing mode of the
current instruction are used to determine which micro-operations
to perform during the execute cycle.
• Flags: These are needed by the control unit to determine the
status of the processor and the outcome of previous ALU
operations.
For example, for the increment-and-skip-if-zero (ISZ) instruction,
the control unit will increment the PC if the zero flag is set.
• Control signals from control bus: The control bus portion of the
system bus provides signals to the control unit.
The outputs are as follows:
• Control signals within the processor: These are two types: those
that cause data to be moved from one register to another, and
those that activate specific ALU functions.
• Control signals to control bus: These are also of two types:
control signals to memory, and control signals to the I/O modules.
Three types of control signals are used:
 those that activate an ALU function,
 those that activate a data path,
 and those that are signals on the external system bus or other
external interface

What are the types of a control unit?


There are two types of control organization. A control unit can be
implemented using two techniques:
 Hardwired control unit
 Micro-programmed control unit
Hardwired Control Unit:
In hardwired organization, the control unit is implemented with
gates, flip-flops, decoders and other digital circuits.
When the control signals are generated by the hardware using
conventional logic design techniques, the control unit is said to be
hardwired. The hardwired control unit uses a fixed logic to interpret
an instruction and generate appropriate signals.

Micro-programmed control unit:


An alternative to a hardwired control unit is a microprogrammed
control unit, in which the logic of the control unit is specified by a
microprogram.
A microprogram consists of a sequence of instructions in a
microprogramming language.
These are very simple instructions that specify micro-operations. A
microprogrammed control unit is a relatively simple logic circuit
that is capable of
(1) Sequencing through microinstructions and
(2) Generating control signals to execute each microinstruction.
As in a hardwired control unit, the control signals generated by a
microinstruction are used to cause register transfers and ALU
operations.

Terminologies:
 Control variable
 Control word or microinstruction
 Micro-operation
 Control Memory
 Micro-program
 Micro-code
Micro-operation:
The execution of an instruction involves the execution of a
sequence of subsets, generally called cycles.
For example, an execution may consist of fetch, decode, execute
and interrupt cycle. Each cycle is in turn made of a sequence of
more fundamental operations called micro-operations.
A single micro-operation generally involves a transfer between
registers, transfer between a register and an external bus or a
simple ALU operation. The following figure shows that the program
execution is done by performing various microoperations.

Control Variable:
The control function that specifies a micro-operation is a binary
variable. When it is in one binary state, the corresponding micro-
operation is executed.
The active state of a control variable may be either the 1-state or 0-
state, depending on the application.
During any given time, certain micro-operations are to be initiated
while others remain idle.
Control word:
The control variables can be represented by a string of 1’s and 0’s
called a control word. As such, control words can be programmed
to perform various operations on the components of the system.

A Micro-programmed control unit is a control unit whose binary control


variables are stored in the memory.

Micro-instruction: Each word in the control memory contains a


micro-instruction. A micro-instruction specifies one or more micro-
operations for the system.
Micro-program: A sequence of microinstructions constitutes a
micro-program.

Control Memory:
A memory that is the part of control unit is called the control
memory. Control memory is the storage in the micro-programmed
control unit to store the micro-program.
Micro-code: A logically coherent portion of micro-program is called
micro-code.

Note: A micro-instruction can cause the execution of one or more


micro-operations and a sequence of micro-instruction (micro-
program) can cause the execution of an instruction.

Micro-programmed Control organization:


A control memory is assumed to be a ROM, within which all control
information is permanently stored.
The control address register specifies the address of the micro-
instruction and control data register holds the micro-instruction
read from the memory.
A microinstruction contains a control word that specifies one or
more micro-operations for the processor. Once these operations
are executed, the control must determine the next address.
The location of the next micro-instruction may be the one next in
the sequence or it may be located somewhere else in the control
memory.
The next address generator is sometimes called a micro-program
sequencer as it determines the address sequence that is read from
memory.

Organization of control memory:


This shows control words or microinstruction arranged in control
memory. The microinstructions in each routine are to be executed
sequentially. Each routine ends with a branch or jump instruction
locating where to go next.

Microinstruction format:
The 20-bit microinstruction format is shown in the following figure:

The 20 bits of the microinstruction are divided into four functional


parts.
 Micro-operations Field F1, F2, F3 (3-bit each)
 CD Field (Condition Field) (2-bit)
 BR Field (Branch Field) (2-bit)
 AD field (Address Field) (7-bit)

The three F1, F2, F3 specify micro-operations for the computer.


Each F has 3 bits that defines seven distinct micro-operations:
None for 000 and different operations for (1to 6).
The CD Field is 2-bit long and selects status bit conditions.
The BR Field is 2-bit long and specifies the type of the branch to be
used.
The AD field contains a branch address. The size of AD field
depends on the control memory size. Here AD has 7 bits that
means 27 words in the control memory.
Microoperation Field:
Example of F1, F2, and F3 micro-operation field specifying various
micro-operations have been shown in the following figures:
The microoperations are subdivided into three fields of three bits
each. This gives a total of 21 microoperations. No more than three
microoperations can be chosen for a microinstruction, one from
each field. If fewer than three microoperations used, one or more of
the fields will use the binary code 000 for no operation.
For example a microinstruction can specify two simultaneous
microoperations from F2 and F3 and None from F1

The nine bits of the microoperation field will be 000 100 101.
It is important to realize that two or more conflicting
microoperations cannot be specified simultaneously.
For example, a microoperation field 010 001 000 has no meaning
because it specifies the operations to clear AC to 0 and subtract DR
from AC at the same time.
CD condition field consists of two bits which are encoded to
specify four status bits condition given in the following table.
CD Condition Symbol
00 Always = 1 U Unconditional
Branch
01 DR(15) I Indirect Address Bit
10 AC(15) S Sign Bit of AC
11 AC=0 Z Zero Value in AC

CD ==00 (or symbol U) will always find the condition to be true.


When this condition used in conjunction with BR (branch) field, it
provides an unconditional branch operation.
The indirect bit I is available from bit 15 of DR after an instruction is
read from memory.
The sign bit of AC provides the next status bit.
The zero value, symbolized by Z, is a binary variable whose value is
equal to 1 if all the bits in AC are equal to zero.

BR Branch type Function


00 JMP CARAD if condition ==1
CARCAR + 1 if condition == 0
01 CALL CAR  Ad, SBR CAR + 1 if condition ==1
CAR CAR + 1 if condition== 0
10 RET CARSBR (Return from Subroutine)
11 MAP CAR(2-5) DR(11-14), CAR(0,1,6)
0

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.
When BR=00 the control performs JUMP operation.
BR=01 it performs a call to subroutine (CALL) operation.
The two operations are identical except that a call microinstruction
stores the return address in the subroutine register SBR. The JUMP
and CALL depend on the value of the CD Field.
When BR=10 specifies the return from subroutine. This causes the
transfer of the return address from SBR to CAR.The mapping from
the operation code bits of the instruction to an address for CAR is
accomplished when BR field is equal to 11. The mapping from
instruction code to microinstruction address is shown in the
following figure.

Note that the last two conditions in BR field are independent of the
values in the CD and AD Fields.
Horizontal Micro-programmed Control Unit and Vertical Micro-
programmed Control Unit:

Horizontal Micro-programmed Control Unit:


The control signals are represented in decoded binary format that
is 1 bit per one control signal.
If 53 control signals are present in the processor then 53 bits are
required.
More than 1 control signal can be enabled at a time.
It supports longer control word.
It requires no additional decoder because no control signal is
needed to be decoded.
It is faster than vertical micro-programmed control unit.
Vertical Micro-programmed Control Unit:
The control signals are represented in encoded binary form. For N
signals  log2N  bits are required.
It supports shorter control word than horizontal control unit.
It requires an additional hardware (decoder) to generate control
signals.
It is slower than horizontal control unit.
Question
Suppose there are 64 control signals in the system and 1024 word
control memory then find out the size of horizontal and vertical
microinstructions.
Answer:
Number of Control signals= 64
Number of bits required to represent the 64 control signal =  log2 64 = 6
Number of control words in the control memory= 1024 = 210
Number of address bits = 10

Size of horizontal microinstruction


= bits for Control signals + Number of address bits
= 64 +10
= 74 bits

Size of vertical microinstruction


= bits for Control signals + Number of address bits
= 6 +10
= 16 bits
Question
Consider a microprogrammed CU, where 1024 word control
memory is used. The CU has to support 50 control signals and 16
flag conditions.
How many bits are required in the control word?
What is the size of control memory?
Number of Control signals= 50
Number of bits required to represent the 50 control signal =
log250 = 6
Number of control words in the control memory= 1024 = 210
Number of address bits = 10
Number of flag conditions=16
Number of bits to represent flag Conditions= log216 = 4
Size of horizontal microinstruction
= bits for Control signals + bits for flag conditions+ Number of address bits

= 50+4 +10
= 64 bits

Size of Horizontal Control Memory


= Number of control word in memory * size of horizontal Microinstruction
= 1024 * 64 bits
=1K* 64 bits
= 1 K * (8*8) bits
= 1K * 8 bytes
=8 KB
Size of vertical microinstruction
= bits for Control signals + bits for flag conditions +Number of address bits

= 6 +4+10
= 20 bits

Size of Vertical Control Memory


= Number of control word in memory * size of vertical Microinstruction
= 1024 * 20 bits {2 bytes< 20 bits<3 bytes}
=1K* 3 bytes
= 1K * 3 bytes
=3 KB approximately

You might also like