Least significant bit

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Lulu of the Lotus-Eaters (talk | contribs) at 19:43, 16 February 2009 (rm excess boldface). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

The binary representation of decimal 149, with the lsb highlighted. The msb in an 8-bit binary number represents a value of 128 decimal. The lsb represents a value of 1.

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.[1]

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.

See also