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.
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.
10-21-2018 08:37 PM
Hi,
I am developing a Labview calculator to decode the HEX & Binary to decimal number by using below formula.
The decimal number I got is round to the middle of digital signal. It is possible to round the decimal number to ceiling and floor?
Thank you.
Solved! Go to Solution.
10-21-2018 08:41 PM
Can you attach some LabVIEW code so we can understand how your question relates to LabVIEW?
I don't know what you mean by "round to the middle of a digital signal."
LabVIEW has several rounding functions that round down, round up, and round to nearest.
10-21-2018 09:44 PM
I have an example:
U9.1.8
By entering the Integer and Fractional bits, my calculator is getting decimal number of 0.78125. However, if i am using others tool, the result is 0.77902.
I am not sure can I get the exact decimal number or not.
10-21-2018 09:51 PM
Your latest post made things even less clear. What is "U9.1.8"? How does any of this relate to the digital signal you showed in the first post?
10-21-2018 09:59 PM
U9.1.8
U = Unsigned
9 = Total bits
1 = Integer bits
8 = Fractional bits
The example shows decoding from the above format from HEX code (C8) to decimal number.
I am thinking whether can decode the decimal number to nearest to ceiling / floor number.
10-22-2018 01:24 AM - edited 10-22-2018 01:35 AM
Hi Juliana,
your result seems to be correct:
Or try this:
(<+,9,1> is the LabVIEW term for a FXP of your U9.8 type.)
When you want to get the next possible values of your FXP numbers you need to count up/down your input value for one LSB…
However, if i am using others tool, the result is 0.77902.
Which other tools do you use?
How do they calculate their results?
10-22-2018 02:28 AM
Hi GerdW,
Thanks for the reply.
Actually i also not too sure what tools they (other team) are using.
May i know what tool that you are using to get 0.77902?
Thanks.
10-22-2018 02:35 AM
Hi Juliana,
Actually i also not too sure what tools they (other team) are using.
Why don't you ask "them" - whoever that is?
May i know what tool that you are using to get 0.77902?
As you can see from my images I get the same value of 0.78125 as you do.