Bits and Bytes

What are Bits exactly and why is it important to understand how they relate to Bytes?

 

I think everyone I’ve spoken to has had issues understanding data sizes and what they mean.  Part of the problem is that not everyone means the same thing with the same wording.  The linguistic confusion is similar to “ton” meaning 2,000 lbs in the US, but 2,240 lbs in the UK.

 

So we’re going to get a bit technical here and I can’t do this without going into a lot of math – but at least it’s basic arithmetic.  First, I want to briefly explain what bits actually are.

 

Think of a light switch.   Only two possible messages can be communicated with that single light switch – either off or on (represented by the numbers 0 and 1 respectively).   But if you added another light switch, you could double the possible messages you could send.

 

0 means “OFF” and 1 means “ON”

1 switch = 2 possible choices 0,1  (off or on)

2 switches = 4 possible patterns 00, 01, 10, 11  (off-off,  off-on,  on-off, on-on)

3 switches = 8 patterns patterns 000, 001, 010, 011, 100, 101, 110, 111

 

Every time you add another light switch, you double the number of possible combinations of OFF and On.  At the core of every computer are billions of circuits that function very similar to a light switch.  There is either electricity flowing through the circuit, or there is not.  The trillions and trillions of combinations of these On/Off circuits are what result in your reading this right now.

 

However, if you wanted to count all the circuits manually (assuming you had very good eyes and a few hundred years to spare), you would count them using our base 10 numbering system.  In base 10, the number pattern resets itself after 10 increments.  You know 10, 20, 30…    They all use the same 10 digits 0-9.   Every time you add a zero, it is the equivalent of multiplying the previous number by ten.

 

1

10

100

1000

 

i.e.  ones place, tens place, hundreds place, etc. Add a zero, and you multiply by ten again to get the thousands place.

 

No Duh, you say?  Pretty simple even though I used a lot of words to explain something you already know.  But if you’ve never used a different base numbering system, then it can get confusing very quickly.  In a base 2 numbering system, or binary, every time you add a digit, you only double your number.  So in base 2 the pattern resets every 2 digits instead of every 10.

 

Base 2 Base 10

0 = 0

1 = 1

10 = 2

11 = 3

100 = 4

101 = 5

110 = 6

111 = 7

1000 = 8

1001 = 9

1010 = 10

 

To count by multiples of tens is easy:

10, 20, 30, 40, 50, 60…

 

But counting by multiples of 2 is a little odd:

2, 4 ,8 ,16, 32, 64, 128, 256, 512, 1024, 2048…

(notice that the far right digit is stuck in a never-ending loop of 2,4,8,6)

 

 

So why is this all relevant?

Now that you have a basic idea of what a bit is (a circuit), and what it means to count by binary, it’s time to get really confusing.

 

Unfortunately, we measure file sizes in Bytes instead of bits.  The term “Byte” is a common arbitrary grouping of eight bits.  It didn’t have to be 8 (and it some systems it’s not), but we use 8-bits because of the origins of computer technology and how it related to the number of possible keys on a keyboard.   We probably should have never gotten into the habit of using this grouping system, but we’re stuck with it for now.

 

When you group 8 bits (or light switches if it helps to maintain that analogy), you would have 256 possible  ON/Off patterns.

 

Now the problem.   We use Kilo, Mega, and Giga, which are Latin prefixes for a base 10 numbering system.  The two systems do not play well together.   When we get to file sizes in the Gigabyte and Terabyte range, then that small difference is HUGE.

 

1 Byte         (8 bits)

1 KB = 1,024 Bytes (8,192 bits)

1 MB = 1,024 KB               (8,388,608 bits)

1 GB = 1,024 MB       (8,589,934,592 bits)

1 TB = 1,024 GB (8,796,093,022,208 bits)

 

You can see that when we get to a Terabyte, we don’t have exactly 1 trillion Bytes or 8 trillion bits, we’re short by 1.3 trillion bits.  Although our national debt makes us get used to such a number, it’s unimaginably huge!

 

Side note:  If you were to count as fast as you can (assuming you can count to ten in just a second), and were to count that fast nonstop 24 hours a day 365 days a year, then it would take ten years just to get to 3.1 billion.    To get to a trillion would take over 3,000 years!  Remember, that’s if you can count ten numbers every second.  If you were to count by seconds… meaning you count only to sixty in one minute, then it would take you 31,710 years!

(Think about that the next time you hear about the government spending ONLY a trillion dollars or a mere few hundred billion)

 

Believe it or not, there is a practical reason for understanding all of that.  It relates to data streaming and file storage.  If you have a smart phone with limited data usage, then this applies to you somewhat.  Additionally, if you want videos to stream online – whether watching the videos, or creating the videos yourself, you have some important factors to consider.  Click to read about data streams.  KB vs Kb