LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Single Cycle Time Loop

Keeping the constant as an I32 is using less memory.  With the coercion, you are actually adding an extra byte to the memeory (the initial I8).  Though, the compiler will turn that all into an I32 constant anyways.  But it just looks bad having the conversion straight off of a constant.

 

Keeping track of the array index is simple.  Just use a shift register.  The only remotely difficult part is taking care of the rollover, which is simply a comparison with a select.


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 11 of 13
(404 Views)

@crossrulz wrote:

Keeping the constant as an I32 is using less memory.  With the coercion, you are actually adding an extra byte to the memeory (the initial I8).  Though, the compiler will turn that all into an I32 constant anyways.  But it just looks bad having the conversion straight off of a constant.


I would be surprised if the FPGA compiler will retain the array index as I32 and carry it aournd as 32bits in the fabric. Since we have fixed sized array of 20 elements, it would only need 5 bits for the index. Just wondering...

0 Kudos
Message 12 of 13
(396 Views)

@altenbach wrote:

@crossrulz wrote:

Keeping the constant as an I32 is using less memory.  With the coercion, you are actually adding an extra byte to the memeory (the initial I8).  Though, the compiler will turn that all into an I32 constant anyways.  But it just looks bad having the conversion straight off of a constant.


I would be surprised if the FPGA compiler will retain the array index as I32 and carry it aournd as 32bits in the fabric. Since we have fixed sized array of 20 elements, it would only need 5 bits for the index. Just wondering...


You are likely correct.  But, as I stated already, the compiler will constant fold it anyways.  FPGA is a different beast, but some of these priciples remain the same.


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 13 of 13
(392 Views)