You are on page 1of 2

Microprogramming Concepts

O p e r a tio n c o d e A d d re s s In s tr u c t io n r e g is te r

O p -c o d e
The microprogrammed control unit takes a
C o n t r o l U n it macro-instruction (machine level
M a p p in g R O M instruction) and uses it to locate the first
lo o k s u p s ta r t in g
a d d re s s o f microinstruction in the control store.
m ic r o p r o g r a m
B ra n c h a d d re s s
A MAPing ROM takes the
S ta rt a d d r e s s macroinstruction op-code and simply
looks up the first address of the
M ic r o p r o g r a m c o u n te r C lo c k
microprogram memory in the
microprogram ROM (or control store).

M ic r o in s t r u c tio n a d d r e s s Microinstructions are read from the control


store and their bits used to control the
A d d re s s computer.
M ic r o p r o g r a m R O M
A microinstruction contains fields that
D a ta select the next microinstruction address (a
M ic r o in s t r u c t io n
r e g is t e r jump or the next address in sequence).
M ic r o in s t r u c tio n C o n t r o l s ig n a ls l
to b u s e s , A L U ,
r e g is t e r s s
N e x t m ic r o in s t r u c t io n C o n d it io n
a d d re s s c o d e s e le c t C P U c o n t r o l f ie ld

F ro m th e C C R
C a rry
C o n d it io n c o d e Z e ro
m u lt ip le x e r O v e r f lo w
N e x t a d d re s s c o n tro l
N e g a tiv e

The microinstruction field may be very long because it includes the tristate bus drivers, register clocks, ALU function inputs, memory
controls and so on.

There are two approaches to dealing with a microinstruction. One is called horizontally encoding and the other vertically encoding. In
a system with horizontal encoding, the bits of the microinstruction directly control the CPU; for example, if there are 8 registers that
can put data on a bus, there will be eight enable signals, one for each register.

In vertical encoding, a secondary decider is required between the microinstruction register and the computer being controlled. For
example, if there are 8 registers that can put data on a bus, the instruction register may use three bits to select one of eight registers.
Additional logic must be used to convert the three-bit register select code into one of eight enable signals, one for each register.
Vertical encoding uses one control signal per control point, whereas vertical encoding uses microinstruction fields that are encoded
and must be further decoded to generate actual control signals (via logic or via ROM look-up table decoders).

A vertically encoded instruction register is slower than a horizontally encoded instruction register because additional delays are
required for the decoding. In a horizontally encoded microinstruction, operations can be carried out in parallel (e.g., you can select
multiple registers as the destination of an operand). This is not possible with vertical encoding where, say, a register select field
defines one specific register. A real system might use a mixture or vertical and horizontal encoding.

Nanoprogramming

If you examine microcode in a control store, you will find that some microinstruction words appear over and over again; for example,
an operation such as ‘read a word from memory and put it in the MBR’ may be used by many microinstructions.

It has been observed that out of the billions of possible microinstruction words only a tiny fraction are found in any control store.
Consequently, a modification of the conventional control store has been suggested – the nanoprogram store.

The nanoprogram store holds the actual microinstructions that are executed. These nanoinstructions are very wide.

The control store itself contains a table of pointers to the microinstruction in the nanoprogram ROM. Consequently, nanoprogramming
uses a two-level store to save bits at the cost of speed. The figure illustrates the relationship between the mapping ROM, control store,
and nanoprogram ROM.

Example A computer has an 8-bit op-code and defines 200 unique machine-level (macroinstructions). Each macroinstruction is
implemented in terms of 4 microinstructions. A microinstruction is 150 bits wide. It is observed that there are only 120 unique
microinstructions. (a) How many bits of control store in all its forms are required by this arrangement? (b) How many bits would be
required if nanoprogramming weren’t used?

(a) There are 200 macroinstructions and each uses 4 microinstructions. This requires 200 x 4 = 800 microinstructions.
The mapping ROM has to select one of 800 microinstructions. This requires a 10-bit address (210 = 1024). The mapping ROM takes an
8-bit op-code and selects a starting microprogram address. This requires a 256 word x 10-bit ROM (i.e., 2560 bits).
There are 120 unique microinstructions each of which is 150 bits wide in the nanoprogram ROM; this is 120 x 150 = 18,000 bits.
Because there are 120 microinstructions, it takes a 7-bit address to select one of 120 microinstructions (2 7 = 128). The control store
contains 800 microinstructions, each requiring a 7-bit pointer which takes 800 x 7 = 5,600 bits.

The total storage is 2,560 (mapping ROM) + 5,600 (control store) + 18,000 (nanoprogram) = 26,160 bits.

(b) If the system does not use nanoprogramming, the control store requires 800 words x 150 bits = 120,000. The total number of bits is
control store plus mapping ROM = 120,000 + 2,560 = 122,560 bits.

You might also like