Microcode: Difference between revisions

Content deleted Content added
m disambig memory
Add more WCS info
Line 1:
A '''microprogram''' is a program consisting of '''microcode''' that controls the different parts of a computer's central processing unit ([[Central processing unit|CPU]]). The [[computer storage|memory]] in which it resides is called a [[control store]]. Complex microprograms were typical of [[mainframe computer]]s, such as the [[IBM]] [[System/360]]; but see [[RISC]] for more modern processor design.
 
==History==
Before 1951, the control logic for central processing units was designed by ''ad hoc'' methods. One of the simplest was to use rings of [[flip-flop]]s to sequence the computer's control logic.
 
In [[1951]] [[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 [[bit]]s.
 
==Implementation==
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.
 
Line 69 ⟶ 71:
however, the reduced complexity may increase the CPU's clock frequency, which lessens the effect of an increased number of cycles per instruction.
 
Because transistors are becoming cheaper, horizontal microcode is coming to dominate the design of hardware control units. As of the early [[2000s]], CPUs no longer use vertical microcode except perhaps in [[emulator]] software designed to run on a standard computer.
As of the early [[2000s]], CPUs no longer use vertical microcode except perhaps in [[emulator]] software designed to run on a standard computer.
 
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. This program is similar to those used to optimize a [[Programmable logic device|programmable logic array]]. 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 ROM control store. This reduces the cost and power used by a CPU.
This program is similar to those used to optimize a [[Programmable logic device|programmable logic array]].
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 ROM control store.
This reduces the cost and power used by a CPU.
 
==Writable control stores==
A few computers were built using "writable microcode" -- rather that storing the microcode in ROM or hard-wired logic, the microcode was stored in a RAM. Most of them were experimental laboratory prototypes, but there were a few commercial machines that used writable microcode, such as early [[Xerox PARC|Xerox]] workstations.
A few computers were built using "writable microcode" -- rather that storing the microcode in ROM or hard-wired logic, the microcode was stored in a RAM called a ''Writable COntrol Store'' or ''WCS''. Many of these machines were experimental laboratory prototypes, but there were also commercial machines that used writable microcode, such as early [[Xerox PARC|Xerox]] workstations, the [[Digital Equipment Corporation|DEC]] [[VAX]] 8800 ("Nautilus") family, and a number of [[IBM]] [[System/370]] implementations. Many more machines offered user-programmable writeable control stores as an option (including the [[HP]] [[HP 2100|2100]] and DEC [[PDP-11|PDP-11/60]] [[minicomputer]]s). WCS offered several advantages including the ease of patching the microprogram and, for certain hardware generations, faster access than ROMs could provide. User-programmable WCS allowed the user to optimize the machine for specific purposes.
 
A CPU that uses [[microcode]] generally takes several clock cycles to execute a single instruction, one clock cycle for each step in the microprogram for that instruction. Some [[CISC]] processors include instructions that can take a very long time to execute. Such variations in instruction length interfere with [[pipelining]] and [[interrupt]] [[latency]].
Such variations in instruction length interfere with [[pipelining]] and [[interrupt]] [[latency]].
 
==Microcode versus VLIW and RISC==
Many [[RISC]] and [[VLIW]] processors are designed to execute every instruction (as long as it is in the cache) in a single cycle. This is very similar to the way CPUs with microcode execute one microinstruction per cycle. [[VLIW]] processors have instructions that look like very wide horizontal microcode, while [[RISC]] processors generally have instructions that look more like narrow vertical microcode.