Vocademy

Bits and Binary Numbers

Bits 

Today, with binary-coded information common, we have nomenclature for the methods used to encode such information.

In the case of Roman signaling, each flag could be in one of two states: up or down. With Robert Neuman's lanterns, each lantern could be in one of two states: on or off. The modern name for one of these one-of-two pieces of information is a bit[1]. Anything that can have one of two discrete states can carry one bit of information: a flag, a lantern, an electric light, fingers (up or down), etc. The meaning of a bit of information can be anything that two people agree upon: yes/no, true/false, on/off, up/down, by land/by sea, etc.

Binary Numbers

Binary information can be represented by switches that are on or off. It can also be represented by capacitors that are charged or discharged or a voltage that is one voltage or another. The state of a bit may depend on when a voltage changes rather than the voltage level. The method of storing binary information usually changes from one way to another several times as it moves through a system. Using terms like on and off, five volts, and zero volts, charged or discharged becomes cumbersome. Using our common Arabic numerals, 1 and 0, a new number system called the binary number system was invented to communicate the states of binary devices. We humans find it a lot easier to keep track of what's happening if we imagine the information as binary numbers. This way, the actual mechanism does not have to be known, only the information that is conveyed by the mechanism. Here is a char of the first 16 decimal numbers (starting with zero) with their four-bit binary equivalents.

0 0000   8 1000
1 0001   9 1001
2 0010   10 1010
3 0011   11 1011
4 0100   12 1100
5 0101   13 1101
6 0110   14 1110
7 0111   15 1111
First 16 binary numbers (0 - 15)

There are no binary numbers in computers

One thing that tends to confuse people who are not technically savvy is that they don't understand how computers can have numbers in them. Keep in mind that computers don't use binary numbers. Binary numbers are a human thing. Computers are machines with many mechanisms that can hold or convey binary information (transistors, capacitors, etc.), but there are no numbers in a computer. A transistor can be conducting or not conducting (on or off), capacitors can be charged or discharged, but these are just states of the devices. People use binary numbers to express these states to other people. The binary number system is simply a shorthand for the states of the mechanisms.

Here is an example of how binary numbers can model a binary mechanism. With the Roman signaling, let's assign the number zero to "flag down", and the number one to "flag up." With this code, three flags up and two flags down would be represented by 11100. If you had to write down the states of the flags, which would you rather write, up, up, up, down, down, or 11100? There is no question. Using binary digits is much easier.


01000001

 
Here are the roman flags used to represent binary numbers. Flag-down is 0 and flag-up is 1.

Here is our ASCII code chart using binary numbers.



0000

0001

0010

0011

0100

0101

0110

0000



space

0

@

P

`

0001



!

1

A

Q

a

0010



"

2

B

R

b

0011



#

3

C

S

c

0100



$

4

D

T

d

0101



%

5

E

U

e

Now the table encodes the ASCII code with binary numbers.

Which would you rather use? We are already familiar with Arabic numerals, so we don't need to learn a new set of symbols.

Binary Bits

Any mechanism that has two possible states can carry one bit of information. Therefore, a single binary digit can carry one bit of information.

Binary Numbers as Numbers

Binary numbers can also carry numeric information just as decimal numbers. First, let's look at our familiar decimal numerals.

0
1
2
3
4
5
6
7
The Arabic numerals zero through nine

With these numerals, we can represent the quantities of none through nine. What if we need a greater quantity? We just start counting by tens. You know the drill, but let's review a little fifth-grade math to refresh our memories. For example, let's say you need to count to 23. When you count the tenth item, you add one to your tens count.

Tens  Ones 
1 0

We just counted ten items, so we add 1 to the tens count, andzero out the ones count. We just made the number 10 (1 ten and 0 ones).

Now we continue counting. When we reach 10 again, our 20th item, we add another to the tens count.

Tens  Ones 
2 0

We just counted our 20th item, so we add another 1 to the tens count, andzero out the ones count.

Now we add our last three items to the ones count.

Tens  Ones 
2 3

We add our last three items to the ones count, and we have the number 23.

Now let's count our 23 items using binary numbers. Here we go...

1

Well, that didn't get us very far, just 1. What do we do next? We do the same thing we did when we ran out of digits with the decimal system. We zero out the ones, andadd one to the...

  ?    Ones 
0 1

What's the name of the next column in binary?

We need a name for the next column. In decimal, where we have ten digits, we call it the tens. In binary, we have two digits, so let's call it the twos.

Twos  Ones 
0 1

Let's call it the twos

Now let's continue counting. We just counted 1, so for our next item, we zero out the ones and add 1 to the twos count.

Twos  Ones 
1 0

Here are two items in binary.

It looks like we discovered the number 10 again, but did we? We can't call this ten because that represents ten items. Let's not try to invent a new name for this number because that opens a big can of worms. We will have to find names for the numbers in every number system we deal with (and we deal with at least four working with computers). Let's just call it one zero. Now we can represent a count of two with the binary number 10.

That's one-zero, not ten

Let's keep going. For our third item, we add one to the ones count.

Twos  Ones 
1 1

Three items represented in binary.

Moving on, what do we do when we get to the fourth item? We do the same thing we do when counting in decimal, when we reach 99, andhave to add one more. We create another column. In decimal, we call that column the hundreds.

Hundreds Tens  Ones 
1 0 0

What we do in decimal when we add 1 to 99.

Notice that in decimal, each column is 10 times the value of the column to the right. What do we do in binary? You guessed it. Each column is two times the value of the column to the right. When we add 1 to 11, we zero out the ones and the twos, andadd 1 to the Fours.

Fours Twos  Ones 
1 0 0

Four items represented in binary.

Is that the number one-hundred? No. It's the binary number one-zero-zero, which represents a count of four in decimal.

Now we can count as many as seven items before we run out of columns. Seven items would be represented as 111. What do we do with our eighth item? Add an eights column, of course.

Eights Fours Twos  Ones 
1 0 0 0

Eight items represented in binary.

So, eight in binary is 1000. Is that one-thousand? I think you know the answer to that. What about eleven items. What combination of eight and four and two and one adds up to eleven? That would be 8 plus 2 plus 1 (8+2+1 = 11). That would put a 1 in the eights column, and1 in the twos column, and 1 in the ones column. Like this:

Eights Fours Twos  Ones 
1 0 1 1

Eleven items represented in binary.

Eleven is represented by 1011 in binary. Isn't that easy? Well, it's easy for computers. It is easy to represent binary numbers in binary systems. That is why people use binary numbers when dealing with computers. It is trivial[2] to convert between decimal, andbinary by computer, so why not just use binary to represent numbers?

This is often called the 8421 code. Can you guess why? We can continue this format to the left with as many columns as needed. We can represent a quantity as high as 255 with eight bits. The leftmost column, the most significant bit (MSB), has a "weight" of 128. The next column to the right has half that weight, or 64. Here are eight columns with their bit weights written above.

128   64   32   16   8     4     2     1  
1 0 0 1 1 0 1 1

Eight bits of binary with the column or bit weights above each column

Can you calculate the decimal number represented by the bits in the chart above? It's 128+16+8+2+1, which is 155.

 

—————————
1The term ''bit'', as an alternative to ''binary digit'', first appeared in a memo written by a Bell Labs engineer named John Tukey.
2''Trivial'' is nerd speak for easy.
Vocademy