Jump to content

Microcode

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Mike dill (talk | contribs) at 19:49, 27 September 2001. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

A microprogram controls the different parts of a computer's central processing unit (CPU). The memory in which it resides is called a control store. It is the modern form of the logic of a computer's control unit.


Before 1955, the control logic for central processing units was designed by ad-hoc methods. One of the simplest was to use rings of flip-flops to sequence the computer's control logic.


In 1955 Maurice Wilkes had a fundamental insight. He realized that if one takes the control signals for a computer, one could understand them as being played much like a player-piano roll. That is, they are controlled by a sequence of very wide words constructed of bits.


A microprogram provides the bits to control these. The fundamental advance is that CPU control becomes a specialized form of a computer program. It thus transforms a complex electronic design challenge (the control of a CPU) into a less-complex programming challenge.


To take advantage of this, computers were divided into several parts:


A sequencer picked the next word of the control store. A sequencer is mostly a counter, but usually also has some way to jump to a different part of the control store depending on some data, usually data from the instruction register and always some part of the control store. The simplest sequencer is just a register loaded from a few bits of the control store.


A register set is a fast memory containing the data of the central processing unit. It may include the program counter, stack pointer, and other numbers that are not easily accessible to the application programmer. Often the register set is triple-ported, that is, two reigsters can be read, and a third written at the same time.


An arithmetic and logic unit performs calculations, usually addition, logical negation, a right shift, and logical AND. It often performs other functions, as well.


There may also be a memory address register and a memory data register, used to access the main computer storage.


Together, these elements form an "execution unit." Most modern CPUs have several execution units. Even simple computers usually have one unit to read and write memory, and another to execute user code.


The parts of the execution units, and the execution units themselves are interconnected by a bundle of wires called a bus.


Programmers develop microprograms. The basic tools are software: A microassembler allows a programmmer to define the table of bits symbolically. A simulator program executes the bits in the same way as the electronics (hopefully), and allows much more freedom to debug the microprogram.


After the microprogram is finalized, and extensively tested, it is sometimes used as the input to a computer program that constructs logic to produce the same data. No known computer program can produce optimal logic, but even pretty good logic can vastly reduce the number of transistors from the number required for a control store. This reduces the cost and power used by a CPU.