3 comments

  • kens5 hours ago
    Author here if anyone has questions...
    • hnthrowaway03151 hour ago
      Hi kens, thanks for the knowledge sharing all these years. Can you please confirm this one? From Wikipedia, it says that 8087 uses CORDIC algorithm. Does that mean that it&#x27;s the same (but different speed) as what I&#x27;d implement the functions in software, except in microcode (which has more granularity than usual assembly code)?<p>I found it a bit surprising that as a 45-year old chip, there is no public information of its microcode. I guess hardware is indeed much more secret than software.
      • kens1 hour ago
        Yes, the 8087 uses CORDIC. I extracted the constants from the 8087&#x27;s internal constant ROM and they are arctangent and log values for the CORDIC algorithm. You can implement the same functions in software, which is what floating-point emulation libraries did back then.<p>There&#x27;s almost no public information on the 8087 microcode, but I&#x27;m working on that :-)
    • dapperdrake50 minutes ago
      Thank you for the deep dive.
    • farseer5 hours ago
      Is there 8087 IP available in verilog etc?
      • kens4 hours ago
        As far as I know, you can&#x27;t get the 8087 itself as an IP block. You can get generic IEEE-754 floating-point as an IP block, e.g. from AMD: <a href="https:&#x2F;&#x2F;www.amd.com&#x2F;en&#x2F;products&#x2F;adaptive-socs-and-fpgas&#x2F;intellectual-property&#x2F;floating_pt.html" rel="nofollow">https:&#x2F;&#x2F;www.amd.com&#x2F;en&#x2F;products&#x2F;adaptive-socs-and-fpgas&#x2F;inte...</a>
  • dboreham5 hours ago
    Until I read this I did not know that 1970s microprocessors had register renaming. Feel a little cheated, thinking for all those years that they were actually moving the bits.
    • dapperdrake47 minutes ago
      If you work through a math problem with pen and paper or nand2tetris or nandgame.com then it becomes obvious that changing indexes into a register file (a.k.a. pointers) are way faster and easier than wires to move stuff around.
    • peterfirefly3 hours ago
      How do you think the EXX and EX AF,AF&#x27; instructions work on the Z80?
    • kens1 hour ago
      If you feel cheated now, wait until you find out that the ALU in the 8-bit Z80 was just 4 bits. :-)
  • 0xsn3k5 hours ago
    super cool! i wonder how difficult it would be to recreate the entire chip at logic gate level in, say, VHDL or Verilog
    • kens5 hours ago
      It would be difficult, but not impossible. The main problem is tracing out all the circuitry, which is very time-consuming and error-prone. Trust me on this :-)<p>The second problem is that converting the circuitry to Verilog is straightforward, but converting it to usable Verilog is considerably more difficult. If you model the circuit at the transistor level in Verilog, you won&#x27;t be able to do much with the model. You want a higher-level model, which requires converting the transistors into gates, registers, and so forth. Most of this is easy, but some conversions require a lot of thought.<p>The next issue is that you would probably want to use the Verilog in an FPGA. A lot of the 8087&#x27;s circuitry isn&#x27;t a good match for an FPGA. The 8087 uses a lot of dynamic logic and pass transistors. Things happen on both clock edges, so it will take some work to map it onto edge-trigger flip-flops. Moreover, a key part of the 8087 is the 64-bit shifter, built from bidirectional pass transistors, which would need to be redesigned, probably with a bunch of logic gates.<p>The result is that you&#x27;d end up more-or-less reimplementing the 8087 rather than simply translating it to Verilog.
      • dapperdrake46 minutes ago
        Noob here,<p>does VH have options for encoding working with both clock edges?
        • kens26 minutes ago
          There&#x27;s a difference between what Verilog will allow and what is &quot;synthesizable&quot;. In other words, there is a lot of stuff that you can express in Verilog, but when you try to turn it into an FPGA bitstream, the software will say, &quot;Sorry, I don&#x27;t know how to do that.&quot; Coming from a software background, this seems bizarre, as if C++ compilers rejected valid programs unless they stuck to easy constructs with obvious assembly implementations.<p>Using both edges of a clock is something that you can express in Verilog, but can&#x27;t be directly mapped onto an FPGA, so the synthesis software will reject it. You&#x27;d probably want to double the clock rate and use alternating clock pulses instead of alternating edges. See: <a href="https:&#x2F;&#x2F;electronics.stackexchange.com&#x2F;questions&#x2F;39709&#x2F;using-both-edges-of-a-clock" rel="nofollow">https:&#x2F;&#x2F;electronics.stackexchange.com&#x2F;questions&#x2F;39709&#x2F;using-...</a>
      • 0xsn3k4 hours ago
        ah, i see, thanks for the insight! do you have any advice on how one might get started with IC reverse-engineering? i think it would be interesting to reimplement these chips in a way that&#x27;s at least inspired by the original design
        • kens4 hours ago
          How to get started reverse engineering? That&#x27;s a big topic for a HN comment, but in brief... Either get a metallurgical microscope and start opening up chips, or look at chip photos from a site like Zeptobars. Then start tracing out simple chips and see how transistors are constructed, and then learn how larger circuits are built up. This works well for chips from the 1970s, but due to Moore&#x27;s Law, it gets exponentially more difficult for newer chips.<p>I also have a video from Hackaday Supercon on reverse engineering chips: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=TKi1xX7KKOI" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=TKi1xX7KKOI</a>
          • monocasa4 hours ago
            Do you have any good tips on what to look out for when buying a used metallurgical microscope for looking at decapped chips? Even if not a complete set constraints, I&#x27;d appreciate some off the cuff thoughts if you have the time.
            • kens3 hours ago
              I use a basic metallurgical microscope (AmScope ME300TZB). An X-Y stage is very useful for taking photos of chips and stitching them together. A camera is also important; my scope has a 10MP camera. I&#x27;m not into optics, so I don&#x27;t know what lens characteristics to look for.