Least significant bit

Least significant bit

In computing, the least significant bit (lsb) is the bit position in a binary integer 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 digit of a decimal integer, which is the digit in the ones (right-most) position. [http://support.microsoft.com/kb/130861]

In referencing specific bits within a binary number, it is common to assign each bit a bit number, ranging from zero upwards to one less than the number of bits in the number. However, the order used for this assignment may be in either direction (see Endianness). Both orderings are used (in different contexts), which is why "lsb" is often used to designate the units bit instead of a bit number, which has the potential for confusion.

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 stay unchanged (000 to 000).

Least significant bits are frequently employed in pseudorandom number generators, hash functions and checksums.

LSB, in all capitals, can also stand for "Least 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 least potential value.

Transmission

With 802.3 and 802.4, the least significant bit is transmitted first. [http://books.google.co.uk/books?id=kfNX516h3aQC&pg=PA32&lpg=PA32&dq=least+significant+bit+transmitted&source=web&ots=O0GlnbjVZX&sig=i0kpcld2yA8NUNbXMNIlcw0eMew&hl=en]

Computing position of least significant 1 bit of an integer

The following code example for the C language is an algorithm to compute the position of least significant 1 bit of a 64 bit integer. Operator '>>' represents 'unsigned right shift'./** * Returns the least significant bit position of n from 0 to 63. * -1 is returned if n is 0. */int leastSignificantBitPosition(unsigned long long n) { if (n = 0) return -1;

int pos = 63; if (n & 0x00000000FFFFFFFFLL) { pos -= 32; } else { n >>= 32; } if (n & 0x000000000000FFFFLL) { pos -= 16; } else { n >>= 16; } if (n & 0x00000000000000FFLL) { pos -= 8; } else { n >>= 8; } if (n & 0x000000000000000FLL) { pos -= 4; } else { n >>= 4; } if (n & 0x0000000000000003LL) { pos -= 2; } else { n >>= 2; } if (n & 0x0000000000000001LL) { pos -= 1; } return pos;}

ee also

*Most significant bit
*Binary numeral system
*Signed number representations
*Two's complement
*Bit numbering
*Endianness
*Binary logarithm
*Unit in the last place


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Least Significant Bit — Bit de poids faible Le bit de poids faible (en anglais Least Significant Bit, ou LSB) est pour un nombre binaire le bit ayant dans une représentation donnée la moindre valeur (celui de droite dans la représentation positionnelle habituelle).… …   Wikipédia en Français

  • Least Significant Bit —   [dt. »niedrigstwertiges Bit«], Wertigkeit …   Universal-Lexikon

  • Least Significant Bit — Die Bitwertigkeit bezeichnet den Stellenwert eines einzelnen Bits, den es durch seine Position innerhalb einer Binärzahl (meist Dualzahl) hat. Inhaltsverzeichnis 1 MSB 2 LSB 3 Byte Reihenfolge 4 Zahlenformat und Vorzeichenbit …   Deutsch Wikipedia

  • least significant bit — noun The bit that represents the smallest fraction of a value, its position depending on the endianness of the system. Syn: LSB Ant: most significant bit …   Wiktionary

  • least significant bit — noun Computing the bit in a binary number which is of the lowest numerical value …   English new terms dictionary

  • least significant bit — …   Useful english dictionary

  • Most Significant Bit — Die Bitwertigkeit bezeichnet den Stellenwert eines einzelnen Bits, den es durch seine Position innerhalb einer Binärzahl (meist Dualzahl) hat. Inhaltsverzeichnis 1 MSB 2 LSB 3 Byte Reihenfolge 4 Zahlenformat und Vorzeichenbit …   Deutsch Wikipedia

  • Most significant bit — In computing, the most significant bit (msb, also called the high order bit) is the bit 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… …   Wikipedia

  • most significant bit — noun The bit that represents the largest fraction of a value, its position depending on the endianness of the system. Syn: MSB Ant: least significant bit …   Wiktionary

  • Bit menos significativo — En computación, el bit menos significativo (LSB o Least Significant Bit, en sus siglas en inglés) es la posición de bit en un número binario que tiene el menor valor (el situado más a la derecha). En ocasiones, se hace referencia al LSB como el… …   Wikipedia Español

Share the article and excerpts

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