LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unconnected index inputs for "index array" in Labview FPGA?

I want to extract individual bits from an U32 control. I first convert the U32 with "number to boolean array". Then I connect the boolean array to an "index array" with unconnected index inputs. Will it make any difference if I connect constant values to the index inputs? From the help for "Index array function": "This function executes in one clock cycle, unless you wire a constant immediately into the index input, in which case the selection occurs at compile time and the function requires no clock cycles." Is the compiler smart enough to handle the unconnected index inputs as constants? I see absolutely no reason for wiring constants to the index inputs, except for the notice in the help.
0 Kudos
Message 1 of 6
(2,482 Views)

Leaving unconnected or attaching a constant should be equivalent.

Message 2 of 6
(2,467 Views)

Okay I think (think) what it is trying to say is this.

 

If you wire to the index array function from another function, then it will take one clock cycle.  For example if you wire the output of an add function to the index terminal, then the compiler cannot know what the result of the add is until it is ran.  So it takes one clock cycle.

 

If you wire a constnat to the index array function the compiler can know exactly what you want, and do it in no clock cycles.

 

If you don't wire anything to the index array function, it behaves like you wired a constant of 0, and because it can know exactly what you want, it can do it in no clock cycles.

0 Kudos
Message 3 of 6
(2,462 Views)

As the others have said, nothing wired is the same as a constant for the index.  What the help is saying is you will use a clock cycle (and gates) if you wire in a variable of some sort to the Index.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 6
(2,451 Views)
Thank you for your answers! I agree that it should be as you say, so I hope it is only a misleading help text. A complete description will be more complicated. An unconnected index input is not always a constant. If one index input is connected to a variable, all the following unconnected index inputs will also be variable.
0 Kudos
Message 5 of 6
(2,417 Views)

@LaForge wrote:
Thank you for your answers! I agree that it should be as you say, so I hope it is only a misleading help text. A complete description will be more complicated. An unconnected index input is not always a constant. If one index input is connected to a variable, all the following unconnected index inputs will also be variable.

True, but I think what matters is if the compiler can determine at compile time which index is used (although the help does not explicitely say so). If the compiler finds the index is constant it will be a free operation on the FPGA.

0 Kudos
Message 6 of 6
(2,409 Views)