Research Article
A Bitwise Design and Implementation for Privacy-Preserving Data Mining: From Atomic Operations to Advanced Algorithms
Algorithm 2
Positive binary division operation.
| Input: divisor M, dividend Q | (1) | Shift the AQ to the left by one bit and let the upper l bit of AQ at A. | (2) | Calculate AM and put it in A. | (3) | If A is negative, the last bit of AQ becomes 0 and A M is calculated and put it in A to return to the value before step 2. | (4) | If A is positive or zero, the last bit of AQ is 0. | (5) | The count value is decremented by 1. | (6) | If the count is not 0, the algorithm goes to step 1 and the algorithm is progressed. | (7) | If the count value is 0, the result of algorithm is output (the lower l bit of AQ becomes the quotient and the upper l bit becomes the remainder). |
|