PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use integer in case structure on FPGA

Hi there,
 
I was trying to use a case structure on FPGA module. The input to case selector terminal could be arbitrary integer like 0x1EEE or 0x2000 or 0x3FFF. Since I cannot find integer-string conversion on FPGA, how can I do it? Thanks
0 Kudos
Message 1 of 4
(3,183 Views)

Hello!

If you want to create a case structure to handle arbitrary integer values, you can always use the decimal representation of the hex value (i.e. instead of 0x00FF, use 255).  If you want to create cases for the hex values, you can right-click on the case structure, and choose Radix>>Hex.  You should notice that all cases are now preceded with an 'x' to denote hex values.  This will allow you to create cases called x00FF, which sounds like what you're looking for.

Cheers,

Matt Pollock
National Instruments
0 Kudos
Message 2 of 4
(3,170 Views)
Thanks for the reply. I tried what you said. But the case structure changed to string type, which looks like is NOT supported on FPGA module.
0 Kudos
Message 3 of 4
(3,165 Views)
It looks like the case structure for some reason doesn't like the leading zeros.  If you just enter FF  (after changing the radix) it will leave it as an integer type. 
0 Kudos
Message 4 of 4
(3,153 Views)