Horizontal Micro-programmed Vs. Vertical Micro-programmed Control Unit
To understand the horizontal and vertical control unit, we will first learn about the control unit, micro-programmed, and then the micro-programmed control unit. After that, we will learn the difference between horizontal and vertical control units.
The control unit can be described as a part of the CPU (Central processing unit). It is an engine that uses the proper sequence of control signals so that it can run the entire functions of a system or computer. It is used to direct the operations of a processor. The work of CU is to tell the memory of system, input and output devices, and arithmetic or logical unit that how they should respond to those types of instructions that have been sent to the processor.
Microprogramming can be described as the process of writing microcode to control memory of the CPU. When the configuration of a computer and the establishment of a micro-programmed control unit are done perfectly, only after that, microcode for control memory can be generated. The control unit is used to contain the control memory, which can be used to store all micro-programs. These types of micro-programs cannot be frequently modified. The microinstruction can be specified with the help of each line of micro-program, and these instructions are used to define one or more than one micro-operation.
Micro-programmed Control Unit
A micro-programmed control unit is used to execute each instruction with the help of generating control signals. A special memory unit is used in the micro-programmed control unit. With the help of this memory, we can store the control signals that are related to the operations. We can assume a set of control signals, which can be performed the specific micro-operations as being "microinstructions". With the help of internal control unit, we can store the sequence of microinstructions. There are two types of micro-programmed control units on the basis of control words, which are saved in the control memory. These micro-programmed control units are the Vertical micro-programmed control units and the horizontal micro-programmed control units. Now we will describe both the control unit one by one like this:
Horizontal Micro-programmed Control unit
With the help of decoded binary format, we can represent the control signals in the horizontal micro-programmed control unit, i.e., 1bit/CS. Here, n bit encoding is needed for 'n' control signals. With the help of a single control point, each bit is identified in the horizontal micro-programmed CU. This Control point is used to show that the corresponding micro-operation is going to be executed. In this control unit, every micro-program needs less number of micro-instructions. The several resources can be controlled simultaneously with the help of each and every micro-instruction. It also has a bigger advantage, i.e., it has the ability to utilize more efficient hardware.
A higher degree of parallelism is provided by the horizontal CU. This parallelism contains a separate control field and a minimum number of encoding. In the horizontal CU, the task to develop the micro-programs with the help of using resources efficiently and optimally is very complex. Each control bit in the horizontal micro-programmed control unit is independent to each other. That's why this CU provides great flexibility. The horizontal microinstruction contains more information as compared to the vertical microinstruction because horizontal microinstruction contains a greater length.
Fig: Horizontal Microcode
Vertical Micro-programmed CU
In contrast to the Horizontal micro-programmed CU, a higher degree of encoding and variable format can be applied in the vertical micro-programmed control unit. With the help of encoded binary format, we can represent the control signals in the vertical micro-programmed CU. Here, log2n bit encoding is needed for 'n' control signals. A single micro-operation is represented by every vertical micro-instruction. With the help of vertical CU, we can shorten the length of microinstruction as well as prevent the length of microinstruction from being directly affected by the increasing memory capacity.
The microinstruction is performed with the help of a code, and this code will be translated into the individual control signals with the help of a decoder. Because here we only specified the micro-operation that will be performed and the fields of microinstruction are fully utilized. There are basically 4 to 6 fields, and these fields approximately require 16 to 32 bits per instruction. As compared to the horizontal micro-programmed, we can easily write the vertical micro-programmed. Same as the conventional machine language format, the vertical microinstruction also contains a few operands and one operation. So we can easily use the vertical microinstruction for micro-programming.
Fig: Vertical Microcode
Differences between Horizontal and Vertical Micro-programmed CU
There are various differences between the vertical programmed CU and horizontal programmed CU, which are described as follows:
In this example, we will assume 4k words, which are supported with the help of hypothetical control unit. There are total 16 flags and 64 control units in the hardware. Now we have to find the size of control memory in bytes and the size of control word in bits for two types of programming, i.e., Horizontal and Vertical programming.
For Horizontal programming
64 bits for 64 signals
Size of control word = 4 + 64 + 12 = 80 bits
Size of control memory = 4 KW = ((4 * 80) / 8) = 40 kByte
For Vertical programming
6 bits for 64 signals i.e. log264
Size of control word = 4 + 6 + 12 = 22 bits
Size of control memory = 4 KW = ((4 * 22) / 8) = 11 kByte
Some Other differences between Horizontal and Vertical Micro-programmed CU
Now we will describe these differences on the basis of some parameters, such as sequence, encoding, design, and flexibility. These differences are described as follows:
A higher degree of encoding and a variable format is contained by the vertical micro-programmed. Here a code is used to encode the control bits. Each action will be performed with the help of this code, and this code will be decoded into more than one control signal with the help of an instruction decoder. In contrast to the vertical micro-programmed control unit, the horizontal micro-programmed CU has the ability to contain the horizontal microinstructions, which do not use any type of encoding at all. The horizontal CU is used to show each control bit in the datapath. Here a separate bit is assigned to the datapath in the form of microinstruction format. A control line is used to attack with every bit in the control field.
In horizontal microprogramming, we can specify the next instruction in a micro-program with the help of a sequential approach. This same approach is used by the conventional machine learning format. The single control point is used to identify each and every bit in the horizontal micro-programmed. This Control point is used to show that the corresponding micro-operation is going to be executed. In order to break the sequence, we have to use the special conditional and unconditional microinstruction. A relative addressing scheme is used in the vertical micro-programmed. According to this scheme, we can specify the backward jump or relative forward with the help of a few bits. In this process, address computation is needed at every step.
There is a better code density in the vertical micro-programmed. Due to this feature, the size of control store gets a lot of benefits. Same as the conventional machine language format, the vertical microinstruction also contains a few operands and one operation. A single micro-operation is represented with the help of each microinstruction. The data sink and resources are specified with the help of operands. In contrast, the horizontal micro-programmed represents more than one micro-operation that is going to be executed simultaneously. If there is an extreme case, each horizontal CU can be used to control more than one hardware resource simultaneously.
Each control bit in the horizontal micro-programmed is independent of each other. That's why this CU provides improved flexibility. As compared to the vertical microinstruction, it contains a greater length. So, horizontal micro-programmed CU is able to contain more length. The most commonly available horizontal micro-programmed usually contains 48 or more bits. This CU has the ability to utilize hardware more efficiently, and it is the advantage of horizontal micro-programmed. The less amount of microinstruction per micro-program is required in the horizontal control unit. In contrast to the horizontal micro-programmed control unit, the vertical micro-programmed are more compact but less flexible. In the case of micro-programming, the consequently easily used approach is the vertical approach.
Summary of Horizontal and Vertical Micro-programmed
A single micro-operation is able to represent by the vertical microinstructions, and this feature is not available in the horizontal microinstructions. The higher degree of parallelism is performed by the horizontal micro-programmed. This parallelism contains a separate control field and a minimum number of encoding. Whereas the vertical micro-programs are used to encode the control bits. We should be very careful while choosing between these two approaches. However, in practice, the designer makes a compact yet effective structure with the help of combining the formats of vertical and horizontal microinstructions.