You know it is possible, but to see it is another thing. The NAND gate is universal and it is all you need to build a computer, but how many NAND gates would it take?
It is one of the great ideas of computing. You only need one type of logic gate to build everything you need for a computer. For example the NAND i.e. Not And gate is universal. By tying its inputs together you get a NOT gate. By applying De Morgan's law you can get an OR gate. That is:
A OR B =NOT(NOT(A) AND NOT(B))
= NOT(A) NAND NOT(B)
as NOT AND is NAND and hence it takes three NAND gates to implement an OR gate, one for each NOT and a NAND.
From here you can build any logic you need. If you cross connect two NAND gates you can construct a flip-flop and hence any registers you need. You can also use the flip-flop as a memory element or an oscillator for timing.
So why not build a complete computer just using NAND gates?
This is what NANDputer is all about. It is adopts a bit serial design simply to save gates - and when you see the circuit boards you will realize that reducing the number of gates is an important consideration. So for example the arithmetic logic unit operates one bit at a time and latches any carry to be used with the next bit. Even with this simpler design it takes two logic boards packed with chips to implement the program counter register:
Notice that the construction is all hand soldered jumper wires - no PCB layout shortcuts here!
The complete machine looks like an impressive computer - something that might turn up on a sci-fi movie:
Currently the beast is being run at 11Mhz but it could go faster.
If you are interested the statistics on gate usage are:
If anything this is a smaller number than you might expect!
Many years ago I designed a VDU using nothing but 74 series chips, simply because someone dropped a box full, that were no longer needed on another project, on my desk. In this case the while thing managed to fit on a single, but large PCB, and the biggest problem was finding enough power to switch it on. At the time production VDUs were a few LSI chips - today the equivalent would be on the corner of a modest chip that mostly does something else.
You can also see the NANDputer in action in the following video:
One of the fun things about being a programmer is that algorithms that you know can often be applied in unexpected ways in areas that are the domain of other specialists. A good example is the traveli [ ... ]