LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with Quotient & Remainder in FPGA

The fpga can't use the Quotient & Remainder that's right? , how can i do the same operation without Quotient & Remainder.

 

 

And another question, the fpga doesn't support the tome stamp type of data???

0 Kudos
Message 1 of 7
(3,847 Views)

Hi Cristina,

 

how can i do the same operation without Quotient & Remainder.

Depends on the numbers you want to have quotient&remainder with!

With powers of 2 you can use simple boolean operations (AND/OR) and shift operations.

With "random" numbers you can do, what you have learned back in primary school

 

fpga doesn't support the tome stamp type

What do you need timestamps for on FPGA?

Hint: the FPGAS can count clock cycles very easily…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(3,830 Views)

I want to do that u have learned back in primary schhol as you say, but, with the divisoin block i obtain a decimal number, for example if i divide 5 betwwen 3 the result is 1,5 and i want that the result will be 1 for then calculate the remaind.

 

 

How can i count the cycle in fpga?

 

 

Sorry, i'm new in labview

0 Kudos
Message 3 of 7
(3,824 Views)

I want implamentate this, i want know the time that the program has been running, because i need this time (in second) to multiply it by deg/s and obtain the deg

 

 

0 Kudos
Message 4 of 7
(3,820 Views)

Hi Cristina,

 

if i divide 5 betwwen 3 the result is 1,5

How do you get 1.5 as result of 5/3???

You seem to use different math than me…

 

  i want that the result will be 1 for then calculate the remaind.

Using the algorithm I linked to before will give you this answer!

while N  D do
  N := N  D
end
return N

All you need to do is to count the number of subtract operations to get the quotient…

 

How can i count the cycle in fpga? Sorry, i'm new in labview

Then you should take the beginner courses and all those AppNotes related to LabVIEW RealTime and LabVIEW FPGA module!

Counting cycles is easy: use a loop (SCTL) and count it's iterations…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 7
(3,811 Views)

Sorry, 1,66666 ....

 

 

0 Kudos
Message 6 of 7
(3,805 Views)

As we stated in your other thread, the Quotient & Remainder is supported on the FPGA.  However, it uses multiple cycles to complete and it therefore cannot be put into a Single Cycle Timed Loop (SCTL).

 

Now as far as counting time, you can simply use a shift register to keep a counter.  If on a SCTL, then you know what the loop rate is.  You can do simple math from there.


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 7 of 7
(3,786 Views)