# Bits and Bytes. The Binary Numbering System

Bits and bytes, is it difficult? Not at all.

Remember the page on "Basic Computer Operation". There I explained that computers worked with binary or 1's and 0's. This was achieved by the on or off characteristics of electricity.

In this section I will explain a bit more on bits and bytes.

Please people, you don't have to be a expert in this. Just know the basics. The guys that build these machines needs to be experts. We just need to use the computer but it's nice to have basic understanding on how these bits and bytes work.

Computers use binary to represent either True or False values. If the bit is 1, then that's true. If the bit is 0, then that's false.That's all fine and dandy but how can we use binary to represent characters and numbers.

Good question. By grouping 1's and 0's together we can represent up to 256 characters and numbers including uppercase, comma's and so on. It's called the ASCII table or American Standard Code for Information Interchange.

I can just hear you protesting on the other side. What on earth is this ASCII thing. What does it have to do with bits and bytes? It's just an organization that decided how binary would represent characters and numbers. Let me explain.

A bit is only 1 digit. It could be a 1 or 0.

If you group 8 of these bits together you get a byte.

1 or 0 Bit
1010 1010 Byte

It gets down to the bases or base numbers. It's about the bits and bytes. In decimal you can have a maximum of 10 numbers. That means the base is 10. So, every time a number moves to the left it is increased by the power of 10. For example, 1, 10, 100, 1000 and so on.

In binary it works the same but because binary has a base of 2, the number increases by the power of 2. Remember, binary only has two values, 1 or 0. For example 1, 2, 4, 8 and so on.

So from here it's easy. Lets say I want to know what the number 10 would look like in binary. First of all lets write the binary shifted values down. Now, which of those numbers would make 10 if you had to add them together? 8+2=10. So all we do is put 1's underneath 8 and 2 and 0's under the other numbers.

8 4 2 1
1 0 1 0

Let's try one more. How about the number 12.

8 4 2 1
1 1 0 0

8 + 4 = 12

You have just successfully completed decimal to binary conversion. How are you doing with the bits and bytes? Give yourself a pat on the back.

As you can see from the above four bits, you can only represent 16 decimal numbers. That is from 0 - 15 gives you 16.

This is how the first microprocessor worked as well. It was a four bit processor. It could only process 4 bits at a time.

As we all know there are a lot more numbers than 16. So how do we get the rest? Easy we add 4 more bits like so,

128 64 32 16 8 4 2 1

Now we can go to 256 decimal. This is also known as a byte. Later processors, like the Intel 286 CPU could process 8 bits at a time. So, lets say we want to represent the decimal number 40. we would then put 1's underneath 32 and 8 like so,

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

So, 40 would be represented as 0010 1000.

To convert from binary to decimal, we would just reverse the process. Lets say I have the binary number 1000 0110. If we convert to decimal we would just place the 8 4 2 1 notation above the binary number.

 128 64 32 16 8 4 2 1 1 0 0 0 0 1 1 0 = 128+4+2=134

So binary 1000 0110 is decimal 134. We only count the 1's. Remember this.

Now this is fine for decimal numbers like 1, 2, 3 and so on, but what about characters like a, b or c.

That's where the ASCII table comes in. The ASCII table was created to represent characters on a computer cause remember, computers only works with 1's and 0's.

Below is a chart of the ASCII characters up to 127. The first column represents the decimal number of the character and the second column represents the actual character.

For instance the letter A is 65 in decimal. If we convert this to binary it would look like this:

 128 64 32 16 8 4 2 1 0 1 0 0 0 0 0 1 = 64+1=65

So A is 0100 0001

The ASCII table is made up of 1 byte or 8 bits. The previous ASCII table only show the first 128 of the table there are also an extended table that covers from 127 to 255.

Today's computers already operate at 64 bits. This means that today's computers can process 64 of these little bits at a time and 128 bit processors are coming.

But no one really uses the binary system anymore. The reason is that it is time consuming and difficult to read. That's why hexadecimal was created which uses a base of 16.

So the numbering would look like this, 0 1 2 3 4 5 6 7 8 9 A B C D E F.

So, A is actually 10, B is 11, C is 12 and so on. This then takes the big binary numbers and makes them easier to read. For example, binary 1111 would be F in decimal.

Another example is 1100 0010 would be C2. Where on earth do you get that? Let me explain.

A hexadecimal number is comprised of 4 bits. If all the bits are one then you would get a decimal value of 15.

8 4 2 1
1 1 1 1 = 8+4+2+1=15

In Hex notation the are no number 15 cause the base is 16. Remember that hexadecimal is represented by 0 1 2 3 4 5 6 7 8 9 A B C D E F. Where A is 10, B is 11 and so on.

Maybe the following illustration will help.

 0 1 2 3 4 5 6 7 8 9 A B C D E F (Hexadecimal) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 (Decimal)

So, 15 decimal is actually F in hex. Every hex number is represented by 4 bits.

You will always have 8 4 2 1 as a reference. Let's use the C2 example from above. C2 is a hexadecimal number. That means that each digit is 4 bits.

Let's draw the 2 digits separately. C is a hex number and 2 is a hex number. What is C in decimal? Look at the previous illustration. Yes, it's 12.

The digit 2 is in decimal also 2.

Convert 12 and 2 to binary and you will get the binary value.8 4 2 1
1 1 0 0 = 8+4=12

8 4 2 1
0 0 1 0 = 2

C2 = 1100 0010 in binary.

If you're still unsure about this whole bits and bytes thing, then I suggest you read the page again. If you still don't get it, use this cheat sheet.

 0 1 2 3 4 5 6 7 8 9 A B C D E F (Hexadecimal) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 (Decimal)

If you see a hex number like DA, work with each number individually. D is 13 and A is 10 according to the cheat sheet.

Then take the numbers and convert to binary using the 8 4 2 1 notation.

Don't break your head to much on this. Some people don't understand it immediately. Sometimes it takes time to understand bits and bytes.

Work through a couple of examples and see if you understand it.

You don't need to understand bits and bytes in order to work a computer. You will most likely open your word processor software and start typing. The computer does all this bits and bytes stuff in the background.

It's nice though, to know how the computer thinks. I hope you enjoyed this page. We have done some serious stuff here so, take a break and relax. Well done!

Search what-is-my-computer.com  What is my Computer

What is in my computer? Computer Components

Discover what goes into a PC?