Timeline for Fixed point scaling; float -> Q31 -> float
Current License: CC BY-SA 4.0
12 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 19, 2022 at 21:04 | comment | added | Dan Boschen | Why the downvote?? I wish people would explain what the issue is when they do that | |
| Dec 18, 2022 at 17:30 | comment | added | Dan Boschen | Yes I see! Thank you. Tricky stuff | |
| Dec 18, 2022 at 16:15 | comment | added | robert bristow-johnson | $$-2^{N-1} \times -2^{M-1} = +2^{N+M-2}$$ for an $(N+M)$-bit word, the bits will be 01000000000000000000000000000000, There is no redundancy on the left. in order for this to fit in an $(N+M-1)$-bit word the positive result must be less than $2^{N+M-2}$. But it's not. | |
| Dec 18, 2022 at 16:10 | comment | added | robert bristow-johnson | not quite, @DanBoschen. | |
| Dec 18, 2022 at 15:54 | comment | added | Dan Boschen | yes, I see.... thank you. The exponent is indeed M+N but the maximum positive number we can support is 2^(M+N) -1...which doesn't fit. Got it. | |
| Dec 18, 2022 at 15:50 | comment | added | robert bristow-johnson | In all cases, except that single corner case, the two most significant bits of the $N+M$ bit resulting word are identical. For a negative number they are both 11 and for a non-negative number they are both 00. So, except for the corner case, a word size of $N+M-1$ suffices. The one and only exception (let's assume Q31) is $-1.0 \times -1.0 = +1.0$ which doesn't quite fit. in the $N+M$ bit result, the two MSBs are 01. | |
| Dec 18, 2022 at 15:43 | comment | added | Dan Boschen | Then I think your corner case would still be M+N-1 bits for multiplying signed values, wouldn't it? Your case given would result in an exponent of N+M-2, but worst case would be (-2^(N-1) x (2^M-1)) with an exponent close to N+M-1...am I missing something? | |
| Dec 18, 2022 at 15:33 | comment | added | robert bristow-johnson | yes. i always include the sign bit and "$N$ bits" means the entire word width. | |
| Dec 18, 2022 at 15:31 | comment | added | Dan Boschen | When you say a "signed N bit number", are you including the sign bit? So for example, a signed 16 bit number can represent integers from -2^15 to +2^15-1... | |
| Dec 18, 2022 at 1:46 | history | edited | robert bristow-johnson | CC BY-SA 4.0 | edited body |
| Dec 18, 2022 at 1:25 | history | edited | robert bristow-johnson | CC BY-SA 4.0 | added 132 characters in body |
| Dec 17, 2022 at 23:37 | history | answered | robert bristow-johnson | CC BY-SA 4.0 |