Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Let and be two nonnegative integers, represented in binary. Assume for concreteness that there are no leading zero s in the binary representations; for example
Let and be two nonnegative integers, represented in binary. Assume for concreteness
that there are no leading zeros in the binary representations; for example the number three
is represented as and not as If you prefer, you can assume that the numbers are
represented in decimal and answer the problem for decimal addition and division operations,
it wont change the answer.
Addition. A standard algorithm for adding x and y produces the sum x y by working
from loworder bits to highorder bits of each number. A carry bit is initially set to
The algorithm iteratively produces an output bit from the carry and two bits of x and y
or just one of these if all bits of the other have already been considered and updates
the carry. Once all bits of xand y are considered, if the carry is then a final highorder
is output.
a marks Give a tight big bound on the running time of this algorithm as a
function of and Justify your answer. You may assume that you can access the
bits of the numbers in constant time ie you can get the value of the ith bit for
any i
b marks Which categories does the running time of the standard addition algorithm
belong to Choose as many as apply. Your justification for your choices need
not consider all options separately; may be able to justify your choices across a
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started