Apex › Storage & databases

How calculators do trig (CORDIC)

How a pocket calculator or an FPGA with no multiplier computes cos and sin — with only bit-shifts and additions. cos θ and sin θ are the coordinates of a unit vector at angle θ, so CORDIC rotates a vector to θ by a fixed sequence of micro-rotations whose tangents are powers of two (each a shift-and-add), choosing + or − to home in like a binary search; a constant gain K≈0.6073 is cancelled by starting at (K,0). Real CORDIC, verified to five digits. Turn the dial and watch the vector spiral to your angle.

More in Storage & databases