I'm just going gung-ho on the posit number operations.
I’ve been trying to implement a posit number square root function (for FPGA hardware) and it works for even exponent sizes but not for odd sizes. It has me stumped at the moment. It appears to be the size of the exponent, not the value that is causing issues.
For es = 6:
Code:
Input Square#1 Square#2 Root
xxxxxxxx 42000000 42000000 41000000
4ed171e1 4ed171e1 4ed171e1 47678e2b
4e9f7a6b 4e9f7a6b 4e9f7a6b 474a0e34
4f6a1ca8 4f6a1ca8 4f6a1ca8 47ad1b9c
*b0ef1e32 80000000 80000000 80000000
4f52510a 4f52510a 4f52510a 47a41322
*4f717615 4f717612 4f717612 47afcdd1
*b0b23190 80000000 80000000 80000000
*b08f434a 80000000 80000000 80000000
*b09f6fae 80000000 80000000 80000000
*4f40f04c 4f40f04a 4f40f04a 479d266b
*b0e14da7 80000000 80000000 80000000
*4eac47b2 4eac47b3 4eac47b3 47520241
For es = 5 (same numbers) exponent appears to be off by one, significand looks okay
Code:
Input Square#1 Square#2 Root
xxxxxxxx 44ffffff 44ffffff 426a09e6
*5da2e3c0 5ca2e3be 5ca2e3be 4e4777fc
*5d3ef4d6 5c3ef4d6 5c3ef4d6 4e1dbfe6
*5ed4394f 5fd43950 5fd43950 4fe99f79
*a1de3c63 80000000 80000000 80000000
*5ea4a215 5fa4a214 5fa4a214 4fd012cd
*5ee2ec2b 5fe2ec2b 5fe2ec2b 4ff13faf
*a1646321 80000000 80000000 80000000
*a11e8693 80000000 80000000 80000000
*a13edf5e 80000000 80000000 80000000
*5e81e098 5f81e097 5f81e097 4fbc7cd0
*a1c29b4c 80000000 80000000 80000000
*5d588f65 5c588f65 5c588f65 4e28ff4f
*5ea1d9e9 5fa1d9e8 5fa1d9e8 4fce894a
I'm comparing the square of the calculated root to the input.