##### Intro

What’s all this talk about bits and bytes? Why do hard drive manufacturers measure by the unit of bytes, while telecommunication companies opt for the unit of bits?

In Computer Science, a bit is the smallest unit of value representing either a 1 or 0. An octet of bits are used to convert to a human readable character. Hence, 1 character on a Western keyboard takes 1 byte to store. Some of the other common values are:

Tiny Int = 1 Byte ( -128 to 127)

Int = 4 Bytes (-2147483648 to 2147483647)

##### Storage and Memory

At the junction of mathematics and computer science, A **K****ilo** is defined two to the tenth power, 2^{10}. Therefore, 1 **kilobyte** (KB) is 2^{10}, **or** 1,024 bytes; 1 **megabyte** (MB) is 2^{20}, **or **1,048,576 bytes. The correct way to express these units is by using capital letters (KB, MB, GB, TB, etc.). Hence, the “power of two” or 2^{10} is used to represent a byte in storage measurements. An ascension from byte to Megabyte is by a factor of 2^{10} or 1024, not 1000 as compared to bits to megabits. Microsoft file size and storage calculations are based on this math. and its generalized conversion table resembles this:

**Kibi**byte = 1024 bytes or 8192 (8 x 1024) bits

**Mebi**byte = 1024 Kibibytes or 1,048,576 (1024 x 1024) bytes or 8,388,608 bits

**Gibi**byte = 1024 Mebibytes or 1,073,741,824 bytes or 8,589,934,592 bits

**Tebi**byte = 1024 Gibibytes or 1,099,511,627,776 bytes or 8,796,093,022,208 bits

Sample Calculations:

512 kbps / 8 = 64,000 bytes

64,000 bytes / 1,024 = 62.5 Kibibytes/s or KB/s

Do you notice anything confusing about the table above in correspondence to its preceding paragraph? Yes, I’ve switched terms such as Kilobytes to Kibibytes. That is because the original usage of the metric prefix to describe storage has been improper. Unfortunately, this has become the prevalent expression. Thus, big guys such as the International Electrotechnical Commission (IEC) have come up with words such as Kibibytes, Megibyte, and Gibibytes to distinguish between the two types of measurements. Until this day, marketers still use Gigabytes to sell hard drives, while Microsoft still measures in Gigibytes. If memory and hard drive distributors are honest, 1 TB should be labeled a 931 GB instead.

##### Transfer Speed

Communication transfers at the wire is done as transmission of 1’s and 0’s. Hence, the standard unit of measurement telecommunication is calculated as bits, instead of bytes. Bits are being counted similarly to a metric system (e.g. millimeter, centimeter, meter, kilometer). Each ascension is to a factor of 1000. Hence:

bits per second (bps) = 1 bit/s

Kilobits per second (Kbps) = 1000 bits/s

Mbps = 1000 Kbits/s or 1,000,000 bits/s

Gbps = 1000 Mbit/s or 1,000,000,000 bits/s

Tbps = 1000 Gbit/s or 1,000,000,000,000 bits/s

100 mbps = 12.5 MB/s

1000 mbps = 125 MB/s

Let us do some practical math:

Suppose you would like to download a file with the size of 640 Mebibytes (MBs). The factor to convert from Mebibytes to Kibibytes is via a multiplier of 1024. Hence 640 MBs x 1024 KB/MB = 655,360 Kibibytes, which will then converts 671,088,640 bytes. There are 8 bits in each byte; thus, 671,088,640 bytes x 8 bits/byte = 5,368,709,120 bits.

Now, if your Internet speed is 1 megabits per second or Mbps, you will download at 1,000,000 bits per second. It will then take 5368.71 seconds to finish with downloading the file. Divide that by 60, the result is 89.48 minutes.

On the same token, 1 MBps consists of eight times more bandwidth than 1 Mbps. The same file above would have taken 11.185 minutes to download. The only difference here is “MB” vs “Mb.” Here is a quick list of comparable items between the transfer speed of internal storage versus Ethernet connections.

SATA I: 1.5 Gb/s => 150 MB/s => 1200 mbps (1.2 gigabits connection)

SATA II: 3.0 Gb/s => 300 MB/s => 2400 mbps (2.4 gigabits connection)

SATA III: 6.0 Gb/s => 600 MB/s => 4800 mbps (4.8 gigabits connection)

##### Summary

To be precise in writing, a byte should be expressed using an uppercase ‘B’, and a bit is a lowercase ‘b’. Better yet, put the ‘i’ in the middle to avoid confusion. Thus, ‘MiB’ will mean Mebibyte or 1024 Kibibytes (KiB). That is in contrast with ‘Mb’, ‘mb’ or megabit. Therefore, a KiB is way more more than a Kb or kb, etc. What about those guys on Amazon and Ebay selling Samsung SSDs? They sell “Terabytes” or “TB” things that really should be marked as “terabits” or “tb”. All we can do is to do the reverse conversion in our minds and accept that life is full of these anomalies.