Square root implimented. To get square root, only the input labeled Root should be a 1. If Rem. is also a 1, then it will display the remainder, i.e. (Input - Root^2).
The circuit should be able to square root a 16 bit number, but for some reason, if the number is greater than 2^14, it doesn't work properly, not sure why?
So the input is limited to a 14bit number.
The implimentation uses the "non-restoring square root algorithm", and all function relating to sqrt is contained within the sub circuit called "Square Root". The inputs to this block are a 16 bit number on A[15..0], and a control bit called Rem. . The output in a 9 bit number on Q[8..0].
If Rem is 0, then the Integer Root is displayed on Q[0..7], while Q8 = 0. If Rem is 1, then the Remainder is displayed on Q[8..0].
The algorithm loops 8 times to find the correct answer, and each pass is handled by a circuit called "Part. Root". There are 8 partial root blocks chained together to make the loop.
If anyone can work out why it doesn't work for 15 and 16bit numbers, that would be helpful. There is a reference to the algorithm that i used here: http://citeseerx.ist.psu.edu/viewdoc/do ... 1&type=pdf
8 X 8 Binary Multiplier
Re: 8 X 8 Binary Multiplier
- Attachments
-
- Logic Gate Calculator.zip
- Logic Gate Calculator, with SQRT function.
- (382.34 KiB) Downloaded 1503 times
Re: 8 X 8 Binary Multiplier
Square root is now fixed. I am using a different, much simpler version of the non-restoring square root algorithm. It is a much more refined version which requires far fewer logic gates.
SQRT now also works for 16 bit numbers.
SQRT now also works for 16 bit numbers.
Re: 8 X 8 Binary Multiplier
This is awesome
Re: 8 X 8 Binary Multiplier
I am not able to work the Square Root subcircuit. Can you help me please?