3 ms·
There is one important practical criterion, which is whether you can change what some instructions do, without redesigning the layout of the CPU. Both ROMs and
by adrian_b 5y ago
There is one important practical criterion, which is whether you can change what some instructions do, without redesigning the layout of the CPU.
Both ROMs and PLAs have a regular array structure, where you can change the stored bits with some minor changes in one of the masks, without having to make any changes in the layout of the CPU.
So the most useful definition of whether an instruction is micro-programmed or hard-wired is whether the method of changing what it does is by changing just the values of some bits in a table or by redesigning some CPU part.
This is the right definition from the point of view of the CPU designer.
Application programmers tend to partition the instructions of the modern CPUs in hard-wired and micro-programmed based on whether they execute in a single clock cycle or in multiple clock cycles, but in old CPUs it was quite frequent to have hard-wired instructions that executed in multiple cycles. Modern CPUs have much more available resources, so now it is normal for any hard-wired instruction to also be a single-cycle instruction, but there is no logical necessity for this.
An extra complication in many modern CPUs is that even if most instructions are usually hard-wired, there are also means to intercept the decoding for any opcode and replace the hard-wired operation with a micro-program, in order to be able to correct any dangerous bugs.