Skew binary number system must be the first non-zero least significant digit. In this case 15 is written canonically as 1000. Skew binary representations of the numbers from 0 to 15 are shown in following table: The advantage of skew binary is that each increment operation can be done with at most one carry operation. This exploits the fact that formula_3. Incrementing a skew binary number is done by setting the only two to a zero and incrementing the next digit from zero to one or one to two. When numbers are represented using a form of run-length encoding as linked lists of the
Binary GCD algorithm Binary GCD algorithm The binary GCD algorithm, also known as Stein's algorithm, is an algorithm that computes the greatest common divisor of two nonnegative integers. Stein's algorithm uses simpler arithmetic operations than the conventional Euclidean algorithm; it replaces division with arithmetic shifts, comparisons, and subtraction. Although the algorithm was first published by the Israeli physicist and programmer Josef Stein in 1967, it may have been known in 1st-century China. The algorithm reduces the problem of finding the GCD by repeatedly applying these identities: The algorithm requires O(n) worst-case time, where n is the number of bits in the larger of