How does microcode work??

From: Allison J Parent <allisonp_at_world.std.com>
Date: Thu Jan 8 08:59:51 1998

< Inutitively I know what microcode is. I think of it as hard-coded RO
<for the instruction fetch unit of the microprocessor. Since I haven't bee
<formally schooled in computer science or microprocessor design, I'd like
<understand (in 500 words or less <g>) how microcode works, i.e., how is i
<implemented and how does the microprocessor access it.

Microcode:

In the simplest form it's the control program that runs the CPU.
Every computer has it's instructions set, most we know like ADD A,B or
MOV A,B. Those are called MACROinstructions. Microcode is the internal
coding to actually create the sequence of timing pulses to actually make
the ADD happen.

The microcode resides in it own storage area and is generally inaccessable
(there are exceptions). A typical sequence would be in english:

  macro instruction: ADD A,B Add contents of register A to
                                        register B and place results
                                        in A

  Start: Fetch an instruction (uses program counter register
                                        as address or source and
                                        destination is the "instruction
                                        register).
                Jump to address _at_I (use the instruction register
                                        as an address of the next
                                        microinstruction.)
  ADD: -signal add instruction
                to ALU
                -gate A register to ALU
                -gate B register to ALU
                -store ALU to A register (this could al be in one
                                         microinstruction or it could
                                         be a sequence of several.)
                jump to START (get next MACROinstuction)

NOTE: microcoding is one way to construct a computer control, sequential
      logic is also possible but as the machines increase in complexity
      the logic complexity grows to sometimes implementable levels or
      becomes hard to correct if there is an error.

      Microcoding makes error correction easier and if new instruction
      need to be added it's possible if the code space exists. It's also
      easier to create a machine on paper or as a program that executes
      microcode to test it.


Allison
Received on Thu Jan 08 1998 - 08:59:51 GMT

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:30:56 BST