HOME

TheInfoList



OR:

Offset binary, also referred to as excess-K, excess-''N'', excess-e, excess code or biased representation, is a method for
signed number representation In computing, signed number representations are required to encode negative numbers in binary number systems. In mathematics, negative numbers in any base are represented by prefixing them with a minus sign ("−"). However, in RAM or CPU regist ...
where a signed number n is represented by the bit pattern corresponding to the unsigned number n+K, K being the ''biasing value'' or ''offset''. There is no standard for offset binary, but most often the ''K'' for an ''n''-bit binary word is ''K'' = 2''n''−1 (for example, the offset for a four-digit binary number would be 23=8). This has the consequence that the minimal negative value is represented by all-zeros, the "zero" value is represented by a 1 in the most significant bit and zero in all other bits, and the maximal positive value is represented by all-ones (conveniently, this is the same as using
two's complement Two's complement is a mathematical operation to reversibly convert a positive binary number into a negative binary number with equivalent (but negative) value, using the binary digit with the greatest place value (the leftmost bit in big- endian ...
but with the most significant bit inverted). It also has the consequence that in a logical comparison operation, one gets the same result as with a true form numerical comparison operation, whereas, in two's complement notation a logical comparison will agree with true form numerical comparison operation if and only if the numbers being compared have the same sign. Otherwise the sense of the comparison will be inverted, with all negative values being taken as being larger than all positive values. The 5-bit
Baudot code The Baudot code is an early character encoding for telegraphy invented by Émile Baudot in the 1870s. It was the predecessor to the International Telegraph Alphabet No. 2 (ITA2), the most common teleprinter code in use until the advent of ASCII ...
used in early synchronous multiplexing telegraphs can be seen as an offset-1 (''excess-1'') ''reflected'' binary (Gray) code. One historically prominent example of offset-64 (''excess-64'') notation was in the
floating point In computing, floating-point arithmetic (FP) is arithmetic that represents real numbers approximately, using an integer with a fixed precision, called the significand, scaled by an integer exponent of a fixed base. For example, 12.345 can be ...
(exponential) notation in the IBM System/360 and System/370 generations of computers. The "characteristic" (exponent) took the form of a seven-bit excess-64 number (The high-order bit of the same byte contained the sign of the significand). The 8-bit exponent in
Microsoft Binary Format In computing, Microsoft Binary Format (MBF) is a format for floating-point numbers which was used in Microsoft's BASIC language products, including MBASIC, GW-BASIC and QuickBASIC prior to version 4.00. There are two main versions of the format ...
, a floating point format used in various programming languages (in particular
BASIC BASIC (Beginners' All-purpose Symbolic Instruction Code) is a family of general-purpose, high-level programming languages designed for ease of use. The original version was created by John G. Kemeny and Thomas E. Kurtz at Dartmouth College ...
) in the 1970s and 1980s, was encoded using an offset-129 notation (''excess-129''). The IEEE Standard for Floating-Point Arithmetic (IEEE 754) uses offset notation for the exponent part in each of its various formats of precision. Unusually however, instead of using "excess 2''n''−1" it uses "excess 2''n''−1 − 1" (i.e. ''excess-15'', ''excess-127'', ''excess-1023'', ''excess-16383'') which means that inverting the leading (high-order) bit of the exponent will not convert the exponent to correct two's complement notation. Offset binary is often used in
digital signal processing Digital signal processing (DSP) is the use of digital processing, such as by computers or more specialized digital signal processors, to perform a wide variety of signal processing operations. The digital signals processed in this manner are ...
(DSP). Most analog to digital (A/D) and
digital to analog In electronics, a digital-to-analog converter (DAC, D/A, D2A, or D-to-A) is a system that converts a digital signal into an analog signal. An analog-to-digital converter (ADC) performs the reverse function. There are several DAC archit ...
(D/A) chips are unipolar, which means that they cannot handle
bipolar signal In telecommunication, a bipolar signal is a signal that may assume either of two polarities, neither of which is zero. A bipolar signal may have a two-state non-return-to-zero (NRZ) or a three-state return-to-zero (RZ) binary coding A binary ...
s (signals with both positive and negative values). A simple solution to this is to bias the analog signals with a DC offset equal to half of the A/D and D/A converter's range. The resulting digital data then ends up being in offset binary format. Most standard computer CPU chips cannot handle the offset binary format directly. CPU chips typically can only handle signed and unsigned integers, and floating point value formats. Offset binary values can be handled in several ways by these CPU chips. The data may just be treated as unsigned integers, requiring the programmer to deal with the zero offset in software. The data may also be converted to signed integer format (which the CPU can handle natively) by simply subtracting the zero offset. As a consequence of the most common offset for an ''n''-bit word being 2''n''−1, which implies that the first bit is inverted relative to two's complement, there is no need for a separate subtraction step, but one simply can invert the first bit. This sometimes is a useful simplification in hardware, and can be convenient in software as well. Table of offset binary for four bits, with
two's complement Two's complement is a mathematical operation to reversibly convert a positive binary number into a negative binary number with equivalent (but negative) value, using the binary digit with the greatest place value (the leftmost bit in big- endian ...
for comparison: Offset binary may be converted into two's complement by inverting the most significant bit. For example, with 8-bit values, the offset binary value may be XORed with 0x80 in order to convert to two's complement. In specialised hardware it may be simpler to accept the bit as it stands, but to apply its value in inverted significance.


Related codes

:z = \frac\left left(\sum_^n p_i \times b_i\right) - k\right/math>


See also

*
Signed number representations In computing, signed number representations are required to encode negative numbers in binary number systems. In mathematics, negative numbers in any base are represented by prefixing them with a minus sign ("−"). However, in RAM or CPU regis ...
*
Binary number A binary number is a number expressed in the base-2 numeral system or binary numeral system, a method of mathematical expression which uses only two symbols: typically "0" (zero) and "1" ( one). The base-2 numeral system is a positional notatio ...
*
Excess-3 Excess-3, 3-excess or 10-excess-3 binary code (often abbreviated as XS-3, 3XS or X3), shifted binary or Stibitz code (after George Stibitz, who built a relay-based adding machine in 1937) is a self-complementary binary-coded decimal (BCD) cod ...
*
Excess-128 In computing, signed number representations are required to encode negative numbers in binary number systems. In mathematics, negative numbers in any base are represented by prefixing them with a minus sign ("−"). However, in RAM or CPU re ...
*
Exponent bias In IEEE 754 floating-point numbers, the exponent is biased in the engineering sense of the word – the value stored is offset from the actual value by the exponent bias, also called a biased exponent. Biasing is done because exponents have to be ...
*
Excess-Gray code The reflected binary code (RBC), also known as reflected binary (RB) or Gray code after Frank Gray, is an ordering of the binary numeral system such that two successive values differ in only one bit (binary digit). For example, the representati ...
*
Ones' complement The ones' complement of a binary number is the value obtained by inverting all the bits in the binary representation of the number (swapping 0s and 1s). The name "ones' complement" (''note this is possessive of the plural "ones", not of a sing ...
*
Binary offset carrier Binary offset carrier modulation (BOC modulation) was developed by John Betz in order to allow interoperability of satellite navigation systems. It is currently used in the US GPS system, Indian IRNSS system and in Galileo and is a square sub-car ...


References


Further reading

* * (NB. Mentions Excess-3, Excess-6, Excess-11, Excess-123.) * (NB. Mentions Excess-25, Excess-250.) * (NB. Mentions Excess-32, Excess-64, Excess-128, Excess-256, Excess-976, Excess-1023, Excess-1024, Excess-2048, Excess-16384.) * {{cite web , title=Computer Arithmetic , author-first=John J. G. , author-last=Savard , date=2018 , orig-year=2005 , work=quadibloc , url=http://www.quadibloc.com/comp/cp02.htm , access-date=2018-07-16 , url-status=live , archive-url=https://web.archive.org/web/20180716102439/http://www.quadibloc.com/comp/cp02.htm , archive-date=2018-07-16 (NB. Mentions Excess-64, Excess-500, Excess-512, Excess-1024.) Numeral systems Binary arithmetic