Talk:Least significant bit

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject Computing  
WikiProject icon This article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
 ???  This article has not yet received a rating on the project's quality scale.
 ???  This article has not yet received a rating on the project's importance scale.
 

"In computing, the least significant bit (LSB) is the bit position in a binary number having the value of 1."

Not for a floating point number. Right? - Omegatron 19:01, Jan 27, 2005 (UTC)
Correct. Would the following be a better wording? "In computing, the least significant bit (LSB) is the bit position in a binary number having the integer value of 1." Would it be appropriate to mention floating point here? Or would that be too much of a diversion from the topic? Jimwilliams57 02:34, Jan 28, 2005 (UTC)

Transmission convention[edit]

Is the LSB transmitted first or the MSB? For instance, to transmit the decimal number 1, transmission could be either:
LSB first --> 10000000 --> High-Low-Low-Low-Low-Low-Low-Low
or
MSB first --> 00000001 --> Low-Low-Low-Low-Low-Low-Low-High Anwar (talk) 22:16, 20 May 2008 (UTC)

This question is related to Endianness. Network enddianness is usually big-endian, or MSB first. C xong (talk) 06:01, 2 March 2010 (UTC)

If Else Implementation[edit]

I don't know why would someone post the current implement with 7 if statements. You can easily implement a one-liner with n & ~(n - 1) for unsigned types.

It is commonly known that n & (n - 1) remove the least significant bit in an unsigned type. Using this, you can logically proof the one-liner I presented.

leastbit = n & ~(n & (n - 1));
// bring the ~ into the parenthesis. (Distributivity)
leastbit = n & (~n | ~(n - 1));
// distribute n into the parenthesis. (Distributivity)
leastbit = (n & ~n) | (n & ~(n - 1));
// n & ~n cancel out
leastbit = 0 | (n & ~(n - 1));
// ORing zero does nothing so it can be removed
leastbit = n & ~(n - 1);

--Voidvector (talk) 21:45, 30 October 2008 (UTC)

LSB or lsb ?[edit]

LSB (all capitals) is generally used to indicate least significant bit in many fields (such as data converters).

The acronym LSB, with the meaning of least significant bit, is defined in the authoritative IEC 60050 Electrotechnical Vocabulary (IEV number 723-10-12, [1]). This article, instead, encourages implicitly the use of lsb (and not LSB) to indicate least significant bit. This is wrong. Somewhere (such as [2]) the use of LSB with the meaning of least significant byte is indicated as rare.

The distinction between lsb and LSB made in this article in sensible. However, as a matter of fact, LSB is used with two different meanings, and this should be reflected clearly in the paper. --Adnadn (talk) 20:09, 2 October 2009 (UTC)