expresses the desired relation between q d c and r in our first technique called technique a we use variables q r and c the invariant for these variables is wherein the variable q represents the quotient calculated u201c thus far u201d and r represents the remainder u201c thus far u201d technique a appears below note that conditions b 0 through b 3 are defined later when we represent r and c by binary numbers we can easily implement the statements r r 2 c c 2 by shift operations on r and c we use the variable n to count the number shifts on c the initialization q 0 c c r r establishes invariant 4 before the start of the iterations in technique a maintains invariant 4 irrespective of the conditions b 0 through b 3 for example if 4 holds before statement r r d q q u2212 c then after execution of this statement we have note that b 0 through b 3 can be selected in a number of different ways the following choices yield technique a the choice for the termination condition b 0 can be explained as follows because of the initial conditions on r and d and the conditions b 1 through b 3 technique a has as additional invariant notice that none of the statements in the repetition violates invariant 5 technique a is guaranteed to terminate because each repetition step without a shift operation is followed by a repetition step with a shift operation in other words a repetition step with a subtraction and addition.