Binary Addition Machine

You will now construct your own binary addition machine. Check this one to start:

Building blocks:

1. First mouse click: Choose two random binary numbers number1 and number2 with digits number1[i] and number2[i]:

for (var i = 0; i < I-1; i++) {
number1[i] = floor(2*random());
number2[i] = floor(2*random());

2. Second mouse click: Add number1 to number2 digit by digit:

for (var i = 0; i<I-1; i++) {
sum[i]=number1[i] + number2[i];

3. Continued mouse clicks: Reduce to binary representation digit by digit:

if (sum[N]>1){

4. Activate mouse click:

function mousePressed(){

Continue by checking this adding machine .