Least significant bit

From Infogalactic: the planetary knowledge core
(Redirected from Least significant byte)
Jump to: navigation, search
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]

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 231..20). Although a few CPU manufacturers assign bit numbers the opposite way (which is not the same as different endianness), 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, hash functions and checksums.

Least significant byte

LSB can also stand for least significant byte[citation needed]. 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. 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" are often used.

See also

References