Units

From Linux 101, The beginner's guide to all things Linux.

Jump to: navigation, search

Bits are the most basic unit of modern computing. They can only store two values, 0 or 1. Sometimes these values are refered to as on/off, true/false, etc.

A group of 8 bits makes a byte. The reason we use 8 is because we need 28 (256) combinations to create enough unique values (0 to 255) to express our alphabet and related characters. 8 is also an excellent choice because it is a power of 2 (23 = 8).

Because modern computing has so many vast resources, we also have prefixes to add to bits and bytes to help express larger sizes.

Kilo- or K- = 210 =             1,024
Mega- or M- = 220 =         1,048,576
Giga- or G- = 230 =     1,073,741,824
Tera- or T- = 240 = 1,099,511,627,776

So if a file says it is 64 Kilobytes, then using the following math, we can determine how many bytes it really is:

64 Kilobytes = 64 KB = 64 * 1024 Bytes = 26 * 210 Bytes = 216 Bytes = 65536 Bytes
128 Megabits = 128 Mb = 128 * 220 bits = 27 * 220 bits = 227 = 134217728 bits

You may now recognize a few important things about simple computer units:

  • Using base-2 math it can be very easy to simplify.
  • A capital B is used as shorthand for Bytes.
  • A lower case b is used as shorthand for bits.

It is very uncommon to see units involving bits during daily usage. Some programs use them to show transfer speeds to make the transfer appear faster, but really it makes no difference. They are uncommon because your computer is byte-addressable which means the smallest unit it can grab from memory or hard drive, etc is a byte. Since it is the smallest tangible piece, it seems more useful to use this unit.

Personal tools