首页 | 主题 | 图库 | 问答 | 文摘 | 原创 | 百科

历史 | 地理 | 人物 | 艺术 | 体育 | 科学 | 音乐 | 电影 | 信息技术 | 世界遗产

 开放、中立,源自维基百科

Personal tools

Binary prefix

From Wikipedia, the free encyclopedia

Jump to: navigation, search

In computing, binary prefixes are names or associated symbols that can precede a unit of measure (such as a byte) to indicate multiplication by a power of two. In certain contexts in computing (such as computer memory sizes), it is convenient to express large multiples of units using powers of two. As the binary multipliers 1024 (210), 1048576 (220) (etc.) are close to certain SI prefixes such as kilo- (1000 = 103) and mega- (1000000 = 106) respectively, it has been traditional in some settings to use these SI prefixes with the binary meanings, that is, to use "mega" (or the symbol, M) to mean 1048576 instead of 1000000 and so on. However, as SI prefixes have the decimal meanings in every other context, this usage leads to ambiguity. Furthermore, even in computing, certain areas have always used the SI prefixes to mean decimal multipliers, and not the binary sense.

Current national and international standards state that traditional SI prefixes always refer to powers of ten, even in the context of information technology.[1][2][3]

To resolve this confusion, standards organisations have proposed a new set of binary prefixes to indicate binary multipliers. Each successive prefix is 1024 (210) times the previous one, rather than the 1000 (103) used by the SI prefix system. These prefixes are being adopted slowly.

Contents

History

Early computers used one of two addressing methods to access the system memory; binary (base-2) or decimal (base-10). For instance, the IBM 701 (1952) used binary and could address 2,048 36-bit words, while the IBM 702 (1953) used decimal and could address 10,000 7-bit words.

One of the most successful early computers was the IBM 1401. It was introduced in 1959 and by 1961 one out of every four electronic stored-program computers was an IBM 1401. It used decimal addressing and could have 1400, 2000, 4000, 8000, 12000 or 16000 characters of 8-bit core storage.[4] In the 1950s, computer engineers were familiar with the terms kilo (k) and mega (M). It was common to see 4.7k for a 4700 ohm resistor or 10Mc for a 10 megacycle (megahertz) frequency. It was natural to borrow the term k to express large quantities of storage. A reference to a "4k IBM 1401" meant 4,000 characters of storage (memory).[5]

By the mid 1960s, binary addressing had become the standard architecture in computer design. The computer system documentation would specify the memory size with an exact number such as 32,768, 65,536 or 131,072 words of storage (all powers of 2). There were several methods used to abbreviate these quantities. The use of K in the binary sense as in a "32K store" can be found as early as 1960.[6] Gene Amdahl's seminal 1964 article on IBM System/360 used 1K to mean 1024.[7] This style was used by other computer vendors, the CDC 7600 System Description (1968) made extensive use of K as 1024.[8] Another style was to truncate the last 3 digits and append K. The exact values 32,768, 65,536 and 131,072 would then become 32K, 65K and 131K.[9] (If 32,768 were instead rounded off, it would be 33K; if K = 1024 were used, 65,536 would become "64K".) This style was used from about 1965 to 1975.

These two styles (K = 1024 and truncation) were used loosely around the same time, sometimes by the same company. (In discussions of binary-addressed memories, the exact size was evident from context.) The HP 21MX real-time computer (1974) denoted 196,608 as 196K and 1,048,576 as 1 M,[10] while the HP 3000 business computer (1973) could have 64K, 96K, or 128K bytes of memory.[11]

The terms Kbit, Kbyte, Mbit and Mbyte started to be used as binary units in the early 1970s.[12] Most memory capacities were expressed in K, even when M could have been used: The IBM System/370 Model 158 brochure (1972) had the following: "Real storage capacity is available in 512K increments ranging from 512K to 2,048K bytes."[13] Megabyte was used to describe the 22-bit addressing of DEC PDP-11/70 (1975)[14] and gigabyte the 30-bit addressing DEC VAX11/780 (1977).

By the mid 1970s it was common to see K (or Kbyte) as 1,024 and the occasional M (or Mbyte) as 1,048,576 for words or bytes of memory (RAM). K and M were also used with their decimal meaning for disk storage. In the 1980s the terms kilobyte, megabyte, and gigabyte became popular along with the abbreviations KB, MB, and GB.

