Fixed-Point Square Root Calculator

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

I fiddled with the Integer Square Root Calculator a little bit, and by modifying the underlying datapath algorithm slightly, was able to double the resolution of the calculated square root. I've called the new component a "Fixed-Point Square Root Calculator." Instead of a 32-bit integer resulting in a 16-bit integer square root,  a 32-bit integer will now produce a 32-bit square root in Q16.16 format (16 integer bits and 16 fractional bits). The included datasheet has more info on how to use the fixed-point math. Here's a quick overview of the component:

   

 

   

8, 16, 24 & 32 bits.

   

In 32-bit mode, takes a 32-bit input and calculates a 32-bit fixed-point (Q16.16) square root in at most 220 cycles (slower than the Integer Square Root Calculator, but for twice the resolution!).

   

CPU-mode for easy firmware interaction, DMA-mode for HW-controlled, CPU-free operation.

   

220 cycles in 32-bit mode, 164 cycles in 24-bit mode, 108 cycles in 16-bit mode, and 52 cycles in 8-bit mode.

0 Likes
0 Replies