Counting in binary

Both the individual RAM modules and the CPU registers have several bits that work as binary counters. Each position has an associated number (1, 2, 4 and 8 in 4-bit registers).

If all the bits of a register are switched off, the value zero is stored. See Fig. 1.

../_images/binary_0.png

Fig. 1 Representation of zero.

If there are any switched-on bits, you have to add the numbers placed on the top of the CPU. This will be the value stored in that register. See, for example, Fig. 2 and Fig. 3.

../_images/binary_3.png

Fig. 2 Representation of decimal number 3. Positions 1 and 2 are switched on, so \(1 + 2 = 3\).

../_images/binary_9.png

Fig. 3 Representation of decimal number 9. Positions 1 and 8 are switched on, so \(1 + 8 = 9\).