The dual use of these prefixes as both decimal and binary quantities was defined in standards and dictionaries. The ANSI/IEEE Std 1084-1986[15] is still available for reference and defined kilo and mega. (The term "computer storage" means system memory.)[7]

kilo (K). (1) A prefix indicating 1000. (2) In statements involving size of computer storage, a prefix indicating 210, or 1024.

mega (M). (1) A prefix indicating one million. (2) In statements involving size of computer storage, a prefix indicating 220, or 1,048,576.

The binary units Kbyte and Mbyte were formally defined in ANSI/IEEE Std 1212-1991.[16] The terms Kbyte, Mbyte, and Gbyte are found in the trade press and in IEEE journals. "Gigabyte" was formally defined in IEEE Std 610.10-1994 as either 1,000,000,000 or 230 bytes.[17] Kilobyte, Kbyte, and KB are equivalent units and all are defined in the current standard, IEEE 100-2000.[18]

The industry has coped with the dual definitions because system memory (RAM) typically uses the binary meaning while disk storage uses the decimal meaning. There are exceptions like diskettes and CDs. There are no SI units for computer storage capacity but the decimal prefix meanings of KB, MB, and GB are often referred to as SI prefixes.

In January 1999, the International Electrotechnical Commission introduced the prefixes kibi-(Kibibyte), mebi-, gibi-, etc., and the symbols Ki, Mi, Gi, etc. to specify binary multiples of a quantity and eliminate this ambiguity.[19] The names for the new standard are derived from the first two letters of the original SI prefixes followed by bi, short for "binary". The new standard also clarifies that, from the point of view of the IEC, the SI prefixes will henceforth only have their base-10 meaning and never have a base-2 meaning.

The second edition of the standard[20] defined them only up to exbi-,[21] but in 2005, the third edition added prefixes zebi- and yobi-, thus matching all standard SI prefixes with their binary counterparts.[22]

On March 19, 2005 the IEEE standard IEEE 1541-2002 (Prefixes for Binary Multiples) was elevated to a full-use standard by the IEEE Standards Association after a two-year trial period.[23]

Consumer confusion

In the early days of computers there was little or no consumer confusion because of the sophisticated nature of the consumers and the practice of the computer manufacturers to specify (as opposed to advertise) their products with decimal digits of sufficient places, e.g., the 1968 IBM stated System 360 "Model 91s can accommodate up to 6,291,496 bytes of main storage."[24]

Hard disk drive manufacturers used MB, i.e. 106 bytes, to characterize their products as early as 1974.[25] By 1977, in its first edition, Disk/Trend, a leading hard disk drive industry marketing consultancy segmented the industry according to MBs (decimal sense) of capacity.[26]

The presentation of hard disk drive capacity by an operating system using MB in a binary sense appears no earlier than Macintosh Finder after 1984. Prior to that, on the systems that had a hard disk drive, capacity was presented in decimal digits with no prefix of any sort (e.g., MS/PC DOS CHKDSK command).

See, for example, the following two images; consumers may be confused by the difference between the 160 GB on the disk drive package and the 149.05 GB reported by the operating system.

SI prefixes used in the binary sense

Name Symbol Value Base 16 Base 10
kilo k/K 210 = 1,024 = 162.5 > 103
mega M 220 = 1,048,576 = 165 > 106
giga G 230 = 1,073,741,824 = 167.5 > 109
tera T 240 = 1,099,511,627,776 = 1610 > 1012
peta P 250 = 1,125,899,906,842,624 = 1612.5 > 1015
exa E 260 = 1,152,921,504,606,846,976 = 1615 > 1018
zetta Z 270 = 1,180,591,620,717,411,303,424 = 1617.5 > 1021
yotta Y 280 = 1,208,925,819,614,629,174,706,176  = 1620 > 1024

The one-letter symbols are identical to SI prefixes, except for "K", which is used interchangeably with "k" (in SI, the upper-case or capital "K" stands for kelvin, and only the lower-case "k" represents 1,000).

