| Fixed-Point Toolbox™ | ![]() |
c = bitcmp(a)
c = bitcmp(a) returns the bitwise complement of fi object a. If a has a signed numerictype, the bit representation of the stored integer is in two's complement representation.
bitcmp only supports fi objects with fixed-point data types. a can be a scalar fi object or a vector fi object.
This example shows how to get the bitwise complement of a fi object. Consider the following unsigned fixed-point fi object with a value of 10, word length 4, and fraction length 0:
a = fi(10,0,4,0); disp(bin(a)) 1010
Complement the values of the bits in a:
c = bitcmp(a); disp(bin(c)) 0101
bitand, bitget, bitor, bitset, bitxor
![]() | bitandreduce | bitconcat | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |