Real-Time Measurement and Control

Showing results for 
Search instead for 
Did you mean: 

passing complex numbers from host to FPGA

Hey there,


I am using the chassis cRIO-9004 and want to pass data from host code to the FPGA. I did this earlier on in my application by writing to a control on the FPGA panel and successivley updating the control value. (Single control in order to prevent usage of large array's in FPGA). Once read from the FPGA control I stored the data in RAM. 


The theory behind this is fine and it works but the problem i now have is that I want to pass a complex number through to the FPGA. I could do this by splitting the number and passing it  to 2 different controls in the FPGA but I was wondering if this is necessary. 


I was reading something about the usage of split/join number VI's. Is this possible? Could I join the real and imaginary parts and then split them again in the FPGA? However the input to this VI is integer only.... Is there a way around this?


What would your advice be?


Thanks very much, 


0 Kudos
Message 1 of 6
I have a question; why are you passing complex numbers to the FPGA? What are you going to do with that data on the FPGA that you can't do on the host side?
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 2 of 6

I am performing a cross-correlation of 2 signals within the FPGA. To save on gates I have performed the FFT of the known signal on the host code. This can then be passed to the FPGA which can then be multiplied with the FFT of the unknown signal and so on....


It is desired to be done on the FPGA in order to utilise the parallel computation which is characteristic of the FPGA (real time system). Im not to worried about the timing in the host code of finding the first FFT as it only needs to occur once to pass into FPGA memory.....


So idea's?


0 Kudos
Message 3 of 6



You are on the right track, the FPGA does not support a complex data type. If you would like to save space by passing it just one integer then you can indeed use the split and join functions to pass both the real and imaginary part as one integer. Use the join function to combine them on the host, each half can be a max of U32. Just make sure to change each of these to the correct representation size so that the join and split match.




Anna K.

National Instruments
0 Kudos
Message 4 of 6
Yes I was aware of that but is there a way of passing a fixed point number from host to FPGA?
0 Kudos
Message 5 of 6

Yes, you may do this by writing to a control on your FPGA Front Panel. You can use the Read/Write Control VI.



National Instruments
0 Kudos
Message 6 of 6