[Ken Shirriff] is the gift that keeps on giving this new year. His latest is a reverse engineering of the 74181 Arithmetic Logic Unit (ALU). The great news is that the die image and complexity are both optimized for you to succeed at doing your own reverse engineering.
We have most recently seen [Ken] at work explaining his decapping and reverse engineering process at the Hackaday SuperCon followed soon after by his work on the 8008. That chip is crazy with complexity and a die-ogling noob (like several of us on the Hackaday crew) stands no chance of doing more than simply following along with what he explains. This time around, the 74181 is just right for the curious but not obsessed. Don’t believe me? The 8008 had around 3,500 transistors while the friendly 74181 hosts just 170. We like those odds!
A quick crash course in visually recognizing transistors will have you off to the races. [Ken] also provides reference for more complex devices. But where he really saves the day is in his schematic analysis. See, the traditional ‘textbook’ logic designs have been made faster in this chip and going through his explanation will get you back on track to follow the method behind the die’s madness.
[Ken] took his own photograph of the die. You can see the donor chip above which had its ceramic enclosure shattered with a brisk tap from a sharp chisel.
Every few years, someone on the Internet builds a truly homebrew CPU. Not one built with a 6502, Z80, or a CPU from the 80s, either: one built completely out of 74-series logic chips or discrete transistor. We’re lucky enough to have [Alexander] document his build on Hackaday.io, and even luckier to have him enter it into this year’s Hackaday Prize. It’s an 8-bit computer built completely out of NAND gates.
Computers are just logic, and with enough NAND gates, you can do anything. That’s exactly what [Alex] is doing with this computer. It’s built entirely out of 74F00 chips – a ‘fast’ version of the ubiquitous quad 2-input NAND chip. The architecture of this computer borrows from the best CPUs of the 70s and 80s. The ALU is only four bits, like the Z80, but also uses the 6502 technique where the borrow is an inverted carry. It’s a small instruction set, a 2-stage pipeline, and should be able to compute one million instructions per second.
Designing a CPU is one thing, and thanks to Logisim, this is already done. Constructing a CPU is another matter entirely. For this, [Alex] is going for a module and backplane approach, where the ALU is constructed of a few identical modules tied together into a gigantic motherboard. [Alex] isn’t stopping at a CPU, either: he has a 16-byte ROM that’s programmed by plugging diodes into holes.
It’s an amazingly ambitious project, and for entering this project into the 2016 Hackaday Prize, [Alex] already netted himself $1000 and a trip to the final round of competition.
[Dave] wanted to learn more about the ARM architecture, so he started with an image of the ARMV1 die. If you’ve had some experience looking at CPU die, you can make some pretty good guesses at what parts of the chip have certain functions. [Dave], however, went further. He reverse engineered the entire ALU–about 2,200 transistors worth.
Continue reading “Reverse Engineering the ARM ALU”
Two students at the University of Bristol wanted to create a computer to demonstrate how ALUs work. The result is the TwitALU, a Twitter connected mechanical calculator.
The device uses a custom 7400 series ALU based on the famous MOS 6502 processor. Instead of doing the calculations on a silicon die, the ALU drives mechanical relays. This produces a nice clicky-clacky sound as the calculation is computed.
To start a calculation, you tweet @twittithmetic with your input. A Raspberry Pi is used to load the instructions into the ALU. Once the computation is done, it’s tweeted back to you and displayed on the Nixie tube display. It’s not efficient, or fast, but it does the job of demonstrating the inner workings of the device while doing simple math.
The device’s schematics are all available on the website, and are helpful for understanding how a simple ALU works. After the break, check out a quick clip of the TwitALU in action.
Continue reading “A Twitter Connected Mechanical Calculator”
This is a microscopic photograph of an 8085 processor die. [Ken Shirriff] uses the image in his explanation of how the ALU works. It is only capable of five basic operations: ADD, OR, XOR, AND, and SHIFT-RIGHT. [Ken] mentions that the lack of SHIFT-LEFT is made up for by adding the number to itself which has the effect of multiplying a number by two; the same mathematical function performed by a shift operation.
His post details the gate arrangement for each ALU operation. This is clear and easy to follow, and was based on reverse engineering work already done by a team who meticulously decapped and photographed the dies.
Not long ago this explanation would have been voodoo to us. But we worked our way through The Elements of Computing Systems text-book by following the online Nand to Tetris course. It really demystifies the inner working of a chip like the 8085.
Now if you really want to understand this ALU you’ll build it for yourself inside of Minecraft.
The 6502 was a ubiquitous microprocessor back in the 80s, powering devices such as the Apple II and the Nintendo Entertainment System. [Ken] took an in depth look at a small part of the processor: the overflow circuit.
In order to do signed calculations, a microprocessor’s arithmetic logic unit (ALU) needs to be able to calculate when an overflow occurs. This happens when two numbers are added that cannot fit in a single byte. The result of a calculation will be incorrect, so the processor must inform the program that an overflow has occurred. This is done by setting an overflow flag.
[Ken] uses this example to first explain how the overflow circuit works in logic. He then looks at the gates and a transistor implementation of the logic. Finally, he walks us through the circuit on the actual 6502 die, showing how the circuit is constructed in silicon.
This is a great example to learn a bit more about how ALUs work and how integrated circuits get built.
[TGTTGIT] recently took the plunge and decided to build his own computer using logic chips. He just completed a 4-bit ALU which can compute 18 functions. It took a long time to get the wiring right, but in true geek fashion his build was accompanied by an alternating Chapelle’s Show and Star Trek: TNG marathon playing in the background.
This project is the stepping stone for a larger 16-bit version. The experience of wiring up just this much of it has convinced him that an FPGA is the only way to go for the future of the build. But since he had already ordered the chips it was decided that the only thing to do was to see this much through. He used the truth table from The Elements of Computing Systems for the design and posted several times about the project before arriving at this stopping point so you may be interested in clicking through the other post on his blog. There’s also a lot of other TTL computer projects around here worth checking into.
Continue reading “Breadboarding a 4-bit ALU”