written 7.8 years ago by |
Types of microinstruction formats:
There are three types of microinstruction formats
- Horizontal Format, called Horizontal microcode
- Vertical Format, called Vertical microcode
- Field-encoded Format
Each of these formats provides a trade off in terms of the control store size and the speed of operation of the control unit.
1. 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.
2. 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.
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:
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.
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.
3. 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:
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.