4 ms·
Where can one learn more about microcode, how it's implemented in silicon? As I understand it most machine code is actually "VM bytecode", and the "real" cpu is
by bruce343434 3y ago
Where can one learn more about microcode, how it's implemented in silicon? As I understand it most machine code is actually "VM bytecode", and the "real" cpu is the microcode processor?
- kens 3y agoA computer architecture book such as Hennessy and Patterson will describe microcode in detail. It's a bit confusing because microcode has changed meaning a bit over time. "Classical" microcode, such as the 8086, replaces hard-wired control logic with micro-instructions. The processor steps through the appropriate micro-instructions, which are decoded to generate control signals. The Pentium Pro introduced a new model, where machine instructions are broken down into independent micro-ops, which are handed off to the core processor engine and processed independently, in parallel. At the end, the micro-ops are "retired" in a sequential order, so your program appears sequential. Most micro-ops are generated by decoders that convert a machine instruction into a small number of micro-ops. However, complicated machine instructions are converted into micro-ops by microcode. This is similar to classical microcode, except it's not executing micro-instructions but generating micro-ops that then get run by the underlying processor.
- userbinator 3y agoI wouldn't recommend anything from Hennessy and Patterson for learning about microcode; they are entirely RISC proponents, after all. Instead, books and articles from 50s-70s on computer design are probably far more detailed and relevant.
- pests 3y agoBen Eater on YouTube has recreated an 8-bit computer on breadboards. https://www.youtube.com/watch?v=dXdoim96v5A https://www.youtube.com/watch?v=dXdoim96v5A That is the start of the videos where the control logic gets microcoded. Its pretty basic but over the next few videos he comes up with about 10 different OPCODES and programs their microcode (a series of control logic activations). Its pretty amazing to see it all come together and work in the end.
- anyfoo 3y agoYes, absolutely. Ben Eater’s series is fantastic. If you want to learn about simple microcode and how a (non-superscalar, which matches the 8086) CPU generally works, this is a brilliant resource, and fun to watch.
- pests 3y agoHis entire channel is brilliant. I also love his homemade GPU. I forget sometimes just how fast CPUs are so watching him 'race the beam' (not literally anymore, but HDMI has timings just the same) is fascinating.
- pwg 3y ago> Where can one learn more about microcode, Provided you can find a copy, the book "Computer Organization", 2nd ed, by V. Car Hamacher, Zvonko G. Vranesic and Safwat G. Zary, published by McGraw Hill, contains a very understandable chapter of microcode control. Depending on your background, you may want to read some of the prior chapters first before starting on the microcode one, to get some foundational knowledge. Do note that the 2nd ed was published in 1984, so finding a copy may be difficult. I do not know how (or even if) the microcode control chapter was updated in subsequent editions.
- peterfirefly 3y agoAmazon has some used copies.