The B4 Computer Processor Kit and the B4 Primary School Starter Kit come with a 4-bit adder module. This allows us to add numbers as long as the sum is not larger than 15. But what if we want to add larger numbers, such as one billion, or a trillion?
For this, we can daisy-chain multiple adder modules and connect the carry-out bit of one adder with the carry-in of the next adder. With this in mind, we have tried an experiment in class and connected 16 adders! And since 16x4=64, we have built a 64-bit adder, just like the adder in a modern microprocessor.
16 adders is a whole class set, but this works as well with just two adders to get started. But with our 16 adders, we can most definitely add 1 billion plus 1 trillion.
The numbers are set with manual programmers, which we have connected to the adder modules. The top row of manual programmers represents the first number and the bottom row the second number.
We have converted decimal to binary here and set the manual programmers accordingly.
1 billion is 111011100110101100101000000000 in binary
1 trillion is 1110100011010100101001010001000000000000 in binary.
The result is 10010001100010001010000011010110101000000000
This is a 'small' 44-bit number. We haven't even used the full 64 bits :-)
So, what's the learning here? Adding small numbers or big numbers is conceptually the same thing for a computer. Once you manage to add 2 bits and manage the carryover, you can add arbitrarily large numbers.
Anyone for 128bit?
In this tutorial, we explore how a computer adds numbers. We start by taking a look inside the adder, which we have re-constructed using relays. These are electromechanical switches. We explore how the switches form logical components and how they are interconnected to form an adder. Because relays are slow and make clicking sounds, we can both see and hear our adder computing. Enjoy!
In this tutorial, we are building a simple 4-bit computer capable of addition, subtraction, data retrieval and data storage. We learn how to arrange the boards and connect them with power, data and control wires.
We program the B4 by entering data into the Data RAM and control instructions (the program code) into the Program RAM. For both, we use the Manual Programmer.
Step by step, we then walk through the code and observe how it operates inside the machine.