4 ms·
> If I added a new instruction that just does a logic right shift by 1 and made the old shift instructions all trap You can use microcode for that. Also microc
by codedokode 3y ago
> If I added a new instruction that just does a logic right shift by 1 and made the old shift instructions all trap
You can use microcode for that. Also microcode can be used to implement multiply/divide by adding/subtracting in a loop. Microcode is very bad for performance, but in a DIY project it can save lot of chips. Microcode was used in 60s and 70s computers.
And the simplest microcode sequencer is made of 1 (one) register and 1 (one) ROM. Although, for a RISC-V you would probably need more than 1 ROM (microcode is usually very wide, 16- or more bits).
- IgorPartola 3y agoIsn’t microcode used in today’s CPUs all the time? Or is this different meaning of microcode?
- andai 3y agoI would guess they used to use it because hardware was very expensive, and now they use it because performance is very cheap.
- LoganDark 3y agoI think now they use it because they can implement the bajillion x86 instructions in terms of much simpler and more efficient micro-ops, without implementing every single x86 instruction completely uniquely.