If your algortihm gets both the square root and the remainder, you can do a TB that performs the inverse operation, that is:
Given N
, your algorithm gets q
(integer square root of N
) and r
(integer remainder)
So for correctness, your TB must check that q*q+r
equals N
for every N
within the range defined by the number of bits N
has