1Learning Outcomes¶
Use base-10 prefixes to characterize powers of ten.
Use binary prefixes to characterize powers of two.
Get comfortable with mathematics involving powers of two.
🎥 Lecture Video
It is unwieldy to use numbers like 4,294,967,296 to describe the 232 bytes of address space on 32-bit architectures. Instead, we much prefer terminology like 2 GiB (“gibibytes”).
This short reference introduces prefixes for numbers in powers of ten and two This terminology helps us describe quantites, from sizes of caches and hard drives to network transmission rates.
1.1Base-10 Prefixes¶
We will find it very convenient to use prefixes like “kilo”, “giga”, etc. to refer to large base-10 numbers. Table 1 describes the base-10 prefixes commonly used in this class.
Table 1:Base-10 prefixes for numbers.
| Prefix | Abbreviation | Power | Value |
|---|---|---|---|
| Kilo | K | 103 | 1,000 |
| Mega | M | 106 | 1,000,000 |
| Giga | G | 109 | 1,000,000,000 |
| Tera | T | 1012 | 1,000,000,000,000 |
| Peta | P | 1015 | 1,000,000,000,000,000 |
| Exa | E | 1018 | 1,000,000,000,000,000,000 |
| Zetta | Z | 1021 | 1,000,000,000,000,000,000,000 |
| Yotta | Y | 1024 | 1,000,000,000,000,000,000,000,000 |
The abbreviations are then used as prefixes to units: 4 KB (four kilobytes), 10 Mbps (ten megabits per second), etc.
These “Common-use prefixes” are close to those used by SI (the International System of Units), with the exception of “kilo” (which is lowercase “k” in SI but uppercase “K” in computing).
Show answer
4,000 bytes. 4 KB = B
2Binary prefixes¶
The IEC (International Electrotechnical Commission) defined binary prefixes like “kibi”, “mebi”, etc., to describe large binary numbers. Table 2 describes the binary prefixes commonly used in this class.
Table 2:Binary (IEC) prefixes for numbers.
| Prefix | Abbreviation | Power | Numeric Value |
|---|---|---|---|
| Kibi | Ki | 210 | 1,024 |
| Mebi | Mi | 220 | 1,048,576 |
| Gibi | Gi | 230 | 1,073,741,824 |
| Tebi | Ti | 240 | 1,099,511,627,776 |
| Pebi | Pi | 250 | 1,125,899,906,842,624 |
| Exbi | Ei | 260 | 1,152,921,504,606,846,976 |
| Zebi | Zi | 270 | 1,180,591,620,717,411,303,424 |
| Yobi | Yi | 280 | 1,208,925,819,614,629,174,706,176 |
Like before, abbreviations can be used as prefixes to units: 4 GiB (four gibi-bytes, pronounced “ghee-bee”). The “bi” in each prefix likely stands for binary but is pronounced “bee.”
Show answer
4,096 bytes. 4 KiB = B
3Get familiar with conversions¶
At small numbers, base-two and base-ten are comparable because one thousand (kilo, 103) is close to 1,024 (kibi, 210). This 2.4% difference compounds exponentially, with the binary prefix always indicating larger numbers than its base-ten counterpart.[1].
In any case, to remember which binary prefixes correspond to which base-ten prefixes, we recommend remembering the approximation:
Show answer
234 B is 16 GiB.
Knowing your prefix conversions helps identify the amount of memory or storage you will need for a particular application.
Show Answer
2.5 TiB is:
The total number of bits we need is the sum of the following:
40 bits, to address bytes within each tibibyte chunk; and
bits, to specify which of the 2.5 chunks we are in. To represent 0 to 2.5 with the smallest number of bits, we round up to the closest power of 2, chunks. So (the power of two).
We need 22 bits at minimum to address 2.5 TiB of memory.
4Mnemonics¶
You should become very familiar with both base-10 and binary prefixes. Here are some mnemonics, courtesy of previous students and instructors:
Kid meets giant Texas people exercising zen yoga. – Rolf O
Kind men give ten percent extra, zestfully, youthfully. – Hava E
Kindness means giving, teaching, permeating excess zeal yourself. – Hava E
Kindergarten means giving teachers perfect examples (of) zeal (&) youth
Kissing Mel Gibson, Teddy Pendergrass exclaimed: “Zesty, yo!” – Dan G
Kissing mom gives ten percent extra zeal & youth!
5Which to use?¶
Base-10 prefixes are often used by hard disk manufacturers & telecommunications. For example, a Mbit/s connection transfers 106 bits per second.
Binary prefixes are often used for RAM and Caches because they are conceptually closer to the architecture.
Operating Systems alternate between the two but seem to have settled on base-10.
Aside: Remember, base-10 numbers are smaller than their binary counterparts, e.g., 1TB is about 90% of 1TiB. This numeric difference has been the subject of numerous lawsuits against storage manufacturers accusing them of false advertising, among other things.
In this course, we will specify numbers with the abbreviations in Table 1 and Table 2.