From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Dragis

Fixed Point Support In Split and Join Numbers Primitives

Status: Declined

Any idea that has received less than 6 kudos within 6 years after posting will be automatically declined.

I use fixed point values quite a bit, and i do find myself splitting and joining them quite often when I have to roll my own low-level, optimized operations. 

 

The fixed point type is (generally) treated as an arithmetic type (e.g. floating point) rather than a logical type (e.g. integers). The (default) configuration should maintain this behavior.

 

split.png

What I would have found most useful is having Split cut the value in half and return the two properly configured fixed point values. Join would take two adjacent fixed point types and glue them together into one value. This definition would actually make Join equivalent to adding the two values.

 

Split could take an optional split location which dictates the binary point at which the values are split apart. I suggest defining the value as the location of the lsb (least significant bit) of the high part. In the example, the value would be 0 to get the equivalent behavior. This terminal would require a (immediately computable) constant wired to it since the fixed point output types can't be computed until this value is known.

 

 

2 Comments
Intaris
Proven Zealot

How would you split a 15-bit FXP?  I think the splitting needs to be choosable, like 10 and 5 in this case.

 

In fact, I don't see why the split and join primitives shouldn't ALWAYS allow custom splitting if required.  Of course default would be as it is now.

Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 6 kudos within 6 years after posting will be automatically declined.