Tuesday, June 21, 2011

Domino Calculator - Improving the Half Adder

This post is an improvement to the domino half adder discussed in the last post, I suggest you read that first before reading this one.

In the first half adder implementation there was a large amount of dominoes going in many directions and required the use of a bridge to get the logical value of B over to do a logical AND operation.  Since I plan on implementing this in the future the bridge was a bad idea.

When observing the circuit notice that the line from S and the line from Bit A can be used side by side with no bridge nessessary. So lets look a the truth table again and see if we can find another way to find the Carry using Bit A and the Sum.

Bit ABit BSumCarry
0000
0110
1010
1101

Notice that the only time Carry is 1 is when B = 1 and S = 0.  So the logical operation to find the Carry from B and S is: C = B AND ~S (Where ~ is logical NOT). Which creates this circuit diagram.

The circle on the AND gate is the symbol for logical NOT operation.
The downside to this circuit design is that the XOR operation and the AND operation are not performed in parallel, the AND operation must wait for the XOR operation to complete.  However for dominoes this is okay because it eliminates the need to cross over a line.

To implement this new logical circuit we are going to use the same XOR gate implementation, grab the logical value of S(Sum), negate it, and then perform a logical AND operation using the value of bit A. The last iteration of the half adder contained a segment that did a logical AND operation between two bits which looked like this:


Remember that the black dominoes are always a value of 1.  I labeled them V because it is similar to the voltage in a electronic circuit.  This AND implementation takes the logical value from one of the bits and negates it.  Now the AND gate we are trying to build needs one of the inputs negated, so the action of performing the logical NOT is unnecessary.  This leaves us with this implementation:


The time delay is so that the result from the XOR operation can finish before the value of A gets to the gate.  Because the value of S knocks out a block it needs to be done before the value from A gets there.

Next I implement a full adder then a ripple!

Sunday, June 19, 2011

Domino Calculator - The Half Adder

The half adder is a basic logic circuit that does addition between two binary values.  Before we go into the logic to do addition lets shortly go into binary addition.  Binary addition works exactly base 10 (regular) addition just that the base is 2 instead of 10.  That means instead of 0-9 as digits there is only 0 and 1.  One Hundred and One in base 10 can be expressed by a sum of the following 1*10^2 + 1*10 + 1.  Similarly seven can be represented by 1*2^2 + 1*2 + 1 = 7  or 111(base 2).
Addition in base 10 often has carries such as 9+2 = 11 or 1 with carry of 1*10 [10 is the base].  Binary addition does the same thing such as 1 + 1 = 10 (base 2) or 0 with a carry of 1*2 [2 is the base].

So to create binary addition lets make a truth table. For the truth table lets add bit A with bit B, S is the sum and C is the carry.  Bits A and B both have two possible values 0 and 1, so there is a total of 4 possible combinations to add A and B together.

ABSC
0000
0110
1010
1101


By looking at the truth table we can observer that the sum of two bits is the exclusive-or logical operation, and the carry is a logical  AND operation.  This brings us to the logical circuit of what is called a half adder:

Using dominoes I had to find a way to "set" two branches of falling dominoes, where each branch corresponds to a bit and then perform a parallel exclusive-or (XOR) operation and a logical AND.
This is a screenshot of the domino half adder build with around 100 dominoes.  A video is after the explanation.



The red domino is the bit indicator. If it is missing then that bit is a zero.  If present that bit is a 1, and the branch will fall.  The blue domino to the very left starts the chain reaction.  The black dominoes represent energy to be used in logic, its similar to a voltage line.  The yellow block is a bridge so that the B branch can cross over the S (A XOR B) branch.
The XOR operation is pretty simple if both A and B are triggered then they meet together.  If only one branch is triggered then the blocks will fall around and trigger one of the branches leading to the S output.

The AND operation is more complicated.  If A is set then a domino is knocked away from the branch at z.  since z will always be falling because it is from the main power line then the progression of branch at z will be stopped.  If bit A is not set then no domino is knocked away from branch z and it continues to fall.  This is a logical NOT operation.  Because z is always set it the action of stopping the branch or letting it continue will be the logical compliment to the logical value of A.

Looking at the truth table of A AND B will show what should be done next:

AB~A~BA AND B
00110
01100
10010
11001


As can be observed by looking at the truth table with ~A is 1 the value of A AND B does not depend on the value of B.  So by taking out the B branch when ~A=1 (A = 0), it is guaranteed that the logical value of the B branch is 0, which is the correct output of A AND B when A=0.  Also by looking at the truth table it can be seen that when the value of ~A is 0 the output of A AND B is dependent only on the logical value of B.  So when bit A is set ~A becomes a logical 0 and does not knock down anything allowing the output of A AND B becomes B when A=1.

So after all that, here is the video of a Blender simulation...

Saturday, June 18, 2011

Project: Domino Calculator

So as a Sophomore in ECE I learned about adder circuits, circuits that perform addition between two numbers.  We learned the logical basis of what an adders circuit is and how it operates then went over how to build that logic with transistors.  In this case the transistor/electricity was the means of performing the logical operation, however I was always curious if it was possible to use that same logic and instead of using electricity use something else... say dominoes.

Stacking dominoes in a line and watch them fall doesn't really seem like it could produce any logical results, so they were the prefect subject.  The idea of taking a heap of relativity dull objects and arranging them in such a way to produce a logical output drew great parallels to how I imagine it was to be a pioneer of electronics.

I wanted a representation that transcends a logical true/false answer.  I am not building dominoes that only do logical operations, instead they use logical operations to produce a real-world result.  This is done in electronics by using logical circuity to perform boolean algebra.  I aim to replace the logical circuity of transistors with an arrangement of dominoes falling by gravity.  This a different paradigm that will require me to think not only logically, but also spatially.

First Post

This is a spot for me to post absurd project ideas, Progress on said absurd project ideas, and maybe cooking recopies.  Huh, guess we will see how this goes