LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fix point 2s complement

Is there anybody who used the Integer to Fix Point cast for a 2`s complement so far?

I've seen a lot of solution way more complicated than this one in the forum even from LabVIEW greats. It's especially great for fractional values (decimal)

What do you think?

0 Kudos
Message 1 of 3
(3,188 Views)

If you are just throwing out sentence fragments without much context, at least provide some links to the "solutions by LabVIEW greats" that you mention. Also tell us why you think they are complicated and how you suggest to simplify them.

 

What is "great for fractional values (decimal)"? (fixed point itself? 2s complement?, etc.) Fixed point is quantized to the binary resolution, so they are not that great for decimal fractions.


@Maloya wrote:

What do you think?


I think I have another coffee. 😄

0 Kudos
Message 2 of 3
(3,144 Views)

Given enough bits for the decimal, fixed point can handle them pretty well.

 

Here's the problem the OP is likely running into: maintaining the decimal values from fixed point means you're going to need to work with a floating point of some sort.  These are never twos complement.  That's a system strictly for integer types.  Floating point is broken into three sections: sign, exponent offset, and mantissa.  You'll need to convert your fixed point data into this format.  This is likely why you're finding the code to do so complicated.

0 Kudos
Message 3 of 3
(3,051 Views)