目录 ← 首页
CS61C

IEC and Base-10 Prefixes

Learning 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.

It is unwieldy to use numbers like 4,294,967,296 to describe the 2322^32 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.

Base-10 Prefixes

We will find it very convenient to use prefixes like “kilo”, “giga”, etc. to refer to large base-10 numbers. #tab-base-10-prefixes describes the base-10 prefixes commonly used in this class.

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).

IEC (Binary) prefixes

The IEC (International Electrotechnical Commission) defined binary prefixes like “kibi”, “mebi”, etc., to describe large binary numbers. #tab-binary-prefixes describes the binary prefixes commonly used in this class.

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.”

Get familiar with conversions

At small numbers, base-two and base-ten are comparable because one thousand (kilo, 10310^3) is close to 1,024 (kibi, 2102^10). 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:

2101032^{10} \approx 10^3

Knowing your prefix conversions helps identify the amount of memory or storage you will need for a particular application.

Mnemonics

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!

Which to use?

Base-10 prefixes are often used by hard disk manufacturers & telecommunications. For example, a Mbit/s connection transfers 10610^6 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 #tab-base-10-prefixes and #tab-binary-prefixes.

Short Exercises

Conversions: Convert the following numbers into the quantity of bytes each term represents (you may leave your answer in terms of powers of 2).

Footnotes

  1. See Wikipedia