This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Least significant bit


c = getlsb(a)


c = getlsb(a) returns the value of the least significant bit in a as a u1,0.

a can be a scalar fi object or a vector fi object.

getlsb only supports fi objects with fixed-point data types.


The following example uses getlsb to find the least significant bit in the fi object a.

a = fi(-26, 1, 6, 0);
c = getlsb(a)

c =

          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Unsigned
            WordLength: 1
        FractionLength: 0

You can verify that the least significant bit in the fi object a is 0 by looking at the binary representation of a.



Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced in R2007b

Was this topic helpful?