Product Code Database
Example Keywords: kindle fire -tablet $70-179
   » » Wiki: Bit Numbering
Tag Wiki 'Bit Numbering'.
Tag
In , bit numbering (or sometimes bit endianness) is the convention used to identify the positions in a binary number or a container for such a value. The bit number starts with zero and is incremented by one for each subsequent bit position.


Least significant bit
In , the least significant bit ( LSB) is the position in a binary giving the units value, that is, determining whether the number is even or odd. The LSB is sometimes referred to as the right-most bit, due to the convention in positional notation of writing less significant digits further to the right. It is analogous to the least significant of a integer, which is the digit in the ones (right-most) position.

It is common to assign each bit a position number, ranging from zero to N-1, where N is the number of bits in the binary representation used. Normally, this is simply the exponent for the corresponding bit weight in base-2 (such as in 2<sup>31</sup>..2<sup>0</sup>). Although a few CPU manufacturers assign the opposite way (which is not the same as different ), the term least significant bit itself remains unambiguous as an alias for the unit bit.

By extension, the least significant bits (plural) are the bits of the number closest to, and including, the LSB.

The least significant bits have the useful property of changing rapidly if the number changes even slightly. For example, if 1 (binary 00000001) is added to 3 (binary 00000011), the result will be 4 (binary 00000100) and three of the least significant bits will change (011 to 100). By contrast, the three most significant bits (MSBs) stay unchanged (000 to 000).

Least significant bits are frequently employed in pseudorandom number generators, tools, and .


Least significant bit in digital steganography

In digital , sensitive messages may be concealed by manipulating and storing information in the least significant bits of an image or a sound file. In the context of an image, if a user were to manipulate the last two bits of a color in a pixel, the value of the color would change at most +/- 3 value places, which is likely to be indistinguishable by the human eye. The user may later recover this information by extracting the least significant bits of the manipulated pixels to recover the original message.

This allows for the storage or transfer of digital information to be kept concealed.


Least significant byte
LSB can also stand for least significant byte. The meaning is parallel to the above: it is the (or octet) in that position of a multi-byte number which has the least potential value. If the abbreviation's meaning least significant byte isn't obvious from context, it should be stated explicitly to avoid confusion with least significant bit.

To avoid this ambiguity, the less abbreviated terms "lsbit" or "lsbyte" may be used.


Most significant bit
In , the most significant bit ( MSB, also called the high-order bit) is the position in a binary number having the greatest value. The MSB is sometimes referred to as the left-most bit due to the convention in positional notation of writing more significant digits further to the left.

The MSB can also correspond to the of a signed binary number in one's or two's complement notation, "1" meaning negative and "0" meaning positive.

It is common to assign each bit a position number ranging from zero to N-1 where N is the number of bits in the binary representation used. Normally, this is simply the exponent for the corresponding bit weight in base-2 (such as in 2<sup>31</sup>..2<sup>0</sup>). Although a few CPU manufacturers assign the opposite way (which is not the same as different ), the MSB unambiguously remains the most significant bit. This may be one of the reasons why the term MSB is often used instead of a bit number, although the primary reason is probably that different number representations use different numbers of bits.

By extension, the most significant bits (plural) are the bits closest to, and including, the MSB.


Most significant byte
MSB can also stand for " most significant byte". The meaning is parallel to the above: it is the byte (or octet) in that position of a multi-byte number which has the greatest potential value.

To avoid this ambiguity, the less abbreviated terms " MSbit" or " MSbyte" are often used.

(2010). 9781118054475, John Wiley & Sons. .


Unsigned integer example
This table illustrates an example of decimal value of 149 and the location of LSB. In this particular example, the position of unit value (decimal 1 or 0) is located in bit position 0 ( n=0). MSB stands for Most Significant Bit, while LSB stands for Least Significant Bit.
Binary (Decimal: 149)10010101
Bit weight for given bit position n ( 2n )2726252423222120
Bit position labelMSB__________________LSB
Position of LSB is independent of how the bit position is transmitted (Some system transmit MSB first, others transmit LSB first), which is a question more of a topic of .


Most Significant Bit First vs Least Significant Bit First
The expressions Most Significant Bit First and Least Significant Bit First are indications on the ordering of the sequence of the bits in the bytes sent over a wire in a transmission protocol or in a stream (e.g. an audio stream).

Most Significant Bit First means that the most significant bit will arrive first: hence e.g. the hexadecimal number 0x12, 00010010 in binary representation, will arrive as the sequence 0 0 0 1 0 0 1 0 .

Least Significant Bit First means that the least significant bit will arrive first: hence e.g. the same hexadecimal number 0x12, again 00010010 in binary representation, will arrive as the (reversed) sequence 0 1 0 0 1 0 0 0.


LSB 0 bit numbering
When the bit numbering starts at zero for the least significant bit (LSB) the numbering scheme is called "LSB 0".
(1982). 9780960786404, Computeach Press Inc.
This bit numbering method has the advantage that for any the value of the number can be calculated by using exponentiation with the bit number and a of 2. The value of an unsigned binary integer is therefore
\sum_{i=0}^{N-1} b_i \cdot 2^i
where bi denotes the value of the bit with number i, and N denotes the number of bits in total.


MSB 0 bit numbering
Similarly, when the bit numbering starts at zero for the most significant bit (MSB) the numbering scheme is called "MSB 0".

The value of an unsigned binary integer is therefore

\sum_{i=0}^{N-1} b_i \cdot 2^{N-1-i}


Other
ALGOL 68's elem operator is effectively "MSB 1 bit numbering" as the bits are numbered from left to right, with the first bit (bits elem 1) being the "most significant bit", and the expression (bits elem bits width) giving the "least significant bit". Similarly, when bits are coerced (typecast) to an array of Boolean (  bool bits), the first element of this array (bits lwb) is again the "most significant bit".

For MSB 1 numbering, the value of an unsigned binary integer is

\sum_{i=1}^{N} b_i \cdot 2^{N-i}

PL/I numbers strings starting with 1 for the leftmost bit.

The function uses LSB 0 numbering.


Usage
CPUs usually employ "LSB 0" bit numbering, however both bit numbering conventions can be seen in machines. Some architectures like and Motorola 68000 use "LSB 0" bit numbering, while S/390, PowerPC and use "MSB 0".

The recommended style for Request for Comments (RfC) documents is "MSB 0" bit numbering.

Bit numbering is usually transparent to the , but some programming languages like Ada and hardware description languages like and allow specifying the appropriate bit order for data type representation.


See also
  • ARINC 429
  • Binary numeral system
  • Signed number representations
  • Two's complement
  • Unit in the last place (ULP)
  • Find first set


External links

Page 1 of 1
1

Account

Social:
Pages:  ..   .. 
Items:  .. 

Navigation

General: Atom Feed Atom Feed  .. 
Help:  ..   .. 
Category:  ..   .. 
Media:  ..   .. 
Posts:  ..   ..   .. 

Statistics

Page:  .. 
Summary:  .. 
1 Tags
10/10 Page Rank
5 Page Refs
2s Time