Question 16
From the same digital algorithm we discussed in class and on a quiz below:
0/10 points
1. What solitary change in the algorithm below is needed such that the objective takes an n bit integer,
A, and divides it by 19 rather than what is done from the below algorithm we discussed in class?
2. How many iterations would this algorithm repeat Step II if A=153
I. Choose any n bit binary integer, A, where n is any integer from 1 to ∞.
II. Add binary number 11110110 (if n>8 just add more leading 1s) to the n bit integer A
III. If a carry bit results from the above Step II addition and thus creates a n+1st bit, repeat Step II with just the least significant n
bits of the binary addition result as a new and replaced A value that is composed of just n bits.
Hints: Choose a few examples to test limiting n<4 or 5 and feel free to use a calculator!
In other words, extract and leave out the n+1st carry bit of "1" where the new A is just the remaining n bits.
Do NOT repeat if there is no carry bit and do not change A to the final addition result from successively looping Step II.
Select 2 correct answer(s)
1. Remove the Roman numeral III requirement and ignore any carry results.
2. If A is chosen to be 153, Step II would repeat 8 times.
2. If A is chosen to be 153, Step II would repeat 9 times.
1. Change Step II to :
Add binary number 11001100 (if n>8 just add more leading 1s)
2. If A is chosen to be 153, Step II would repeat 4 times.
1. Modify the Roman numeral III requirement to continue the algorithm looping if there is an auxiliary
carry from the low nibble to the high nibble.
2. If A is chosen to be 153, Step II would repeat 13 times.
1. Change Step II to :
Add binary number 11110101 (if n>8 just add more leading 1s)
2. If A is chosen to be 153, Step II would repeat 18 times.
2. If A is chosen to be 153, Step II would repeat 19 times.
1. Change Step II to :
Add binary number 11101101 (if n>8 just add more leading 1s)
1. Change Step II to :
Add binary number 10010001 (if n>8 just add more leading 1s)
1. Change Step II to :
Add binary number 00011001 (if n>8 just add more leading 1s)