Microcode

layer of hardware-level instructions or data structures
(Redirected from Microprogram)

Microcode is the name for a number of instructions or data structures which are involved in implementing higher-level machine language in many processors, especially microprogrammed ones. Microcode is on memory that is very fast to access. When a machine level instruction needs to be executed, microcode tells the processor what electronic circuits should be used. When a new processor is designed, an engineer also writes the microcode for the instructions of machine language. This is called Microprogramming, the resulting code is called a microprogram.

In early processors, each instruction was hard-wired. This has several drawbacks, the most obvious is that correcting an error in processor design means that the processor needs to be replaced.[1] [2]


Example change

A processor should add two values, which are in registers A and B.

  1. Configure the ALU for addition
  2. Put the value of register A on one input of the ALU
  3. Put the value of register B on one input of the ALU
  4. After waiting a short time, to allow for the addition, the result needs to be copied into a register, which has not been used yet
  5. The value of that register needs to be copied to register A
  6. The next instruction needs to be fetched from memory

Items 1-3, as well as 5-6, can be coded as one instruction. It is also possible to hard-wire the logic needed for this operation. This has the benefit of being faster, but the drawback that it no longer allows changes that might be needed later on.

The concept of microprogramming was developed by Maurice Wilkes in 1951, using diode matrices for the memory element.

References change

  1. Kent, Allen; Williams, James G. (1993-04-05). Encyclopedia of Computer Science and Technology: Volume 28 - Supplement 13: AerosPate Applications of Artificial Intelligence to Tree Structures. CRC Press. ISBN 978-0-8247-2281-4.
  2. Fog, Agner (2017-05-02). "The microarchitecture of Intel, AMD and VIA CPUs" (PDF). Technical University of Denmark. Archived (PDF) from the original on 2017-03-28. Retrieved 2018-04-08.