IF-RIO

cancel
Showing results for 
Search instead for 
Did you mean: 

I16 U16 FPGA

Hi all,

 I confused myself with the I16 and U16 data representation. Here is how I think about those representations.
 Both the representation use the binary-complement storage. When I convert and I16 to U16, no change is made to the actual storage. Therefore, it does not matter what type I use in the vi as long as I use either U16 or I16.
 Now take an example.  Say, I had a -300 stored in I16 in the host VI. I converted it to U16, and then passed the converted value into a Control of a FPGA vi with type I16. Then I passed the value to the DAC output. I could still get a analog output corresponding to -300/8192. (ignore those upconversion...)
  Am I right? I would really appreciate your comments.

David
0 Kudos
Message 1 of 2
(6,688 Views)
Hi David,
            When you are converting from I16 to U16 format you are only changing the way the 16 bits are represented. Taking your example, -300 in I16 has the same bit representation as 65236 in U16 and there is no change in the bits themselves. When you are passing this U16 number to the control of another vi which is of type I16, this number is getting typecast to I16 and hence you are getting back -300. This is the reason why you are able to get analog output corresponding to scaled version of -300. I am attaching a vi to illustrate what I have stated above. Hope this explains your observation.

-Ananth
0 Kudos
Message 2 of 2
(6,340 Views)