Looking For Pi In The 8087 Math Coprocessor Chip

Even with ten fingers to work with, math can be hard. Microprocessors, with the silicon equivalent of just two fingers, can have an even harder time with calculations, often taking multiple machine cycles to figure out something as simple as pi. And so 40 years ago, Intel decided to give its fledgling microprocessors a break by introducing the 8087 floating-point coprocessor.

If you’ve ever wondered what was going on inside the 8087, wonder no more. [Ken Shirriff] has decapped an 8087 to reveal its inner structure, which turns out to be closely related to its function. After a quick tour of the general layout of the die, including locating the microcode engine and ROM, and a quick review of the NMOS architecture of the four-decade-old technology, [Ken] dug into the meat of the coprocessor and the reason it could speed up certain floating-point calculations by up to 100-fold. A generous portion of the complex die is devoted to a ROM that does nothing but store constants needed for its calculation algorithms. By carefully examining the pattern of NMOS transistors in the ROM area and making some educated guesses, he was able to see the binary representation of constants such as pi and the square root of two. There’s also an extensive series of arctangent and log2 constants, used for the CORDIC algorithm, which reduces otherwise complex transcendental calculations to a few quick and easy bitwise shifts and adds.

[Ken] has popped the hood on a lot of chips before, finding butterflies in an op-amp and reverse-engineering a Sinclair scientific calculator. But there’s something about seeing constants hard-coded in silicon that really fascinates us.

“DB” = Abbreviated Microcontroller Debugging

We’ve all been there. When debugging a microcontroller project, we just want to put in a print statement to figure out what’s going on with the microcontroller in real time. However, advanced embedded programmers know that printf statements are verboten: they’re just too SLOW. While not fixing this plight entirely, [Atakan Sarioglu] has come up with a clever way to create readable debug messages with minimal runtime overhead.

[Atakan Sarioglu]’s innovation, called BigBug (Github), is a dynamically-generated codebook. The codebook translates abbreviated messages sent over serial (UART here) to longer-form human-readable messages. To generate the codebook, BigBug automatically parses your comments to create a lookup between an abbreviation and the long-form message. When you are running your program on the microcontroller, BigBug will translate the short codes to long messages in real-time as you send log/debug data over serial. Continue reading ““DB” = Abbreviated Microcontroller Debugging”

Log Coasters Made With Just Two Tools

diy-log-coaster-set

Still looking for that perfect gift? [Joel Witwer] shows us how to make a log coaster set and holder on the cheap. He figures he spent just $5 on the project and from what we can tell that all went to some polyurethane which he used to finish the wood pieces.

It started with an interesting-looking and appropriately sized log which he found on the side of the road. We’re not sure about the ins and outs of drying stock to ensure it won’t crack, but we hope he took that into account. With raw material in hand he headed over to the band saw. The cutting starts by squaring up both ends of the log while cutting it to the final length. He then cut the bottom off of the holder. What was left was set upright so that he could cut the core out of the log. This is the raw material from which each coaster is cut. A spindle sander was used to clean up all of the pieces. The last step before applying finish is to glue the bottom and sides of the holder back together.

[Joel] gave some tips in his Reddit thread. He says you should hold on tight while cutting out the slices for coasters because the round stock will want to spin. He also mentions that some of the slices aren’t as flat as they should have been, something to think about if you’re cutting these for yourself.