Microcode: Difference between revisions

Content deleted Content added
Clarify "logic"
Clarify that it is hardware that must be redesigned when custom logic needs changes
Line 24:
The basic idea behind microcode is to replace the custom hardware logic implementing the instruction sequencing with a series of simple instructions run in a "microcode engine" in the processor. Whereas a custom logic system might have a series of diodes and gates that output a series of voltages on various control lines, the microcode engine is connected to these lines instead, and these are turned on and off as the engine reads the microcode instructions in sequence. The microcode instructions are often bit encoded to those lines, for instance, if bit 8 is true, that might mean that the ALU should be paused awaiting data. In this respect microcode is somewhat similar to the paper rolls in a [[player piano]], where the holes represent which key should be pressed.
 
The distinction between custom logic and microcode may seem small, one uses a pattern of diodes and gates to decode the instruction and produce a sequence of signals, whereas the other encodes the signals as microinstructions that are read in sequence to produce the same results. The critical difference is that in a custom logic design, changes to the individual steps require the logichardware to be redesigned. Using microcode, all that changes is the code stored in the associated [[read only memory]] (ROM). This makes it much easier to fix problems in a microcode system. It also means that there is no effective limit to the complexity of the instructions, it is only limited by the amount of ROM one is willing to use.
 
The lowest layer in a computer's software stack is traditionally raw [[machine code]] instructions for the processor. In microcoded processors, fetching and decoding those instructions, and executing them, may be done by microcode. To avoid confusion, each microprogram-related element is differentiated by the ''micro'' prefix: microinstruction, microassembler, microprogrammer, etc.<ref>{{Cite web |title=ISO/IEC/IEEE 24765:2017(en) Systems and software engineering — Vocabulary |url=https://www.iso.org/obp/ui/#iso:std:iso-iec-ieee:24765:ed-2:v1:en |access-date=2024-06-23 |website=www.iso.org}}</ref>