When two n-bit binary numbers are added the sum will contain at the most, ISRO…
2017
When two n-bit binary numbers are added the sum will contain at the most, ISRO 2017
- A.
n bits
- B.
(n + 3) bits
- C.
(n + 2) bits
- D.
(n + 1) bits
Attempted by 262 students.
Show answer & explanation
Correct answer: D
When adding two n-bit binary numbers, the maximum value for each is 2^n - 1. The sum of two such numbers is (2^n - 1) + (2^n - 1) = 2^{n+1} - 2. This value requires n + 1 bits to represent in binary because the addition can produce a carry out from the most significant bit. Thus, the sum contains at most n + 1 bits.
A video solution is available for this question — log in and enroll to watch it.