These prefixes are in common use in contexts such as file and memory sizes. The names and values of the SI prefixes were defined in the 1960 SI standard, with powers-of-1000 values. Standard dictionaries do recognize the binary meanings for these prefixes.[27][28] Oxford online dictionary define, for example, megabyte as: "Computing a unit of information equal to one million or (strictly) 1,048,576 bytes."[29]

BIPM (the International Bureau of Weights and Measures which maintains SI) expressly prohibits the binary prefix usage, and recommends the use of the IEC prefixes as an alternative since computing units are not included in SI.[1]

Some have suggested that "k" be used for 1,000, and "K" for 1,024, but this cannot be extended to the higher order prefixes and has never been widely recognised.

Although the SI prefixes denoting fractions of a bit or byte might theoretically find application in areas such as cryptography, data compression, and data transfer rates, they are not used in practice.

Informally, the prefixes are often used on their own. Thus one might hear about a "256K DRAM" (256 binary kilobytes), "a 160 MB HDD" (160 decimal megabytes) or "a 2M Internet connection" (2 decimal megabits per second). What units are being used, and whether the multipliers are decimal or binary, depends on context and cannot be determined by the units alone.

IEC standard prefixes

Name Symbol Base 2 Base 16 Base 10
kibi Ki 210 162.5 400(16) 1,024 > 103
mebi Mi 220 165 10 0000(16) 1,048,576 > 106
gibi Gi 230 167.5 4 000 0000(16) 1,073,741,824 > 109
tebi Ti 240 1610 100 0000 0000(16) 1,099,511,627,776 > 1012
pebi Pi 250 1612.5 4 0000 0000 0000(16) 1,125,899,906,842,624 > 1015
exbi Ei 260 1615 1000 0000 0000 0000(16) 1,152,921,504,606,846,976 > 1018
zebi Zi 270 1617.5 40 0000 0000 0000 0000(16) 1,180,591,620,717,411,303,424 > 1021
yobi Yi 280 1620 1 0000 0000 0000 0000 0000(16) 1,208,925,819,614,629,174,706,176 > 1024

Example: 300 GB ≅ 279.5 GiB.

Approximate ratios between binary and decimal prefixes

As the order of magnitude increases, the percentage difference between the binary and decimal values of a prefix increases, from 2.4% (with the kilo prefix) to over 20% (with the yotta prefix). This makes differentiating between the two increasingly important as larger and larger data storage and transmission technologies are developed.

Name Bin ÷ Dec Dec ÷ Bin Example Percentage difference
kilobyte : kibibyte 1.024 0.976 100 kB ≅ 97.6 KiB +2.4% or −2.3%
megabyte : mebibyte 1.049 0.954 100 MB ≅ 95.4 MiB +4.9% or −4.6%
gigabyte : gibibyte 1.074 0.931 100 GB ≅ 93.1 GiB +7.4% or −6.9%
terabyte : tebibyte 1.100 0.909 100 TB ≅ 90.9 TiB +10% or −9.1%
petabyte : pebibyte 1.126 0.888 100 PB ≅ 88.8 PiB +12.6% or −11.2%
exabyte : exbibyte 1.153 0.867 100 EB ≅ 86.7 EiB +15.3% or −13.3%
zettabyte : zebibyte 1.181 0.847 100 ZB ≅ 84.7 ZiB +18.1% or −15.3%
yottabyte : yobibyte 1.209 0.827 100 YB ≅ 82.7 YiB +20.9% or −17.3%

Adoption

As of 2007, the IEC binary naming convention has been adopted by some, but is not used universally. Most[specify] publications, computer manufacturers and software companies are still using the traditional binary units defined in IEEE 100, The Authoritative Dictionary of IEEE Standards Terms, Seventh Edition, 2000.[18][dubious ]

The binary convention is strongly supported by many standardization bodies and technical organizations, such as IEEE, CIPM, NIST, and SAE.[2][1][3][30] The new binary prefixes have also been adopted by the European Committee for Electrotechnical Standardization (CENELEC) as the harmonization document HD 60027-2:2003-03.[31] This document will be adopted as a European standard.[32]

The prefixes are beginning to be used in technical articles and software where it is important to avoid ambiguity.[33] Examples of software that use IEC standard prefixes (along with standard SI prefixes) include:

Languages
AD Links