![]() |
![]() |
#1 |
"Mihai Preda"
Apr 2015
2·691 Posts |
![]()
Hi, I would like to ask for confirmation about the correct way to compute the residue.
Let's consider this simplified example: N words. bits-per-word == 10 everywhere. In non-balanced representation ("wnb"), word values are 0 everywhere except: wnb[N-2] == 1023 wnb[N-1] == 1023 In balanced representation ("wb"), this becomes 0 everywhere except: wb[N-2] == -1 wb[N-1] == 0 wb[0] == 1. In this situation, should the 64bit residue be 1 or 0? Thanks! |
![]() |
![]() |
![]() |
#2 | |
(loop (#_fork))
Feb 2006
Cambridge, England
33×239 Posts |
![]() Quote:
|
|
![]() |
![]() |
![]() |
#3 |
"Mihai Preda"
Apr 2015
25468 Posts |
![]() |
![]() |
![]() |
![]() |
#4 | |
∂2ω=0
Sep 2002
República de California
112×97 Posts |
![]() Quote:
/* If most-significant digit in the balanced-representation form is < 0, add the modulus to the residue. For Mersenne (2^p-1) and Fermat (2^p+1) moduli, can combine this with the normalize-to-nonnegative-digit step (which we do in any event) by simply initializing the carry into the latter to -1 or +1, respectively: */ Once the carry has been set thusly, we feed it into an upward loop starting from the low residue word, which does several things at once: o On-the-fly normalizes each word to nonnegative-digit representation (taking account of the IBDWT's variable wordsize, obviously); o propagates the resulting carries upward; o counts #bits accumulated and exits when this is >+ 64. In your example, loop 1 would set cy = -1, which would cancel the low-word 1 in the first pass of loop 2, yielding 0. |
|
![]() |
![]() |
![]() |
#5 |
"Mihai Preda"
Apr 2015
2·691 Posts |
![]()
Yes, everything is clear now, thank you!
|
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
CudaLucas correct config | jpalo | GPU Computing | 8 | 2017-08-06 15:35 |
How to manually correct CPU GHz in prime net | laich2 | PrimeNet | 6 | 2012-01-16 04:51 |
Are these commands correct? | jasong | Linux | 2 | 2007-10-18 23:40 |
correct me. | Washuu | Math | 3 | 2005-05-25 09:04 |
ARE THE ODDS CORRECT..Please help | lpmurray | Lounge | 4 | 2005-02-09 10:38 |