8-bit ALU in 74 Series Logic



From the archives...

This blog post was written for project for an introductory computer science course in my 1st year (May-Jun 2015).


In mid-April 2015, I was working on an assignment for ELEC2141 - Digital Circuits. It turned out to be very interesting, so I set myself the task of going deeper, and finding a way to build the device, run it, and show off the results. Turned out to be very rewarding!

Original (revised) proposal here. 8-bit ALU to be built using 74 series logic ICs, and an Arduino for I/O.

Problems identified at the outset:
Finding a way to simplify the design to make it easier to build
Actually fitting the device onto one prototyping board.
Finding a way to run the ALU with the Arduino. Many extra ports needed.
Solving an issue with output voltage of the 1-bit slice prototype.

A few of those requirements are clarified here.

Firstly, simplifying the design took a bit of research. Turned out the carry out from each slice could be constructed using less gates that I'd originally used. This meant I could go from 4 14-pin DIPs down to 3. I could also share one package between two slices, so I only needed 5 packages for two slices. As can be seen in this picture, there was only just enough space to fit it on with some LEDs showing inputs/outputs.

The issue with output voltage of the 1-bit slice, took some reading of datasheets. I had overlooked the possibility that different logic families wouldn't interact well together. I had mixed HC (high speed CMOS) type chips with LS (Low power Schottky TTL). The LS chips typically only output 3.3-4V HI, compared to bang on 5V for HC. The solution was easy. Just bought replacement HC chips for the relevant parts.

Second update here, I was quickly finding how time consuming it was to wire up such a big circuit. That weekend I found a potential solution to the limited pins on the Arduino. I could use some port expander chips that run an I2C bus interface. WIth these, the Arduino can run hundreds of I/O ports from just two pins.

Third update here. It took a full day to finish wiring it up. The pic above shows where I was up to at this stage. I tested it was working by wiring up some LEDs and simple jumpers that I could switch between ground and 5V (slow process). Ran into a couple of hiccups, like missing a couple of connections to a select line that ate 2 hours trying to find out what was happening.

Fourth update here! After I finally got a chance to sit down with it again, it took a day to work out the I2C interface, and find some extra parts to get it working. Found a strange problem where if I powered the MCP23017 with the bench power supply they didn't work, but powered by the Arduino they were fine. Still can't explain that one. Was really exciting to see it start working and ticking over. The code running on the Arduino was surprisingly simple. Involved individually setting each register address to HI or LO, and some initial setup to wake up the chips. After getting it working, I altered to code to loop and count 0 to 255 on each input. Source code here.

Solving a problem is the best way to learn new skills, and this one taught me a huge amount of stuff. Certainly had to work at it regularly, and it took a whole lot of time out of study, but was totally worth it!

Further improvements to be made include:
Wiring LEDs better so brightness is consistent.
Setting up the Arduino to check whether outputs from the ALU are correct.
Swapping out some messy long jumpers cables for bus cables.

Comments