next up previous
Next: Up: Previous:

Example: Binary Counter A[0,...,k-1]

A[0] is the low-order bit.

A[k-1] is the high-order bit.

   Increment(A)
      i = 0
      while i < length(A) and A[i] = 1
         A[i] = 0
         i = i+1
      if i < length(A)
      then A[i] = 1


next up previous
Next: Up: Previous: