Search code examples
assemblycpu-architectureprocessorinstructions

Difference between horizontal and vertical microcode


I know what are microcoded instructions in computer architecture and design but was confused between these two terminologies. Went through several articles but was unable to get the clarity.

Some of them said:

Horizontal Microcodes : In this types of code the micro code contains the control signal without any intermediary.

Vertical Microcodes : In case of vertical micro code every action is encoded in density.

The terminologies are above my understanding and would appreciate a simpler explanation.


Solution

  • Well, Wikipedia gives a good introduction.

    Assume for the sake of simplicity that we have just two MUXs in the CPU data-path, say A and B.
    And that each MUX is controlled by 4 bits.

    A horizontal microcoded instruction would contain the select value for both MUXs A and B:

         4-bit   4-bit
         ______ _______
        |  A   |   B   |
         ¯¯¯¯¯¯ ¯¯¯¯¯¯¯
           |       |
           |       |
        ___V_   ___V_
       |MUX A| |MUX B|
        ¯¯¯¯¯   ¯¯¯¯¯
    

    The bits from the instruction are fed directly into the select lines of the two MUXs

    A vertical microcoded instruction would instead make use of a DEMUX, a "meta-DEMUX", that is used to select which MUX to drive.

     1
    
     b
     i
     t  4-bit
     _ _______
    |M|  SEL  |
     ¯ ¯¯¯¯¯¯¯
     |    | 4-bit DEMUX input
     |   _V_                          _______
     '->| D |  -- 4-bit output 0 --> | MUX A |
        | M |'                        ¯¯¯¯¯¯¯
        | U |.                        _______
        | X |  -- 4-bit output 1 --> | MUX B |
         ¯¯¯                          ¯¯¯¯¯¯¯
    

    So there is an intermediary combinatoric circuit between the instruction signal bits and the driven components.

    You can already see that vertical microcode has shorter instruction but a longer propagation time.