Number
int64 1
7.61k
| Text
stringlengths 2
3.11k
|
|---|---|
3,801
|
As of at least 2015, Apple has removed legacy BIOS support from MacBook Pro computers. As such the BIOS utility no longer supports the legacy option, and prints "Legacy mode not supported on this system". In 2017, Intel announced that it would remove legacy BIOS support by 2020. Since 2019, new Intel platform OEM PCs no longer support the legacy option.
|
3,802
|
Unlike the ones' complement scheme, the two's complement scheme has only one representation for zero. Furthermore, arithmetic implementations can be used on signed as well as unsigned integers
and differ only in the integer overflow situations.
|
3,803
|
The two's complement of an integer is computed by:
|
3,804
|
For example, to calculate the decimal number −6 in binary from the number 6:
|
3,805
|
To verify that 1010 indeed has a value of −6, add the place values together, but subtract the sign value from the final calculation. Because the most significant value is the sign value, it must be subtracted to produce the correct result: 1010 = − + + + = 1×−8 + 0 + 1×2 + 0 = −6.
|
3,806
|
Two's complement is an example of a radix complement.
The 'two' in the name refers to the term which, expanded fully in an N-bit system, is actually "two to the power of N" - 2N , and it is only this full term in respect to which the complement is calculated. As such, the precise definition of the Two's complement of an N-bit number is the complement of that number with respect to 2N.
|
3,807
|
The defining property of being a complement to a number with respect to 2N is simply that the summation of this number with the original produce 2N. For example, using binary with numbers up to three-bits , a two's complement for the number 3 is 5 , because summed to the original it gives 23 = 10002 = 0112 + 1012. Where this correspondence is employed for representing negative numbers, it effectively means, using an analogy with decimal digits and a number-space only allowing eight non-negative numbers 0 through 7, dividing the number-space in two sets: the first four of the numbers 0 1 2 3 remain the same, while the remaining four encode negative numbers, maintaining their growing order, so making 4 encode -4, 5 encode -3, 6 encode -2 and 7 encode -1. A binary representation has an additional utility however, because the most significant bit also indicates the group : it is 0 for the first group of non-negatives, and 1 for the second group of negatives. The tables at right illustrate this property.
|
3,808
|
Calculation of the binary two's complement of a positive number essentially means subtracting the number from the 2N. But as can be seen for the three-bit example and the four-bit 10002 , the number 2N will not itself be representable in a system limited to N bits, as it is just outside the N bits space . Because of this, systems with maximally N-bits must break the subtraction into two operations: first subtract from the maximum number in the N-bit system, that is 2N-1 and then adding the one. Coincidentally, that intermediate number before adding the one is also used in computer science as another method of signed number representation and is called a Ones' complement .
|
3,809
|
Compared to other systems for representing signed numbers , the two's complement has the advantage that the fundamental arithmetic operations of addition, subtraction, and multiplication are identical to those for unsigned binary numbers . This property makes the system simpler to implement, especially for higher-precision arithmetic. Additionally, unlike ones' complement systems, two's complement has no representation for negative zero, and thus does not suffer from its associated difficulties. Otherwise, both schemes have the desired property that the sign of integers can be reversed by taking the complement of its binary representation, but two's complement has an exception - the lowest negative, as can be seen in the tables.
|
3,810
|
The method of complements had long been used to perform subtraction in decimal adding machines and mechanical calculators. John von Neumann suggested use of two's complement binary representation in his 1945 First Draft of a Report on the EDVAC proposal for an electronic stored-program digital computer. The 1949 EDSAC, which was inspired by the First Draft, used two's complement representation of negative binary integers.
|
3,811
|
Many early computers, including the CDC 6600, the LINC, the PDP-1, and the UNIVAC 1107, use ones' complement notation; the descendants of the UNIVAC 1107, the UNIVAC 1100/2200 series, continued to do so. The IBM 700/7000 series scientific machines use sign/magnitude notation, except for the index registers which are two's complement. Early commercial computers storing negative values in two's complement form include the English Electric DEUCE and the Digital Equipment Corporation PDP-5 and PDP-6 . The System/360, introduced in 1964 by IBM, then the dominant player in the computer industry, made two's complement the most widely used binary representation in the computer industry. The first minicomputer, the PDP-8 introduced in 1965, uses two's complement arithmetic, as do the 1969 Data General Nova, the 1970 PDP-11, and almost all subsequent minicomputers and microcomputers.
|
3,812
|
A two's-complement number system encodes positive and negative numbers in a binary number representation. The weight of each bit is a power of two, except for the most significant bit, whose weight is the negative of the corresponding power of two.
|
3,813
|
The most significant bit determines the sign of the number and is sometimes called the sign bit. Unlike in sign-and-magnitude representation, the sign bit also has the weight − shown above. Using N bits, all integers from − to 2N − 1 − 1 can be represented.
|
3,814
|
In two's complement notation, a non-negative number is represented by its ordinary binary representation; in this case, the most significant bit is 0. Though, the range of numbers represented is not the same as with unsigned binary numbers. For example, an 8-bit unsigned number can represent the values 0 to 255 . However a two's complement 8-bit number can only represent non-negative integers from 0 to 127 , because the rest of the bit combinations with the most significant bit as '1' represent the negative integers −1 to −128.
|
3,815
|
The two's complement operation is the additive inverse operation, so negative numbers are represented by the two's complement of the absolute value.
|
3,816
|
To get the two's complement of a negative binary number, all bits are inverted, or "flipped", by using the bitwise NOT operation; the value of 1 is then added to the resulting value, ignoring the overflow which occurs when taking the two's complement of 0.
|
3,817
|
For example, using 1 byte , the decimal number 5 is represented by
|
3,818
|
The most significant bit is 0, so the pattern represents a non-negative value. To convert to −5 in two's-complement notation, first, all bits are inverted, that is: 0 becomes 1 and 1 becomes 0:
|
3,819
|
At this point, the representation is the ones' complement of the decimal value −5. To obtain the two's complement, 1 is added to the result, giving:
|
3,820
|
The result is a signed binary number representing the decimal value −5 in two's-complement form. The most significant bit is 1, so the value represented is negative.
|
3,821
|
The two's complement of a negative number is the corresponding positive value, except in the special case of the most negative number. For example, inverting the bits of −5 gives:
|
3,822
|
And adding one gives the final value:
|
3,823
|
Likewise, the two's complement of zero is zero: inverting gives all ones, and adding one changes the ones back to zeros .
|
3,824
|
The two's complement of the most negative number representable is itself. Hence, there is an 'extra' negative number for which two's complement does not give the negation, see § Most negative number below.
|
3,825
|
The sum of a number and its ones' complement is an N-bit word with all 1 bits, which is 2N − 1. Then adding a number to its two's complement results in the N lowest bits set to 0 and the carry bit 1, where the latter has the weight of 2N. Hence, in the unsigned binary arithmetic the value of two's-complement negative number x* of a positive x satisfies the equality x* = 2N − x.
|
3,826
|
For example, to find the four-bit representation of −5 :
|
3,827
|
Hence, with N = 4:
|
3,828
|
The calculation can be done entirely in base 10, converting to base 2 at the end:
|
3,829
|
A shortcut to manually convert a binary number into its two's complement is to start at the least significant bit , and copy all the zeros, working from LSB toward the most significant bit until the first 1 is reached; then copy that 1, and flip all the remaining bits . This shortcut allows a person to convert a number to its two's complement without first forming its ones' complement. For example: in two's complement representation, the negation of "0011 1100" is "1100 0100", where the underlined digits were unchanged by the copying operation .
|
3,830
|
In computer circuitry, this method is no faster than the "complement and add one" method; both methods require working sequentially from right to left, propagating logic changes. The method of complementing and adding one can be sped up by a standard carry look-ahead adder circuit; the LSB towards MSB method can be sped up by a similar logic transformation.
|
3,831
|
When turning a two's-complement number with a certain number of bits into one with more bits , the most-significant bit must be repeated in all the extra bits. Some processors do this in a single instruction; on other processors, a conditional must be used followed by code to set the relevant bits or bytes.
|
3,832
|
Similarly, when a number is shifted to the right, the most-significant bit, which contains the sign information, must be maintained. However, when shifted to the left, a bit is shifted out. These rules preserve the common semantics that left shifts multiply the number by two and right shifts divide the number by two. However, if the most-significant bit changes from 0 to 1 , overflow is said to occur in the case that the value represents a signed integer.
|
3,833
|
Both shifting and doubling the precision are important for some multiplication algorithms. Note that unlike addition and subtraction, width extension and right shifting are done differently for signed and unsigned numbers.
|
3,834
|
With only one exception, starting with any number in two's-complement representation, if all the bits are flipped and 1 added, the two's-complement representation of the negative of that number is obtained. Positive 12 becomes negative 12, positive 5 becomes negative 5, zero becomes zero, etc.
|
3,835
|
Taking the two's complement of the minimum number in the range will not have the desired effect of negating the number. For example, the two's complement of −128 in an eight-bit system is −128 , as shown in the table to the right. Although the expected result from negating −128 is +128 , there is no representation of +128 with an eight bit two's complement system and thus it is in fact impossible to represent the negation. Note that the two's complement being the same number is detected as an overflow condition since there was a carry into but not out of the most-significant bit.
|
3,836
|
Having a nonzero number equal to its own negation is forced by the fact that zero is its own negation, and that the total number of numbers is even. Proof: there are 2^n - 1 nonzero numbers . Negation would partition the nonzero numbers into sets of size 2, but this would result in the set of nonzero numbers having even cardinality. So at least one of the sets has size 1, i.e., a nonzero number is its own negation.
|
3,837
|
The presence of the most negative number can lead to unexpected programming bugs where the result has an unexpected sign, or leads to an unexpected overflow exception, or leads to completely strange behaviors. For example,
|
3,838
|
In the C and C++ programming languages, the above behaviours are undefined and not only may they return strange results, but the compiler is free to assume that the programmer has ensured that undefined numerical operations never happen, and make inferences from that assumption. This enables a number of optimizations, but also leads to a number of strange bugs in programs with these undefined calculations.
|
3,839
|
This most negative number in two's complement is sometimes called "the weird number", because it is the only exception.
Although the number is an exception, it is a valid number in regular two's complement systems. All arithmetic operations work with it both as an operand and a result.
|
3,840
|
Given a set of all possible N-bit values, we can assign the lower half to be the integers from 0 to inclusive and the upper half to be −2N − 1 to −1 inclusive. The upper half can be used to represent negative integers from −2N − 1 to −1 because, under addition modulo 2N they behave the same way as those negative integers. That is to say that, because i + j mod 2N = i + mod 2N, any value in the set { j + k 2N | k is an integer } can be used in place of j.
|
3,841
|
For example, with eight bits, the unsigned bytes are 0 to 255. Subtracting 256 from the top half yields the signed bytes −128 to −1.
|
3,842
|
The relationship to two's complement is realised by noting that 256 = 255 + 1, and is the ones' complement of x.
|
3,843
|
For example, an 8 bit number can only represent every integer from −128. to 127., inclusive, since . −95. modulo 256. is equivalent to 161. since
|
3,844
|
Fundamentally, the system represents negative integers by counting backward and wrapping around. The boundary between positive and negative numbers is arbitrary, but by convention all negative numbers have a left-most bit of one. Therefore, the most positive four-bit number is 0111 and the most negative is 1000 . Because of the use of the left-most bit as the sign bit, the absolute value of the most negative number is too large to represent. Negating a two's complement number is simple: Invert all the bits and add one to the result. For example, negating 1111, we get 0000 + 1 = 1. Therefore, 1111 in binary must represent −1 in decimal.
|
3,845
|
The system is useful in simplifying the implementation of arithmetic on computer hardware. Adding 0011 to 1111 at first seems to give the incorrect answer of 10010. However, the hardware can simply ignore the left-most bit to give the correct answer of 0010 . Overflow checks still must exist to catch operations such as summing 0100 and 0100.
|
3,846
|
The system therefore allows addition of negative operands without a subtraction circuit or a circuit that detects the sign of a number. Moreover, that addition circuit can also perform subtraction by taking the two's complement of a number , which only requires an additional cycle or its own adder circuit. To perform this, the circuit merely operates as if there were an extra left-most bit of 1.
|
3,847
|
Adding two's complement numbers requires no special processing even if the operands have opposite signs; the sign of the result is determined automatically. For example, adding 15 and −5:
|
3,848
|
Or the computation of 5 − 15 = 5 + :
|
3,849
|
This process depends upon restricting to 8 bits of precision; a carry to the 9th most significant bit is ignored, resulting in the arithmetically correct result of 1010.
|
3,850
|
The last two bits of the carry row contain vital information: whether the calculation resulted in an arithmetic overflow, a number too large for the binary system to represent . An overflow condition exists when these last two bits are different from one another. As mentioned above, the sign of the number is encoded in the MSB of the result.
|
3,851
|
In other terms, if the left two carry bits are both 1s or both 0s, the result is valid; if the left two carry bits are "1 0" or "0 1", a sign overflow has occurred. Conveniently, an XOR operation on these two bits can quickly determine if an overflow condition exists. As an example, consider the signed 4-bit addition of 7 and 3:
|
3,852
|
In this case, the far left two carry bits are "01", which means there was a two's-complement addition overflow. That is, 10102 = 1010 is outside the permitted range of −8 to 7. The result would be correct if treated as unsigned integer.
|
3,853
|
In general, any two N-bit numbers may be added without overflow, by first sign-extending both of them to N + 1 bits, and then adding as above. The N + 1 bits result is large enough to represent any possible sum so overflow will never occur. It is then possible, if desired, to 'truncate' the result back to N bits while preserving the value if and only if the discarded bit is a proper sign extension of the retained result bits. This provides another method of detecting overflow—which is equivalent to the method of comparing the carry bits—but which may be easier to implement in some situations, because it does not require access to the internals of the addition.
|
3,854
|
Computers usually use the method of complements to implement subtraction. Using complements for subtraction is closely related to using complements for representing negative numbers, since the combination allows all signs of operands and results; direct subtraction works with two's-complement numbers as well. Like addition, the advantage of using two's complement is the elimination of examining the signs of the operands to determine whether addition or subtraction is needed. For example, subtracting −5 from 15 is really adding 5 to 15, but this is hidden by the two's-complement representation:
|
3,855
|
Overflow is detected the same way as for addition, by examining the two leftmost bits of the borrows; overflow has occurred if they are different.
|
3,856
|
Another example is a subtraction operation where the result is negative: 15 − 35 = −20:
|
3,857
|
As for addition, overflow in subtraction may be avoided by first sign-extending both inputs by an extra bit.
|
3,858
|
The product of two N-bit numbers requires 2N bits to contain all possible values.
|
3,859
|
If the precision of the two operands using two's complement is doubled before the multiplication, direct multiplication will provide the correct result. For example, take 6 × = −30. First, the precision is extended from four bits to eight. Then the numbers are multiplied, discarding the bits beyond the eighth bit :
|
3,860
|
This is very inefficient; by doubling the precision ahead of time, all additions must be double-precision and at least twice as many partial products are needed than for the more efficient algorithms actually implemented in computers. Some multiplication algorithms are designed for two's complement, notably Booth's multiplication algorithm. Methods for multiplying sign-magnitude numbers do not work with two's-complement numbers without adaptation. There is not usually a problem when the multiplicand is negative; the issue is setting the initial bits of the product correctly when the multiplier is negative. Two methods for adapting algorithms to handle two's-complement numbers are common:
|
3,861
|
As an example of the second method, take the common add-and-shift algorithm for multiplication. Instead of shifting partial products to the left as is done with pencil and paper, the accumulated product is shifted right, into a second register that will eventually hold the least significant half of the product. Since the least significant bits are not changed once they are calculated, the additions can be single precision, accumulating in the register that will eventually hold the most significant half of the product. In the following example, again multiplying 6 by −5, the two registers and the extended sign bit are separated by "|":
|
3,862
|
Comparison is often implemented with a dummy subtraction, where the flags in the computer's status register are checked, but the main result is ignored. The zero flag indicates if two values compared equal. If the exclusive-or of the sign and overflow flags is 1, the subtraction result was less than zero, otherwise the result was zero or greater. These checks are often implemented in computers in conditional branch instructions.
|
3,863
|
Unsigned binary numbers can be ordered by a simple lexicographic ordering, where the bit value 0 is defined as less than the bit value 1. For two's complement values, the meaning of the most significant bit is reversed .
|
3,864
|
The following algorithm sets the result register R to −1 if A < B, to +1 if A > B, and to 0 if A and B are equal:
|
3,865
|
In a classic HAKMEM published by the MIT AI Lab in 1972, Bill Gosper noted that whether or not a machine's internal representation was two's-complement could be determined by summing the successive powers of two. In a flight of fancy, he noted that the result of doing this algebraically indicated that "algebra is run on a machine which is two's-complement."
|
3,866
|
Gosper's end conclusion is not necessarily meant to be taken seriously, and it is akin to a mathematical joke. The critical step is "...110 = ...111 − 1", i.e., "2X = X − 1", and thus X = ...111 = −1. This presupposes a method by which an infinite string of 1s is considered a number, which requires an extension of the finite place-value concepts in elementary arithmetic. It is meaningful either as part of a two's-complement notation for all integers, as a typical 2-adic number, or even as one of the generalized sums defined for the divergent series of real numbers 1 + 2 + 4 + 8 + ···. Digital arithmetic circuits, idealized to operate with infinite bit strings, produce 2-adic addition and multiplication compatible with two's complement representation. Continuity of binary arithmetical and bitwise operations in 2-adic metric also has some use in cryptography.
|
3,867
|
To convert a number with a fractional part, such as .0101, one must convert starting from right to left the 1s to decimal as in a normal conversion. In this example 0101 is equal to 5 in decimal. Each digit after the floating point represents a fraction where the denominator is a multiplier of 2. So, the first is 1/2, the second is 1/4 and so on. Having already calculated the decimal value as mentioned above, only the denominator of the LSB is used. The final result of this conversion is 5/16.
|
3,868
|
For instance, having the floating value of .0110 for this method to work, one should not consider the last 0 from the right. Hence, instead of calculating the decimal value for 0110, we calculate the value 011, which is 3 in decimal . The denominator is 8, giving a final result of 3/8.
|
3,869
|
The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable unit of memory in many computer architectures. To disambiguate arbitrarily sized bytes from the common 8-bit definition, network protocol documents such as the Internet Protocol refer to an 8-bit byte as an octet. Those bits in an octet are usually counted with numbering from 0 to 7 or 7 to 0 depending on the bit endianness.
|
3,870
|
The size of the byte has historically been hardware-dependent and no definitive standards existed that mandated the size. Sizes from 1 to 48 bits have been used. The six-bit character code was an often-used implementation in early encoding systems, and computers using six-bit and nine-bit bytes were common in the 1960s. These systems often had memory words of 12, 18, 24, 30, 36, 48, or 60 bits, corresponding to 2, 3, 4, 5, 6, 8, or 10 six-bit bytes. In this era, bit groupings in the instruction stream were often referred to as syllables or slab, before the term byte became common.
|
3,871
|
The modern de facto standard of eight bits, as documented in ISO/IEC 2382-1:1993, is a convenient power of two permitting the binary-encoded values 0 through 255 for one byte, as 2 to the power of 8 is 256. The international standard IEC 80000-13 codified this common meaning. Many types of applications use information representable in eight or fewer bits and processor designers commonly optimize for this usage. The popularity of major commercial computing architectures has aided in the ubiquitous acceptance of the 8-bit byte. Modern architectures typically use 32- or 64-bit words, built of four or eight bytes, respectively.
|
3,872
|
The unit symbol for the byte was designated as the upper-case letter B by the International Electrotechnical Commission and Institute of Electrical and Electronics Engineers . Internationally, the unit octet, symbol o, explicitly defines a sequence of eight bits, eliminating the potential ambiguity of the term "byte".
|
3,873
|
The term byte was coined by Werner Buchholz in June 1956, during the early design phase for the IBM Stretch computer, which had addressing to the bit and variable field length instructions with a byte size encoded in the instruction. It is a deliberate respelling of bite to avoid accidental mutation to bit.
|
3,874
|
Another origin of byte for bit groups smaller than a computer's word size, and in particular groups of four bits, is on record by Louis G. Dooley, who claimed he coined the term while working with Jules Schwartz and Dick Beeler on an air defense system called SAGE at MIT Lincoln Laboratory in 1956 or 1957, which was jointly developed by Rand, MIT, and IBM. Later on, Schwartz's language JOVIAL actually used the term, but the author recalled vaguely that it was derived from AN/FSQ-31.
|
3,875
|
Early computers used a variety of four-bit binary-coded decimal representations and the six-bit codes for printable graphic patterns common in the U.S. Army and Navy. These representations included alphanumeric characters and special graphical symbols. These sets were expanded in 1963 to seven bits of coding, called the American Standard Code for Information Interchange as the Federal Information Processing Standard, which replaced the incompatible teleprinter codes in use by different branches of the U.S. government and universities during the 1960s. ASCII included the distinction of upper- and lowercase alphabets and a set of control characters to facilitate the transmission of written language as well as printing device functions, such as page advance and line feed, and the physical or logical control of data flow over the transmission media. During the early 1960s, while also active in ASCII standardization, IBM simultaneously introduced in its product line of System/360 the eight-bit Extended Binary Coded Decimal Interchange Code , an expansion of their six-bit binary-coded decimal representations used in earlier card punches.
The prominence of the System/360 led to the ubiquitous adoption of the eight-bit storage size, while in detail the EBCDIC and ASCII encoding schemes are different.
|
3,876
|
In the early 1960s, AT&T introduced digital telephony on long-distance trunk lines. These used the eight-bit μ-law encoding. This large investment promised to reduce transmission costs for eight-bit data.
|
3,877
|
In Volume 1 of The Art of Computer Programming , Donald Knuth uses byte in his hypothetical MIX computer to denote a unit which "contains an unspecified amount of information ... capable of holding at least 64 distinct values ... at most 100 distinct values. On a binary computer a byte must therefore be composed of six bits". He notes that "Since 1975 or so, the word byte has come to mean a sequence of precisely eight binary digits...When we speak of bytes in connection with MIX we shall confine ourselves to the former sense of the word, harking back to the days when bytes were not yet standardized."
|
3,878
|
The development of eight-bit microprocessors in the 1970s popularized this storage size. Microprocessors such as the Intel 8008, the direct predecessor of the 8080 and the 8086, used in early personal computers, could also perform a small number of operations on the four-bit pairs in a byte, such as the decimal-add-adjust instruction. A four-bit quantity is often called a nibble, also nybble, which is conveniently represented by a single hexadecimal digit.
|
3,879
|
The term octet is used to unambiguously specify a size of eight bits. It is used extensively in protocol definitions.
|
3,880
|
Historically, the term octad or octade was used to denote eight bits as well at least in Western Europe; however, this usage is no longer common. The exact origin of the term is unclear, but it can be found in British, Dutch, and German sources of the 1960s and 1970s, and throughout the documentation of Philips mainframe computers.
|
3,881
|
The unit symbol for the byte is specified in IEC 80000-13, IEEE 1541 and the Metric Interchange Format as the upper-case character B.
|
3,882
|
In the International System of Quantities , B is also the symbol of the bel, a unit of logarithmic power ratio named after Alexander Graham Bell, creating a conflict with the IEC specification. However, little danger of confusion exists, because the bel is a rarely used unit. It is used primarily in its decadic fraction, the decibel , for signal strength and sound pressure level measurements, while a unit for one-tenth of a byte, the decibyte, and other fractions, are only used in derived units, such as transmission rates.
|
3,883
|
The lowercase letter o for octet is defined as the symbol for octet in IEC 80000-13 and is commonly used in languages such as French and Romanian, and is also combined with metric prefixes for multiples, for example ko and Mo.
|
3,884
|
More than one system exists to define unit multiples based on the byte. Some systems are based on powers of 10, following the International System of Units , which defines for example the prefix kilo as 1000 ; other systems are based on powers of 2. Nomenclature for these systems has confusion. Systems based on powers of 10 use standard SI prefixes and their corresponding symbols . Systems based on powers of 2, however, might use binary prefixes and their corresponding symbols or they might use the prefixes K, M, and G, creating ambiguity when the prefixes M or G are used.
|
3,885
|
While the difference between the decimal and binary interpretations is relatively small for the kilobyte , the systems deviate increasingly as units grow larger . For example, a power-of-10-based terabyte is about 9% smaller than power-of-2-based tebibyte.
|
3,886
|
Definition of prefixes using powers of 10—in which 1 kilobyte is defined to equal 1,000 bytes—is recommended by the International Electrotechnical Commission . The IEC standard defines eight such multiples, up to 1 yottabyte , equal to 10008 bytes. The additional prefixes ronna- for 10009 and quetta- for 100010 were adopted by the International Bureau of Weights and Measures in 2022.
|
3,887
|
This definition is most commonly used for data-rate units in computer networks, internal bus, hard drive and flash media transfer speeds, and for the capacities of most storage media, particularly hard drives, flash-based storage, and DVDs. Operating systems that use this definition include macOS, iOS, Ubuntu, and Debian. It is also consistent with the other uses of the SI prefixes in computing, such as CPU clock speeds or measures of performance.
|
3,888
|
A system of units based on powers of 2 in which 1 kibibyte is equal to 1,024 bytes is defined by international standard IEC 80000-13 and is supported by national and international standards bodies . The IEC standard defines eight such multiples, up to 1 yobibyte , equal to 10248 bytes. The natural binary counterparts to ronna- and quetta- were given in a consultation paper of the International Committee for Weights and Measures' Consultative Committee for Units as robi- and quebi- , but have not yet been adopted by the IEC and ISO.
|
3,889
|
An alternative system of nomenclature for the same units , in which 1 kilobyte is equal to 1,024 bytes, 1 megabyte is equal to 10242 bytes and 1 gigabyte is equal to 10243 bytes is mentioned by a 1990s JEDEC standard. Only the first three multiples are mentioned by the JEDEC standard, which makes no mention of TB and larger. While confusing and incorrect, the customary convention is used by the Microsoft Windows operating system and random-access memory capacity, such as main memory and CPU cache size, and in marketing and billing by telecommunication companies, such as Vodafone, AT&T, Orange and Telstra.
|
3,890
|
For storage capacity, the customary convention was used by macOS and iOS through Mac OS X 10.6 Snow Leopard and iOS 10, after which they switched to units based on powers of 10.
|
3,891
|
Various computer vendors have coined terms for data of various sizes, sometimes with different sizes for the same term even within a single vendor. These terms include double word, half word, long word, quad word, slab, superword and syllable. There are also informal terms. e.g., half byte and nybble for 4 bits, octal K for 10008.
|
3,892
|
Contemporary computer memory has a binary architecture making a definition of memory units based on powers of 2 most practical. The use of the metric prefix kilo for binary multiples arose as a convenience, because 1,024 is approximately 1,000. This definition was popular in early decades of personal computing, with products like the Tandon 51⁄4-inch DD floppy format being advertised as "360 KB", following the 1,024-byte convention. It was not universal, however. The Shugart SA-400 51⁄4-inch floppy disk held 109,375 bytes unformatted, and was advertised as "110 Kbyte", using the 1000 convention. Likewise, the 8-inch DEC RX01 floppy held 256,256 bytes formatted, and was advertised as "256k". Other disks were advertised using a mixture of the two definitions: notably, 3+1⁄2-inch HD disks advertised as "1.44 MB" in fact have a capacity of 1,440 KiB, the equivalent of 1.47 MB or 1.41 MiB.
|
3,893
|
In 1995, the International Union of Pure and Applied Chemistry's Interdivisional Committee on Nomenclature and Symbols attempted to resolve this ambiguity by proposing a set of binary prefixes for the powers of 1024, including kibi , mebi , and gibi .
|
3,894
|
In December 1998, the IEC addressed such multiple usages and definitions by adopting the IUPAC's proposed prefixes to unambiguously denote powers of 1024. Thus one kibibyte is 10241 bytes = 1024 bytes, one mebibyte is 10242 bytes = 1,048,576 bytes, and so on.
|
3,895
|
In 1999, Donald Knuth suggested calling the kibibyte a "large kilobyte" .
|
3,896
|
The IEC adopted the IUPAC proposal and published the standard in January 1999. The IEC prefixes are part of the International System of Quantities. The IEC further specified that the kilobyte should only be used to refer to 1,000 bytes.
|
3,897
|
Lawsuits arising from alleged consumer confusion over the binary and decimal definitions of multiples of the byte have generally ended in favor of the manufacturers, with courts holding that the legal definition of gigabyte or GB is 1 GB = 1,000,000,000 bytes , rather than the binary definition . Specifically, the United States District Court for the Northern District of California held that "the U.S. Congress has deemed the decimal definition of gigabyte to be the 'preferred' one for the purposes of 'U.S. trade and commerce' The California Legislature has likewise adopted the decimal system for all 'transactions in this state.'"
|
3,898
|
Earlier lawsuits had ended in settlement with no court ruling on the question, such as a lawsuit against drive manufacturer Western Digital. Western Digital settled the challenge and added explicit disclaimers to products that the usable capacity may differ from the advertised capacity. Seagate was sued on similar grounds and also settled.
|
3,899
|
Many programming languages define the data type byte.
|
3,900
|
The C and C++ programming languages define byte as an "addressable unit of data storage large enough to hold any member of the basic character set of the execution environment" . The C standard requires that the integral data type unsigned char must hold at least 256 different values, and is represented by at least eight bits . Various implementations of C and C++ reserve 8, 9, 16, 32, or 36 bits for the storage of a byte. In addition, the C and C++ standards require that there are no gaps between two bytes. This means every bit in memory is part of a byte.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.