Offset binary

Offset binary

Offset binary,[1] also referred to as excess-K, is a digital coding scheme where all-zero corresponds to the minimal negative value and all-one to the maximal positive value. There is no standard for offset binary, but most often the offset K for an n-bit binary word is K=2^(n-1). This has the consequence that the "zero" value is represented by a 1 in the most significant bit and zero in all other bits, and in general the effect is conveniently the same as using two's complement except that the most significant bit is inverted. It also has the consequence that in a logical comparison operation, one gets the same result as with a twos' complement numerical comparison operation, whereas, in twos' complement notation a logical comparison will agree with twos' complement 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.

One historically prominent example of offset-64 ("excess 64") notation was in the floating point (exponential) notation in the IBM System/360 and System/370 generations of computers. The "characteristic" (exponent) took the form of an seven-bit excess-64 number (The high-order bit of the same byte contained the sign of the significand).[2] The IEEE Standard for Floating-Point Arithmetic (IEEE 754) uses various sizes of exponent, but also uses offset notation for the format of each precision. Unusually however, instead of using "excess 2^(n-1)" it uses "excess 2^(n-1)-1" which means that inverting the leading (high-order) bit of the exponent will not convert the exponent to correct twos' complement notation.

Offset binary is often used in digital signal processing (DSP). Most analog to digital (A/D) and digital to analog (D/A) chips are unipolar, which means that they cannot handle bipolar signals (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.[3]

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. Notice that as a consequence of the fact that the commonest offset for an n-bit word is 2^(n-1), which implies that the first bit is inverted relative to twos' complement, one need not have a separate subtraction step, but simply can invert the first bit. This sometimes is a useful simplification in hardware, and can be convenient in software as well.

Offset binary occurs so frequently in digital signal processing that many DSP chips can handle offset binary without requiring any data conversion.[4]

Table of offset binary for 4 bits, with twos' complement for comparison[5]

Offset Binary code, K=8 Decimal code Twos' complement Binary
1111 7 0111
1110 6 0110
1101 5 0101
1100 4 0100
1011 3 0011
1010 2 0010
1001 1 0001
1000 0 0000
0111 −1 1111
0110 −2 1110
0101 −3 1101
0100 −4 1100
0011 −5 1011
0010 −6 1010
0001 −7 1001
0000 −8 1000

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 XOR'ed 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.

See also


  1. ^ "Offset binary representation (Excess-K)". 
  2. ^ IBM System/360 Principles of Operation Form A22-6821. Various editions available on the WWW.
  3. ^ Chi-hau Chen (1988). Signal Processing Handbook. CRC Press. ISBN 0824779568. 
  4. ^ Application Note 9657, Intersil Corporation, 1997.
  5. ^ "Data Conversion Binary Code Formats". 

Wikimedia Foundation. 2010.

Нужна курсовая?

Look at other dictionaries:

  • Binary numeral system — Numeral systems by culture Hindu Arabic numerals Western Arabic (Hindu numerals) Eastern Arabic Indian family Tamil Burmese Khmer Lao Mongolian Thai East Asian numerals Chinese Japanese Suzhou Korean Vietnamese …   Wikipedia

  • Binary Offset Carrier — (BOC) ist ein spezielles Kodierungsverfahren zur Frequenzspreizung mit Anwendungsbereichen in der digitalen Nachrichtentechnik beim so genannten Codemultiplex. Dabei werden mehrere zu übertragene Nutzdatenfolgen durch unterschiedliche… …   Deutsch Wikipedia

  • Offset printing — Web fed offset lithographic press at speed …   Wikipedia

  • Binary-coded decimal — In computing and electronic systems, binary coded decimal (BCD) is a digital encoding method for numbers using decimal notation, with each decimal digit represented by its own binary sequence. In BCD, a numeral is usually represented by four bits …   Wikipedia

  • Binary Runtime Environment for Wireless — BREW (Binary Runtime Environment for Wireless) is an application development platform created by Qualcomm for mobile phones. It was originally developed for CDMA handsets, but has since been ported to other air interfaces including GSM/GPRS. BREW …   Wikipedia

  • Fragile binary interface problem — The fragile binary interface problem or FBI is a shortcoming of certain object oriented language compilers, in which internal changes to an underlying class library can cause descendant libraries or programs to cease working. It is an example of… …   Wikipedia

  • Fat binary — A fat binary (or multiarchitecture binary) is a computer program that is native to multiple instruction set architectures (ISA) and thus can be run on multiple processor types. The usual method of implementation is to include a version of the… …   Wikipedia

  • Compound File Binary Format — (CFBF), also called Compound File or Compound Document[1], is a file format for storing numerous files and streams within a single file on a disk. CFBF is developed by Microsoft and is an implementation of Microsoft COM Structured… …   Wikipedia

  • Quadruple-precision floating-point format — In computing, quadruple precision (also commonly shortened to quad precision) is a binary floating point computer number format that occupies 16 bytes (128 bits) in computer memory. In IEEE 754 2008 the 128 bit base 2 format is officially… …   Wikipedia

  • Double-precision floating-point format — In computing, double precision is a computer number format that occupies two adjacent storage locations in computer memory. A double precision number, sometimes simply called a double, may be defined to be an integer, fixed point, or floating… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”