GATE / CS ARCHIVE

GATE CSE 1991 / QUESTION 1(iii)

Population count of a hexadecimal expression

Digital Logic · Number Systems & Computer Arithmetic · Full GATE CSE 1991 paper

GATE 1991, Q1(iii) 2 marks · Other
Report issue

Number Systems & Computer Arithmetic

Question 1(iii), GATE 1991: Count binary ones in the number. Forum prints 9×16³+7×16²+5×16+3; GFG instead appears to use plus signs between every displayed term.
Question 1(iii), GATE 1991: Count binary ones in the number. Forum prints 9×16³+7×16²+5×16+3; GFG instead appears to use plus signs between every displayed term.
Tap to enlarge
Answer & solution

Answer: 4 ones, reading the printed + signs as addition (no official key was published)

Convert its digits independently: 9→1001, 7→0111, 5→0101, 3→0011. Their one counts are 2+3+2+2=9; concatenation introduces no carries. If the plus signs are taken literally, the sum is 16³+9+16²+7+16+5+3=4392=0x1128, whose binary representation has four ones. The arithmetic results are therefore source-dependent.

Original paper, page 1