Forum: Projekte & Code Integer division, Reciprocal of an integer value, Kehrwert eines integers


von Detlef _. (detlef_a)


Angehängte Dateien:

Lesenswert?

The attached algorithm in plein C calculates the reciprocal of a 16 Bit 
integer value. It is efficient and well suited for FPGA implementation. 
For details see comments in file. The implementation relates to
Beitrag "Division mittels Array umgehen - Problem: großer Zahlenbereich" .

Comments/remarks very welcome.

math rulez!

Cheers
Detlef

von Detlef _. (detlef_a)


Angehängte Dateien:

Lesenswert?

Here is another integer division implementation: unsigned 32 Bit divided 
by unsigned 16 Bit, result must fit in 16 Bit.

The routine is lightweight (90 Byte on PIC, quarter of the former 
routine) and trades space for time. It needs no multiplies and is as 
well suited for FPGA. The routine is no big deal, it mimics division in 
handwritten form for binary numbers.

Cheers
Detlef

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.