A 4-Bit Adder Made Of Cardboard!
Written by Mike James   
Sunday, 11 December 2016

Even if you know it, the fact that computation can be achieved in an amazing range of different ways still comes as a surprise. Programmer lapinozz decided to prove the point by building a full adder using cardboard, marbles and hot glue. 

You can see the full project on lapinozz's website, but it is worth a few words of explanation first. 

A half adder takes two input bits and produces a sum and a carry. The logic table for a half adder is

  b1 b2   Sum Carry
0  0    0   0
0  1    1   0
1  0    1   0
1  1    0   1

You can see that the Sum is just

b1 XOR b2

and Carry is

b1 AND b2

What this means is that you can add two bits together if you can implement an AND gate and an XOR gate. This is the beauty of working in binary, it reduces arithmetic to logic. 

 

halfadd

However, a half adder isn't enough because you might have a carry from the previous bit position to add in. You can build a full adder from two half adders and this is the way most people choose to implement a full adder:  

fulladd

b1 b2 C   Sum Carry
0  0  0   0   0
0  1  0   1   0
1  0  0   1   0
1  1  0   0   1

0  0  1   1   0
0  1  1   0   1
1  0  1   0   1
1  1  1   1   1

The problem is that it would have needed a lot of cardboard cutting to create a machine that adds marbles together. The solution is to notice that in terms of what marbles have to do a full adder can be described more easily:

  • If the input is one marble then it has to drop into the first output
  • If the input is two marbles then just one of them has to drop into the second output
  • If the input is three marbles then exactly two of them have to drop into both outputs. 

Put like this all we need is a gate that does different things for one, two and three marbles. This can be created with a modification of a single half adder. While this is simpler it still looks complicated to me, but it sort of works and it is possible to implement the addition of four bits:

marbleadder

You put the marbles in at the top - a marble for a one and no marble for a zero and you put two rows of four marbles to represent the two binary numbers you want to add. You then remove a piece of cardboard and let them fall to the bottom. Some of the marbles are retained in the machine but the ones that get through are the result - a single 5-bit value. Of course, it doesn't always work as the marbles bounce and don't fall at the same rate, but if you repeat you do get the answer some of the time. 

For the fine detail and some nice animated GIFs of the marbles going though the gates visit lapinozz's website.

There have been marble-based computers before, but the marbles simply changed the state of levers which represented the state of the system. This particular machine uses gates to work with the marbles representing the numbers and does it in a word-parallel, bit-serial way. That is, it is the fact that one marble follows another that makes the behavior different for one and two marbles. For example, consider the simple AND gate:

AND-2

 

The two bits arrive one after the other. If there is only one bit then nothing comes out. You only get an output if the cup is filled by the first marble and the second marble rolls across it. 

More Information

lapinozz's website

Related Articles

The Trick Of The Mind - Turing Complete

Introduction to Boolean Logic 

Binary Arithmetic 

Sliding Blocks Are Turing Complete 

Stanford Engineers Build A Water Droplet Based Computer 

A Water Droplet-Based Computer 

A Crab-Based Computer 

The Machine In The Ghost 

The Working Programmer's Guide To Language Paradigms 

Knitting Is Turing Complete? 

What is a Turing Machine?

The Computing Universe 

Non-computable numbers 

What Is Computable? 

The Post Production Problem 

Pulleys As Logic Gates 

Slime mould simulates Canadian transport system 

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on, Twitter, Facebook or Linkedin.

 

Banner


Raiders Of The Lost Art
21/09/2019

Don't blame me for the title - it's the title of the research paper! Can we recover lost paintings using a little AI? The answer seems to be yes, but it really all depends what you mean by "recover".

 [ ... ]



Atlas the Gymnast, Spot the Quadruped
28/09/2019

It's been quiet at Boston Dynamics for too long. Atlas breaks the silence as Spot becomes available to buy. Don't miss seeing what Atlas can now do - it could be scary.


More News

graphics

 



 

Comments




or email your comment to: comments@i-programmer.info

 

Last Updated ( Friday, 18 January 2019 )