One of the things that every student of digital electronics learns, is that every single logic function can be made from a combination of NAND gates. But nobody is foolhardy enough to give it a try, after all that would require a truly huge number of gates!

Someone evidently forgot to tell [Notbookies], for he has made a complete 8-bit ALU using only 4011B quad NAND gates on a set of breadboards, and in doing so has created a minor masterpiece with his wiring. It’s inspired by a series of videos from [Ben Eater] describing the construction of a computer with the so-called SAP (Simple As Possible) architecture. The 48 4011B DIP packages sit upon 8 standard breadboards, with an extra one for a set of DIP switches and LEDs, and a set of power busbar breadboards up their sides. He leaves us with the advice borne of bitter experience: “*Unless your goal is building a NAND-only computer, pick the best IC for the job*“.

We have covered countless processors and processor components manufactured from discrete logic chips over the years, though this makes them no less impressive a feat. The NedoNAND has been a recent example, a modular PCB-based design. TTL and CMOS logic chips made their debut over 50 years ago so you might expect there to be nothing new from that direction, however we expect this to be well of projects that will keep flowing for may years more.

Via /r/electronics/.

An ALU is an interesting piece of circuitry. But I am though curious to what bit wise functions this one is implementing.

Since there is no formal definition in the industry of what is required for a circuit to be an ALU, it could be an adder and a selectable AND gate and it would likely count as an ALU as far as I know.

But I guess most people would also like to see OR, Not, and maybe an XOR function as well. And likely some bit shifting too.

My guess is just selectable add and subtract with configurations or ways of interpreting the outputs for signed and unsigned. I’m mostly going off the minimum of parts I’ve seen use the ALU schematic symbol.

Which appears to be about right. There is the following line in the article: “My ALU is about as simple as one can be as it can only add and subtract 8 bit numbers, but as we’ll see even this is pretty complicated when you are doing it with quad-NAND gates.”

Since this ain’t Slashdot, I dared to go to TFA. Quoth:

“My ALU is about as simple as one can be as it can only add and subtract 8 bit numbers […]”.

A look at the diagram:

https://hobbyundecided.wordpress.com/2018/01/28/an-8-bit-alu-made-entirely-out-of-nand-gates/#design

shows one pin labeled “SUB”.

(Don’t tell The Slashdot I did this :)

RTFP. He talks about adding and subtracting, and the schematic shows only one control bit and not even a carry-in. So there are 0 bit-wise functions built in.

Dont forget my whole computer entirely from nand gates : https://hackaday.io/project/28605-the-nand-565-a-computer-programmed-by-leds :-).

Very cool.

Great job, Olivier :D

$20 binge on ebay china it is

If you look at the full sized image of the breadboarded ALU:

https://hobbyundecided.files.wordpress.com/2018/01/alu.jpg

you’ll see that he is using what looks like two pin 0.1″ headers to connect adjacent pins on the ICs, the headers inserted upside down with the longer pins bent together and soldered providing the connectivity and something to grab to place and remove the shorts. A great idea I’ve never seen before.

Thanks. They’re actually inserted long side down – I bent the short side together with some pliers.

He uses those headers to make an inverter from a 2in NAND. He could have saved a lot of chips if he had used XOR gates like a 7486.

He could have even saved more chips if he used an tiny AVR.

What’s your point?

This certainly isn’t an ALU – it’s an adder/subtractor, which is somewhat simpler than an ALU. To be an ALU it would, in my opinion, need to do at least AND and OR as well.

While all projects of this king are interesting building computers from a single type of logic element isn’t new. The best know computer using a single logic element was the Apollo Guidance Computer which was made from 3-input NOR gates.

It does some arithmetic it’s based on logic IC’s when all mashed together on a bread board it has created a unit has all the signs of an ALU. do the wires have to dance ?

An ALU needs to contain (at a minimum) Add, Nand.

With Nand we can invert an input, since

~(a&1) = ~a.

Thus, subtraction: a-b = a+~(b&1)+1 is then possible.

And = ~( ~(a&b) &1).

Or = ~( ~(a&1) & ~(b&1)).

XOR = (a+b)-2(a&b) = (a+b)+2*~(a&b)+1.

The 2 bit adder I built for class pales in relation to this!

absolutely love builds like this, you can learn so much,