Shape Computation Lab

Unsigned Binary Adder

Tzu-Chieh Kurt Hong


This video shows how an unsigned binary adder can be implemented in DrawScript mode in the Shape Machine. The complete set of symbolic operations is captured here as a shape grammar consisting of 16 shape rules using the shapes 0, 1, C and ___ to perform  the calculation. The addition is done exactly like adding decimal numbers, except that here we have only two digits, 0 and 1. The shape rules calculate the addition of the binary numbers writing the results of any carry to the bottom row. For example, if the Shape Machine sees an 1 which is above another 1 and both above a line ____ , deletes them both, draws a 0 below the line  ___ and puts a C shape below to the next digit as a “carry” symbol to be substituted later by one of the next shape rules. The final result can be up to 5 digits, because the result can be larger than the number 1111. The example here demonstrates the addition of the numbers 11 and 7 in binary, that is, 1011 and 0111. The Shape Machine executes the sequence of shape rules in DrawScript mode and calculates the result equal to 10010, that is, 18.