Zeckendorf arithmetic
Zeckendorf number representation is described Here. It looks like binary. The purpose of this task is to explore why Babbage et al. may have preferred binary to zeckendorf when designing computers. Here I extended that task by adding an increment and comparison operator. This task will implement addition; subtraction; multiplication; and division using zeckendorf.
Addition.
Like binary 1 + 1 = 10, note carry 1 left. There the similarity ends. 10 + 10 = 101, note carry 1 left and 1 right. 100 + 100 = 1001, note carry 1 left and 2 right, this is the general case.
Occurances of 11 must be changed to 100. Ocurances of 111 may be changed from the right by replacing 11 with 100, or from the left converting 111 to 100 + 100;
Subtraction.
- To be completed.
Multiplication.
- To be completed.
Division.
- To be completed.