IPA IP 2026 Question 74
A question IPA Japan published in 令和8年度 ITパスポート試験 公開問題 問74, translated into English. ITPEC is based on the same exams.
Spreadsheet software is used to calculate the sum of two binary numbers α and β. The number of digits of α and β is limited to 2, and the values of the digits are entered in cells B3 and C3, and in cells B4 and C4, in the order of the 2’s place and the 1’s place. The worksheet is an example where the binary numbers are α = 10 and β = 11. The result is to be displayed in cells A5, B5 and C5 in the order of the 4’s place, the 2’s place and the 1’s place. Cell B2 is used to store information on the carry from the 1’s place, and the expression IF(C3+C4=2,1,0) is entered in it. Which of the following is the expression that is entered in cell B5?
Explanation
B5 shows the total of B2:B4 if it is below 2, 0 if it is 2, and 1 if it is 3 — the 2’s place adds three bits, and only the low bit of their total belongs in B5.
B2 holds the carry from the 1’s place: 1 only when C3 and C4 are both 1. In the 2’s place three bits are added, the carry in B2 and the digits in B3 and B4, so SUM( is 0, 1, 2 or 3:
So B5 is the total itself when it is less than 2, 0 when it equals 2, and 1 otherwise. In the example B2 = 0, B3 = 1 and B4 = 1 give a total of 2, so B5 shows 0; with A5 = 1 and C5 = 1 the result is 101, and indeed 2 + 3 = 5.
Answer (a)
Why not others:
- •(b) — swaps the last two values: a total of 2 (binary 10) has 0 in the 2’s place, not 1, and a total of 3 (binary 11) has 1, not 0
- •(c) and (d) — test for a total greater than 2, so a total of 3 is displayed as 3, which is not a binary digit, and a total of 0 or 1 falls through to the inner IF and is replaced by a constant (0 shows as 1 in (c), 1 shows as 0 in (d))
Key rule: When bits are added in one place, the digit is the total mod 2 and the carry is 1 when the total is 2 or more: this is a full adder.
Software · AI-written, may contain errors
This question comes from the past questions IPA Japan publishes, translated into English by ITPEC Practice. ITPEC Practice is an independent study tool and is not affiliated with IPA or ITPEC. See the original paper (PDF) or Report an issue.