Skip to Main Content Skip to Search
Product Documentation

getlsb - Least significant bit

Syntax

c = getlsb(a)

Description

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.

Examples

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 =
 
     0

          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.

disp(bin(a))

100110

See Also

bitand | bitandreduce | bitconcat | bitget | bitor | bitorreduce | bitset | bitxor | bitxorreduce | getmsb

  


Free Early Verification Kit

Learn how to apply early verification to your development process through these technical resources.

How much time do you spend on testing to ensure implementation meets system-level requirements?

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS