Binary Digits

dog with 0 1A Binary Digit can only be 0 or 1

Binary Number

A Binary Number is made up Binary Digits.

 binary 110

In the computer world "binary digit" is often shortened to the word "bit"

More Than One Digit

So, there are only two ways we can have a binary digit ("0" and "1", or "On" and "Off") ... but what about 2 or more binary digits?

Let's write them all down, starting with 1 digit (you can test it yourself using the switches):

2 ways to have one digit ...
switch
0
1
... 4 ways to have two digits ...
switchswitch
0000
101
1010
111
... 8 ways to have three digits ...
switchswitchswitch
000000
1001
10010
1011
100100
1101
10110
1111
... and 16 ways to have four digits.
switchswitchswitchswitch
00000000
10001
100010
10011
1000100
10101
100110
10111
10001000
11001
101010
11011
1001100
11101
101110
11111

Here is that last list sideways:

0000000100100011010001010110011110001001101010111100110111101111

And (without the leading 0s) we have the first 16 binary numbers:

Binary:01101110010111011110001001101010111100110111101111
Decimal: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

This is useful! To remember the sequence of binary numbers just think:

At each stage we repeat everything we have so far, but with a 1 in front.

Now find out how to use Binary to count past 1,000 on your fingers:

Activity: Binary Fingers
hex drumsAlso have a Play with different drums.

Binary Digits ... They Double!

Also notice that each time we add another binary digit we double the possible values.

Why double? Because we take all the previous possible values and match them with a "0" and a "1" like above.

Using exponents, this can be shown as:

Number
of Digits
FormulaSettings
1212
2224
3238
42416
52532
62664
etc...etc...etc...

Example: when we have 50 binary digits (or 50 things that can only have two positions each), how many different ways is that?

Answer: 250 = 2 × 2 × 2 × 2 × 2 ... (fifty of these)
= 1,125,899,906,842,624

So, a binary number with 50 digits could have 1,125,899,906,842,624 different values.

Or to put it another way, it could show a number up to 1,125,899,906,842,623 (note: this is one less than the total number of values, because one of the values is 0).

Example: Start the month with $1 and double it every day, after 30 days you will be a billionaire!

230 = 2 × 2 × 2 × 2 ... (thirty of these)
= 1,073,741,824

Chess Board

chess board

There is an old Indian legend about a King who was challenged to a game of chess by a visiting Sage. The King asked "what is the prize if you win?".

The Sage said he would simply like some grains of rice: one on the first square, 2 on the second, 4 on the third and so on, doubling on each square. The King was surprised by this humble request.

Well, the Sage won, so how many grains of rice should he receive?

On the first square: 1 grain, on the second square: 2 grains (for a total of 3) and so on like this:

SquareGrainsTotal
111
223
347
4815
105121,027
20524,288
1,048,575
3053,6870,912
1,073,741,823
64???
???

By the 30th square you can see it is already a lot of rice! A billion grains of rice is about 25 tonnes (1,000 grains is about 25g ... I weighed some!)

Notice that the Total of any square is 1 less than the Grains on the next square (Example: square 3's total is 7, and square 4 has 8 grains). So the total of all squares is a formula: 2n−1, where n is the number of the square. For example, for square 3, the total is 23−1 = 81 = 7

So, to fill all 64 squares in a chess board would need:

264−1 = 18,446,744,073,709,551,615 grains (460 billion tonnes of rice),

many times more rice than in the whole kingdom.

So, the power of binary doubling is nothing to be taken lightly (460 billion tonnes is not light!)


Grains of rice on each square using scientific notation
Values are rounded off, so 53,6870,912 is shown as just 5×108
which means a 5 followed by 8 zeros

(By the way, in the legend the Sage reveals himself to be Lord Krishna and tells the King that he doesn't have to pay the debt at once, but can pay him over time, just serve rice to pilgrims every day until the debt is paid off.)

Hexadecimal

Lastly, let us look at the special relationship between Binary and Hexadecimal.

There are 16 Hexadecimal digits, and we already know that 4 binary digits have 16 possible values. Well, this is exactly how they relate to each other:

Binary:01101110010111011110001001101010111100110111101111
Hexadecimal:0123456789ABCDEF

So, when people use computers (which prefer binary numbers), it is a lot easier to use the single hexadecimal digit rather than 4 binary digits.

For example, the binary number "100110110100" is "9B4" in hexadecimal. I know which I would prefer to write!