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.
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.
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.
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?
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.
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?
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.
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.