4 ms·
Microcode is far more low level than "to exponentiate, multiply repeatedly". More like, take an instruction such as ADD AX, BX. I'm using a 16-bit example to ke
by bitwize 4y ago
Microcode is far more low level than "to exponentiate, multiply repeatedly". More like, take an instruction such as ADD AX, BX. I'm using a 16-bit example to keep things simple. That might decode into micro-ops as follows:
1. set the ALU input 0 to take input from register AX
2. set the ALU input 1 to take input from register BX
3. set the ALU output to register AX
4. tell the ALU to ADD
And I bet I oversimplified it and got it wrong.
Each micro-op tells the CPU which control lines to turn on and off to activate the registers, ALU, memory bus, etc. Historically it lived on ROM for Intel parts, but that's changed in recent decades. User-programmable microcode was a thing; microcode extensions allowed the Xerox Alto's CPU to function as a proto-GPU, with operations like fast line draws and BitBlt, allowing the Smalltalk UI to be drawn MUCH faster than you'd expect a mid-70s minicomputer to do. Even in the micro era, the DEC Alpha and the Nintendo 64's GPU both had user-loadable microcode. Intel and AMD chips don't allow this; their microcode updates have to be vendor-signed.
But yeah, if you don't trust microcode, don't run an Intel CPU. Stick with God's own perfect CPU, the 6502... its control logic is hardwired, not microcoded. That's part of why it was so cheap and so fast.
- chipsa 4y ago@kens has an explanation on his blog of microcode (from an Intel CPU): http://www.righto.com/2022/11/how-8086-processors-microcode-engine.html http://www.righto.com/2022/11/how-8086-processors-microcode-...
- twisteriffic 4y ago> not microcoded Still microcoded, just not updatable. https://news.ycombinator.com/item?id=21428905 https://news.ycombinator.com/item?id=21428905
- monocasa 4y agoSo I've reflected on my previous statements there, and have come to the conclusion that the 6502's PLA isn't microcode or a compression format for a microcode ROM. The big piece it's missing is the microinstruction address counter. There was a T state counter which was tripping me up, but having played with the visual 6502, the T state counter really isn't a full microinstruction addr counter. The PLA is really more logically like individual CAMs for each of the control lines looking at the instruction register and the T states. So the PLA really is more an encoding of random logic than a microcode ROM. They end up being really close concepts though. A great case of 'that guy that inhabited this same body a few years ago was a fucking idiot and needs to learn to shut his mouth'. I'm sure the person to inhabitant this body in a few years will say the same about me.
- klelatti 4y ago> So the PLA really is more an encoding of random logic than a microcode ROM. Thanks for a very succinct summary of a question I've pondered for a bit too.
- pgeorgi 4y agoI was looking for an example that works with middle-school knowledge of computation but that isn't so trivial as to be meaningless. Implementing exponentiation in terms of multiplication seemed to fit the bill. I could have tried to put in a rough approximation of the rdmsr state machine, but people would have rightfully tuned out in the second sentence.
- kjs3 4y agoLook for Bit Slice Design by Donnamaie E. White or the "Mick & Brick" bitslice book. Both take you through simple but non-trivial microcode use cases.
- queezey 4y agoNintendo 64’s RSP (Reality Signal Processor) was effectively a vector-optimized MIPS CPU, so its “microcode” was really just MIPS assembly. The “micro” aspect of RSP microcode came from the 4KB Instruction Memory and 4KB Data Memory that the RSP had direct access to. The RSP was not a GPU, but it did process display lists before handing them off to the RDP (Reality Display Processor). RSP microcode was used for audio processing, video decoding, display list transform & lighting, as well as other more general processing tasks such as terrain generation.
- derefr 4y ago> Stick with God's own perfect CPU, the 6502 Except that if you want to buy one today, you'd likely get a 65c02... which is fully microcoded (in the sense of having a microcode LUT, rather than a PLA.)
- ignoramous 4y agoReminds me of Ben Eater's 'Write a program from scratch' series, which he beings by coding up the 65c02 unit with an EPROM and an IO device: https://www.youtube.com/watch?v=yl8vPW5hydQ&list=PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH&index=2 https://www.youtube.com/watch?v=yl8vPW5hydQ&list=PLowKtXNTBy...