Microinstruction Formats 

There are several formats for encoding the control signals in a control word. In this section, we will discuss the following three control word formats:
Horizontal Format, called Horizontal microcode
Vertical Format, called Vertical microcode
Field-encoded Format

Each of these formats provides a tradeoff in terms of the control store size and the speed of operation of the control unit.

Horizontal Microcode

In the horizontal format, each control signal is represented by a single bit in the control word. Thus, if the design has 500 control signals, this will require 500 bits in each control word to store the control bits. In this format, the control store looks horizontal in shape since the control words are wide.

The disadvantage of the horizontal format is that the size of the control store is large. However, it has the advantage of speed of operation as the control signals will be ready as soon as the control word is fetched from the control store.

Vertical Microcode

In the vertical microcode organization, the following steps are performed:
Identify the number of distinct control words in the design
Encode each distinct control word by assigning a unique n-bit code to it, where n is log2 (number of distinct control words)
Instead of storing the actual control signals that need to be generated, only the n-bit code is stored for each CW
Use a nx2n decoder to generate a decoded signal for each distinct control word
To generate the control signals, use an OR gate based on the decoded control word signals, for each control signal in the design.

The following figure illustrates the horizontal and vertical control store organization.

Fig. m300153.1 Horizontal and Vertical Control Store

To illustrate the vertical microcode organization, suppose that we have only the instruction ADD R1, [R3] (R1← R1 + [R3]). The control words for this instruction and the code assigned to each control word is shown below:

Control Sequence Active Signals CW Code
T1 PCout, MARin, Read, ALU (C=B+1), Zin 000
T2 Zout, PCin, WMFC 001
T3 MDRout, IRin 010
T4 R3out, MARin, Read 011
T5 R1out, Yin, WMFC 100
T6 MDRout, ALU (C=A+B), Zin 101
T7 Z1out, R1in, END 110

Since we have 7 distinct CWs, we need to encode each control word using a 3-bit code. We also need a 3x8 decoder to decode the CW codes and generate the decoded CW signals. The following figure illustrates the generation of some of the control signals in this example.

Fig. m300153.2 Vertical Microcode Example

The vertical microcode organization reduces the width of the CWs making the control store having the vertical shape. The advantage of the vertical microcode organization is that it reduces the control store size significantly. For example, suppose that a design has 500 control signals and 100 CWs. The size of the control store will be 100x(7+500+7) = 51400 bits. Note that the first 7 bits are used for Mux control and uBranch control signals. The last 7 bits are for storing the uBranch address. However, in the vertical microcode organization each CW will be encoded with 7 bits since we have 100 CWs. So, the size of the control store will be 100x(7+7+7)= 2100 bits.

The vertical microcode organization provides slower implementation compared to the horizontal microcode organization. To generate the control signals, it requires reading the CW code from the control store, decoding the CW, and then using OR gates. This requires more time and slows down the control unit operation.

Filed-Encoded Format

It can be observed that there are signals in the design that cannot be 1 at the same time. These signals ate called Mutually Exclusive signals. In order to save the size of the control store, all mutually exclusive signals can be grouped together and encoded so that a code is stored for this group instead of the actual signals. Then, a decoder can be used to decode the group code and generate the signals.

For example, let us consider a single-bus CPU design. Let us assume that the data path of this CPU has four general purpose registers R1, R2, R3, and R4. It has also a temporary register Temp. In addition, it has the registers PC, IR, MAR, MDR, Y, and Z registers. To control these registers, for capturing values in these registers, 11 signals are required. For putting the values of these registers on the CPU bus, 9 signals are required. Note that the Y register and MAR register do not put their values on the CPU bus. Thus, a total of 20 signals are required to control these registers.

Assume that the ALU has 3 select lines and it can perform 8 different functions. This requires 3 control signals to control the ALU. In addition, we need 5 more control signals for Carryin, Read, Write, WMFC, and END. Thus, the total number of control signals that need to be generated by the control unit are 20+3+5=28 signals.

The following table shows the field encoded format of the control word after grouping mutually exclusive signals:

F1 (4 bits) F2 (3 bits) F3 (3 bits) AS3 AS2 AS1 Read Write Carry-in WMFC End
0000: No action 000: No action 000: No action 000: ADD
0001: PCout 001: PCin 001: MARin 001: INC
0010: MDRout 010: IRin 010: MDRin 010: SUB
0011: Zout 011: Zin 011: TEMPin 011: DEC
0100: R0out 100: R0in 100: Yin 100: AND
0101: R1out 101: R1in 101: OR
0110: R2out 110: R2in 110: XOR
0111: R3out 111: R3in 111: NOT
1000: IRout
1001: TEMPout

The filed-encoded format, in this example, requires 4+3+3+3+1+1+1+1+1=18 signals to encode the control signals instead of 28 signals in the horizontal format. However, 3 decoders are required to decode the encoded groups: a 4x16 decoder to decode group F1 signals, a 3x8 decoder to decode group F2 signals, and a 3x8 decoder to decode group F3 signals.

This approach comes in the middle in between the horizontal and vertical formats. Its control store is less than the horizontal microcode and larger than the vertical microcode. However, its implementation is slower than the horizontal microcode and faster than the vertical microcode.