Building an ALU From EPROM – The Circuit

When I wrote my blog post about building an ALU from an EPROM, I intended to use an EPROM from my old bag of parts.  Unfortunately, none of my old UV erasable PROMs worked with the programmer.  I’m assuming they are old and not usable.  So I purchased a pair of 28C64’s from Jameco Electronics.  These are Electrically Erasable PROMs, so I don’t need to drag out my UV light and wait 30 minutes (or so) for them to erase before reprogramming them.

After I programmed the EEPROM, I had to make a diagram of the pins.  The pinout for the memory chip is organized by address lines and data lines and I’m pretending that the address lines are inputs and the data lines are just outputs (technically they are bi-directional).  Here’s a diagram of what I ended up with:

Technically, I can re-arrage the pins by reprogramming the data and pretending that pins 21, 23-25 are carry in and the function selectors.  Then all the A0-A3 and B0-B3 could be arranged on the left side of the chip.  It really only matters if you are concerned about circuit board layout.  At the moment, I just want to show that it can be done.

Next, I decided to use my 7-segment hex display driver with a 7-segment display to show the output from F0-F3.  This took a bit of extra wiring, but it’s easier to read than 4 LED lights.  Here’s the chip pinout using the GAL16V8 from this blog post (click here):

All that is needed is a breadboard, resistors, a 7-segment display, and a bunch of wires.  This is my quick-and-dirty circuit:

For this circuit, I set S0-S2 to the ADD mode (S0=H, S1=H, S2=L).  The small chip in the lower right is the GAL that I programmed in an earlier article.  I also set the carry-in as H (represents zero) and set A0 and B0 to H, with all other An and Bn to L.  As you can see 1 + 1 = 2.

One of the reasons I’m demonstrating this idea of using a ROM to represent a circuit is that a simple logical circuit can be temporarily represented as a memory chip.  Then a real circuit can be designed to be substituted.  I have not tested all possible inputs and outputs of this circuit and, more importantly, I have not tested the limits of the speed that this circuit would operate it.  I already know that the answer to my speed question is going to be “disappointingly slow”.

Purpose

Knowing that this will be a slow circuit, what’s the purpose?  The first purpose would be to create a prototype of a circuit that you plan to build.  If you’re building a machine that will require some programming, then it might be best to create a slow version of the machine so another programmer can create and test the software before the machine is complete.

This type of circuit design can also be used for educational purposes.  You can prepare EEPROMs with the circuits you’ll need for class instruction to support your lecture.  The EEPROM represents a black box of the circuit that your class can use without actually building a complete circuit.  In this instance an ALU.  The circuit could then be reprogrammed for a different purpose in a future lecture.

Leave a Reply