GATE / CS ARCHIVE

SUBJECT COLLECTION

Digital Logic · Number Systems & Computer Arithmetic

47 questions, newest first

GATE CSE has asked 47 questions on Number Systems & Computer Arithmetic (Digital Logic) from 1991 to 2026, in 35 of the 46 papers; the most recent is in GATE CSE 2026 Set 2. In the last five years it carried 1 marks per 100-mark paper on average, against 1 since 2003. Since 2014 the questions have been 10 MCQ, 8 NAT and 4 MSQ. 6 groups of questions here are solved the same way; “One per method” keeps the newest of each.

Browse topics
1 mark · MSQ
Report issue

Overflow in sign-magnitude arithmetic

Number Systems & Computer Arithmetic

Question 22, GATE 2026: X and Y are 8-bit sign-magnitude words 10110100 and 01001100. Which results cannot be represented as an 8-bit sign-magnitude Z: A X+Y; B X−Y; C −X+Y; D −X−Y?
Tap to enlarge
Select all that apply
Answer & solution

Official answer: B, C

Step through it (8 steps)

Givens and goal

X and Y are 8-bit sign-magnitude words 10110100 and 01001100. Which results cannot be represented as an 8-bit sign-magnitude Z: A X+Y; B X−Y; C −X+Y; D −X−Y?

Approach

Decode sign and magnitude separately, calculate the mathematical result of each operation, and compare with the representable interval.

Step-by-step solution

1. One bit is the sign and seven bits hold the magnitude. The largest magnitude is 27−1=127, so representable values lie from −127 to +127. There are separate encodings of zero; there is no −128 value.
2. X has sign 1 and magnitude 0110100₂=32+16+4=52, so X=−52. Y has sign 0 and magnitude 1001100₂=64+8+4=76, so Y=+76.
3. A gives X+Y=−52+76=24, which is representable. B gives X−Y=−52−76=−128, below the minimum, so it overflows.
4. C gives −X+Y=52+76=128, above the maximum, so it overflows. D gives −X−Y=52−76=−24, which is representable.
5. Select B and C. The raw bit patterns must not be interpreted as two’s-complement values: that different representation would assign a different value to X and a different representable lower bound.

Original paper, page 17 · Answer key

1 mark · MSQ
Report issue

Four-bit signed overflow

Number Systems & Computer Arithmetic

Question 28, GATE 2026: Use 4-bit two’s-complement integers N1=1011, N2=1101, N3=1010, N4=1001. Which operations overflow? A N1+N2; B N2+N3; C N3−N4; D N1+N4.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: B, D

Step through it (4 options)

Givens and goal

Use 4-bit two’s-complement integers N1=1011, N2=1101, N3=1010, N4=1001. Which operations overflow? A N1+N2; B N2+N3; C N3−N4; D N1+N4.

Approach

Convert operands to signed values and compare exact results with the representable interval.

Step-by-step solution

1. Four-bit two’s complement represents −8 through 7. A bit pattern with leading 1 has signed value equal to its unsigned value minus 16. Thus N1=11−16=−5, N2=−3, N3=−6, N4=−7.
2. A gives −5+(−3)=−8, exactly the lower endpoint and therefore representable as 1000. Merely having a carry out does not establish signed overflow.
3. B gives −3+(−6)=−9, below −8. The retained four bits would be 0111, a positive 7, so signed overflow occurs. C gives −6−(−7)=1, represented by 0001, so it is safe.
4. D gives −5+(−7)=−12, also below the range. Its wrapped pattern is 0100, positive 4. Therefore B and D overflow.
5. For addition of same-sign operands, a changed result sign is a convenient equivalent test, but checking the exact mathematical result also handles the subtraction correctly.

Original paper, page 21 · Answer key

1 mark · MSQ
Report issue

Sign-extending negative two’s-complement numbers

Number Systems & Computer Arithmetic

Question 25, GATE 2025: The four-bit two’s-complement encoding of −6 is 1010. Which wider encodings still represent −6? A eight-bit 10001010; B eight-bit 11111010; C sixteen-bit 1000000000001010; D sixteen-bit 1111111111111010.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: B, D

Step through it (10 steps)

Approach: Extend the sign bit, not zeros, when widening a signed two’s-complement representation.
In w bits, a word with leading bit 1 represents its unsigned value minus 2w. The four-bit word 1010 has unsigned value 10, so 10−16=−6. To preserve that signed value when adding high-order bits, copy the leading 1 into every new position.
For eight bits this gives 11111010, with unsigned value 250 and signed value 250−256=−6. For sixteen bits it gives 1111111111111010, with unsigned value 65530 and signed value 65530−65536=−6. Therefore B and D are correct.
A has unsigned value 138 and thus signed value −118. C has unsigned value 32778 and thus signed value −32758. Merely retaining a single leading 1 and inserting zeros is not valid sign extension; it changes the negative weight of the leading bit without compensating through the new high bits.

Original paper, page 25 · Answer key

1 mark · MCQ
Report issue

Check signed arithmetic against its range

Number Systems & Computer Arithmetic

Question 13, GATE 2024: Signed integers use five-bit two's complement. A is 01010 and B is 11010. Which operation overflows or underflows this representation? A A+B; B A−B; C B−A; D 2B.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Step through it (4 options)

Approach: Decode the operands as signed values, perform ordinary integer arithmetic, and compare each mathematical result with the representable interval.
1. With five bits, two's complement represents −2⁴ through 2⁴−1, namely −16 through 15.
2. A has leading bit 0, so A=10. B has unsigned value 26 and leading bit 1, so its signed value is 26−32=−6.
3. The four results are A+B=4; A−B=16; B−A=−16; and 2B=−12.
4. Only 16 falls outside [−16,15]. Its five-bit pattern would wrap to 10000, which represents −16 rather than the intended positive 16.
Answer: B. The value −16 in option C is exactly the valid lower endpoint, not an underflow. Two's complement has one more negative value than positive nonzero values.

Original paper, page 9 · Answer key

2 marks · MSQ
Report issue

Compare numerals through a common base

Number Systems & Computer Arithmetic

Question 49, GATE 2024: Which equal 224 in base 5? A 64 in base 10; B 100 in base 8; C 50 in base 16; D 121 in base 7.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: A, B, D

Step through it (7 steps)

Approach: Expand each numeral as a sum of digit×base^position.

1. Derivation. 224 base5 equals 2×25+2×5+4=64 decimal. 100 base8 is 64; 50 base16 is 80 and differs; 121 base7 is 49+14+1=64. Thus A, B, D.

2. Explanation and checks. The rightmost position is the units position in every base. Thus the 4 in 224_5 contributes four, the middle 2 contributes ten, and the left 2 contributes fifty. For 100_8 only the 8² term is nonzero. For 121_7 the contributions are 49,14,1. The digits 5 and 0 in hexadecimal 50 contribute 5×16 and zero, not fifty decimal. Comparing all four decimal values prevents confusing the numeral’s appearance with its represented number.

Original paper, page 34 · Answer key

1 mark · NAT
Report issue

Number Systems & Computer Arithmetic

Question 32, GATE 2023: Convert the number (132)₄ to radix 5; enter its base-5 digits.
Tap to enlarge
Answer & solution

Official answer: 110

Step through it (9 steps)

132 base4 equals 1×16+3×4+2=30 decimal. Dividing30 by 5 gives quotient 6 remainder 0, and 6 by 5 gives quotient 1 remainder 1. Thus30=1×25+1×5+0, or 110 base5.

Teaching detail. The digits of a positional numeral are coefficients of powers of the base, starting at exponent zero from the right. Thus the conversion first obtains the underlying integer and then re-expresses it with powers of 5. The final check is 1·5²+1·5+0=30, equal to the original 1·4²+3·4+2. Do not enter 30 as the answer: that is the decimal intermediary, whereas the question requests the digit string in radix 5. All digits of 110 are valid in base 5.

Original paper, page 30 · Answer key

1 mark · MCQ
Report issue

Number Systems & Computer Arithmetic

Question 18, GATE 2022: Four-bit registers use two's complement. Which sum overflows? A 1011+1110; B 1100+1010; C 0011+0100; D 1001+1111.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Step through it (4 options)

Four-bit two’s-complement integers range from −8 through 7. The sums in A, C, D are −7, 7,−8 and are representable. B computes −4+(−6)=−10, outside the range, so it overflows. Thus B.

Decode a bit pattern with leading 1 by subtracting 16 from its unsigned value. Thus A is −5−2=−7; B is −4−6=−10; C is 3+4=7; D is −7−1=−8. B wraps to 0110 (+6), revealing the sign reversal for a negative-plus-negative sum.

Original paper, page 14 · Answer key

1 mark · MCQ
Report issue

Number Systems & Computer Arithmetic

Question 6, GATE 2021: A number is 210 in base 3. What is its hexadecimal representation? A 15; B 21; C D2; D 528.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Step through it (8 steps)

The ternary numeral 210 represents 2·3²+1·3=21 decimal. Since21=1·16+5, its hexadecimal representation is 15, A.

The positional expansion is 2×9+1×3+0×1=21. Converting that decimal result to base 16 gives quotient 1 and remainder 5. Conversely hexadecimal 15 evaluates to 16+5=21, providing a reverse check. The visible digits 210 are not a decimal number to be converted directly.

Original paper, page 14 · Answer key

1 mark · NAT
Report issue

Number Systems & Computer Arithmetic

Question 18, GATE 2021: Decimal digits x,y satisfy (0.1101)₂=(0.8xy5)₁₀. Find x+y.
Tap to enlarge
Answer & solution

Official answer: 3

Step through it (8 steps)

Binary0.1101 equals 1/2+1/4+1/16=13/16=0.8125. Thus x=1, y=2 and x+y=3.

Weights to the right of the binary point are 2−1,2−2,2−3,2−4. Only the third bit is zero. Matching 0.8125 to 0.8xy5 identifies the digits individually before adding. The answer is an integer sum of digits, not the binary fraction's numerator.

Original paper, page 64 · Answer key

1 mark · MCQ
Report issue

Sixteen-bit two’s-complement encoding of −28

Number Systems & Computer Arithmetic

Question 4, GATE 2019: Find the 16-bit two's-complement representation of decimal −28. Choices: A 1111 1111 0001 1100; B 0000 0000 1110 0100; C 1111 1111 1110 0100; D 1000 0000 1110 0100.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Step through it (5 steps)

Method: represent the positive magnitude at the specified width, complement every bit, and add one.

1. Positive 28 is 16 + 8 + 4, so its 16-bit binary representation is 0000 0000 0001 1100.
2. Complement all 16 bits: 1111 1111 1110 0011.
3. Add one: 1111 1111 1110 0100, which is hexadecimal FFE4.
4. Check by the modular interpretation: a negative integer −28 is encoded as 216 − 28 = 65508. FFE4 has unsigned value 65508 and signed value 65508 − 65536 = −28.

Result: C. Setting just the most significant bit would be sign-magnitude encoding, not two's complement; retaining the positive low byte after filling leading ones would also give the wrong number.

Original paper, page 4 · Answer key

1 mark · MCQ
Report issue

Width required for sign-magnitude subtraction

Number Systems & Computer Arithmetic

Question 8, GATE 2019: X and Y use n-bit sign-magnitude representations, and Z = X − Y must also use sign magnitude. Find the minimum width that avoids overflow for all operands. Choices: A n; B n−1; C n+1; D n+2 bits.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Method: find the largest possible magnitude of a difference, then reserve a separate sign bit.

1. In an n-bit sign-magnitude number, one bit is the sign and n − 1 bits encode the magnitude. Thus each operand has absolute value at most M = 2n−1 − 1.
2. The largest positive difference occurs at X = M and Y = −M, giving Z = 2M = 2n − 2. Reversing these operands produces the negative extreme of the same magnitude.
3. For n ≥ 2, n − 1 magnitude bits cannot hold 2n − 2, but n magnitude bits can, since their maximum is 2n − 1. Therefore n magnitude bits are necessary and sufficient.
4. Add the sign bit: the result needs n + 1 total bits. For example, with n = 4, inputs range from −7 to +7; their difference can be +14, requiring four magnitude bits plus a sign.

Result: C, n+1 bits. The degenerate n=1 format represents only signed zero and is outside the usual nontrivial-width interpretation.

Original paper, page 5 · Answer key

2 marks · MCQ
Report issue

Exact fixed-point representability

Number Systems & Computer Arithmetic

Question 33, GATE 2018: An unsigned 8-bit fixed-point format is b7b6b5b4b3.b2b1b0. Values are i 31.500, ii 0.875, iii 12.100, iv 3.001. Which cannot be exact? A all; B ii only; C iii,iv only; D i,ii only.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Method

The three fractional bit weights are 1/2,1/4,1/8. Thus every stored value is an integer multiple of 1/8 within [0,255/8]. Multiplying a proposed value by 8 must yield an integer between 0 and 255. As examples, 31.5=11111.100₂ and 0.875=00000.111₂. Values 12.1 and 3.001 satisfy the range constraint but fail the granularity constraint; being small enough does not make a decimal fraction exactly representable.

Solution

Three fractional bits give increments of 1/8 and maximum 31.875. Both31.500=252/8 and 0.875=7/8 are representable. But12.100·8=96.8 and 3.001·8=24.008 are not integers, so iii and iv are not exact, C.

Original paper, page 13 · Answer key

1 mark · MCQ
Report issue

Number Systems & Computer Arithmetic

Question 7, GATE 2017: An unsigned n-bit fixed-point number has f fractional bits and i=n−f integer bits. Find its range. A 2^(−f) to 2^i; B 2^(−f) to 2^i−2^(−f); C 0 to 2^i; D 0 to 2^i−2^(−f).
Tap to enlarge
Your answer
Answer & solution

Official answer: D

1. Represent the stored bits first as an unsigned integer N. Its smallest code is 0 and largest is 2n−1.

2. The fixed binary point gives value X=N/2f, so the step size is 2−f. The upper endpoint is (2n−1)2−f=2n−f−2−f.

3. Substitute i=n−f. The inclusive representable range is 0 through 2i−2−f, D. The value 2i itself would need an extra integer bit.

Original paper, page 4 · Answer key

1 mark · MCQ
Report issue

Number Systems & Computer Arithmetic

Question 9, GATE 2017: Two 8-bit two’s-complement numbers A7...A0 and B7...B0 are added, producing S7...S0 and carry bits C7...C0. A0 and B0 are least significant. Which detects overflow? A C7=1; B all carries 1; C A7 B7 ¬S7 + ¬A7 ¬B7 S7=1; D A0 B0 ¬S0 + ¬A0 ¬B0 S0=1. Products mean AND and + means OR.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. In two’s complement the high bit is the sign. Opposite-sign addition cannot exceed both representable bounds, so overflow requires equal operand signs.

2. If both signs are 0, overflow means the result sign is 1: ¬A7∧¬B7∧S7. If both signs are 1, overflow means the result sign is 0: A7∧B7∧¬S7.

3. OR the two mutually exclusive cases to obtain C. For example, 127+1 produces negative 8-bit result without needing an unsigned carry-out; sign overflow and unsigned carry are different tests.

Original paper, page 5 · Answer key

1 mark · MCQ
Report issue

Number Systems & Computer Arithmetic

Question 1, GATE 2017: A 16-bit unsigned integer is BCA9 in hexadecimal. Give its octal representation. A:571244. B:736251. C:571247. D:136251.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Step through it (13 steps)

1. Convert each hexadecimal digit into four binary bits: B=1011, C=1100, A=1010, 9=1001. The number is therefore 1011110010101001₂.

2. Octal groups binary bits in threes, starting at the least-significant end. Add two leading zeros only for grouping: 001 011 110 010 101 001.

3. These groups are 1,3,6,2,5,1, yielding 136251₈, option D. A decimal check is BCA9₁₆=48297, and 1·8⁵+3·8⁴+6·8³+2·8²+5·8+1=48297. Leading padding does not change the value.

Original paper, page 2 · Answer key

1 mark · NAT
Report issue

Number Systems & Computer Arithmetic

Question 24, GATE 2017: The quadratic x²−13x+36=0 has its coefficients written in base b. Its roots in that same base are the single digits 5 and 6. Find b.
Tap to enlarge
Answer & solution

Official answer: 8.0

Our answer: 8

Step through it (5 steps)

1. Because 5 and 6 are single digits, their numerical values are 5 and 6, while the coefficient 13_b means b+3 and 36_b means 3b+6. The base must exceed 6 to admit all displayed digits.

2. For a monic quadratic, the sum of the roots equals the coefficient subtracted from x. Thus 5+6=b+3, which gives b=8.

3. Check the product condition as well: 5·6=30, and 36_8=3·8+6=30. Both coefficient relations agree, and digits 0 through 6 are legal in base 8. Hence the answer is 8, not a decimal interpretation of 13 and 36.

Original paper, page 10 · Answer key

1 mark · NAT
Report issue

Number Systems & Computer Arithmetic

Question 7, GATE 2016: Find the signed decimal value of the 16-bit two's-complement word 1111 1111 1111 0101.
Tap to enlarge
Answer & solution

Official answer: -11.0 : -11.0

Our answer: −11

Step through it (4 steps)

Invert 1111111111110101 and add 1 to obtain 0000000000001011=11. The leading sign bit is 1, so the two’s-complement value is−11.

A second method treats the word as an unsigned integer and subtracts 216 because the sign bit is 1. The unsigned hexadecimal value is FFF 5, or 65525;65525−65536=−11. The invert-and-add-one method and this positional-weight method agree. A leading 1 does not mean simply attaching a minus sign to the remaining 15-bit magnitude; that would be sign-magnitude, a different representation.

Original paper, page 5 · Answer key

1 mark · NAT
Report issue

Number Systems & Computer Arithmetic

Question 9, GATE 2016: X is the number of distinct integers representable in 16-bit two’s complement; Y is the corresponding number for 16-bit sign magnitude. Find X−Y.
Tap to enlarge
Answer & solution

Official answer: 1.0 : 1.0

Our answer: 1

Two’s complement has 216 distinct values. Sign magnitude has two encodings of zero, leaving 216−1 distinct values. Hence X−Y=1.

Two’s-complement range is −32768 through 32767, containing 65536 integers. Sign magnitude ranges from −32767 through 32767, containing 65535 integers. Both formats have 65536 bit patterns; the question asks distinct mathematical values, so +0 and −0 count once.

Original paper, page 27 · Answer key

2 marks · NAT
Report issue

Number Systems & Computer Arithmetic

Question 59, GATE 2015: In positional notation, (43) base x equals (y3) base 8, where x is a valid integer base and y is a valid octal digit. How many (x,y) solutions are possible?
Tap to enlarge
Answer & solution

Official answer: 5

Step through it (9 steps)

1. The complete pairs are (x,y)=(6,3),(8,4),(10,5),(12,6),(14,7). The apparent pair (4,2) is invalid because digit 4 cannot occur in base 4; larger y cannot occur in base 8.

2. The equality gives 4x+3=8y+3, hence x=2y. The base must exceed its largest digit 4, so x≥5, and the octal digit y lies between 0 and 7. Thus y=3, 4, 5, 6, 7 and x=6, 8, 10, 12, 14, giving five solutions.

Original paper, page 76 · Answer key

1 mark · NAT
Report issue

Number Systems & Computer Arithmetic

Question 8, GATE 2014: All numerals in the equation (312)/(20)=13.1 use the same unknown base. Determine that base.
Tap to enlarge
Answer & solution

Official answer: 5

Step through it (5 steps)

1. Method and setup. Translate place values before doing arithmetic: 312 means 3b²+b+2, 20 means 2b, and 13.1 means b+3+b⁻¹. The base must be an integer greater than 3 because digit 3 occurs. This restriction removes algebraic roots that are not valid radices.

2. Work through the result and its assumptions. For base b, (3b²+b+2)/(2b)=b+3+1/b. Multiplication gives 3b²+b+2=2b²+6b+2, hence b(b−5)=0. A valid base exceeds the largest digit 3, so b=5.

Original paper, page 9 · Answer key

1 mark · NAT
Report issue

Number Systems & Computer Arithmetic

Question 8, GATE 2014: In the numeral equation (123) base 5 = (x8) base y, x is a leading digit and y is an integer base. How many pairs (x,y) are possible?
Tap to enlarge
Answer & solution

Official answer: 3

Step through it (9 steps)

1. Set up the reasoning. Convert the known numeral to decimal: 1×5²+2×5+3=38. The other numeral equals xy+8, so admissible pairs must satisfy xy=30.

2. Derive the result. (123)₅=25+10+3=38, so xy+8=38 and xy=30. A valid base y>8 and a leading digit 1≤x<y leave(x, y)=(1, 30),(2, 15),(3, 10). Thus3 solutions.

3. Check the interpretation. Digit validity is essential: the digit 8 requires y≥9, and x must satisfy 1≤x<y. Check the factor pairs of 30 against these constraints rather than counting every factorization.

Original paper, page 31 · Answer key

2 marks · MCQ
Report issue

Number Systems & Computer Arithmetic

Question 45, GATE 2014: IEEE-754 binary32 uses 1 sign bit, 8 biased-exponent bits and 23 fraction bits. A float X is assigned -14.25. What is its hexadecimal representation? A C1640000H; B 416C0000H; C 41640000H; D C16C0000H.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Step through it (6 steps)

1. Set up the reasoning. Convert the magnitude exactly: 14 is 1110₂ and 0.25 is .01₂. Normalize to 1.11001₂×2³, then encode sign, biased exponent, and the fraction after the implicit leading 1.

2. Derive the result. 14.25=1110.01₂=1.11001₂×2³. The negative sign gives sign bit1, the biased exponent is 127+3=130=10000010₂, and the fraction is 11001000000000000000000. Combining fields gives binary11000001011001000000000000000000, hexadecimalC1640000, A.

3. Check the interpretation. The leading 1 is not stored in the fraction field. The negative sign changes the top bit only; exponent bias is 127, so exponent 3 becomes 130. Group the final 32 bits into nibbles to distinguish C164 from the similar distractor C16C.

Original paper, page 41 · Answer key

1 mark · MCQ
Report issue

Eight-bit signed minimum

Number Systems & Computer Arithmetic

Question 4, GATE 2013: What is the smallest integer representable by an 8-bit two’s-complement number? A−256, B−128, C−127, D0.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

An8-bit two’s-complement integer has range−27 through 27−1, hence minimum−128, B.

The leftmost bit has weight−128 and the remaining seven bits have positive weights 64, 32, 16, 8, 4, 2, 1. To minimize the represented integer, set the negative-weight bit to 1 and all positive-weight bits to 0:10000000 represents−128. The opposite endpoint 01111111 represents 127. Unlike sign-magnitude, two’s complement has one more negative value than positive nonzero values, which explains why−127 is not the minimum.

Original paper, page 2 · Answer key

1 mark · MCQ
Report issue

Multiplying a signed hexadecimal integer

Number Systems & Computer Arithmetic

Question 8, GATE 2010: A signed 16-bit integer P has two’s-complement hexadecimal representation F87B. What is the 16-bit two’s-complement representation of 8P?
Options: (A) C3D8; (B) 187B; (C) F878; (D) 987B.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Step through it (5 steps)

The 16-bit pattern F87B represents 0xF87B−0x10000=−1925. Multiplication by 8 gives −15400, which is within the signed 16-bit range. Its two’s-complement encoding is 65536−15400=50136=0xC3D8, A; equivalently shift F87B left three positions and retain 16 bits.

The top hexadecimal digit F sets the sign bit, so interpreting F87B as an unsigned positive number without subtracting 216 gives the wrong signed value. The range check −32768≤−15400≤32767 confirms that multiplying by eight does not overflow here. Hexadecimal shifting also gives F87B×8=7C3D8, whose low four digits are C3D8.

Original paper, page 2

1 mark · MCQ
Report issue

Octal to hexadecimal conversion

Number Systems & Computer Arithmetic

Question 5, GATE 2009: Convert octal 1217 to the equivalent choice: A hexadecimal 1217; B hexadecimal 028F; C decimal 2297; D hexadecimal 0B17.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Step through it (10 steps)

Octal 1217 expands to binary 001 010 001 111. Grouping in fours gives 0010 1000 1111, hexadecimal 28F, or 028F with a leading zero. Hence B. Its decimal value is 512+128+8+7=655.

Using place values, octal 1217 equals 1·8³+2·8²+1·8+7=512+128+8+7=655. Divide into hexadecimal place values:655=2·256+8·16+15, so it is 028F hexadecimal. The same conversion follows by octal digit triples 001010001111, regrouped into binary quartets 0010 1000 1111.

Original paper, page 2

1 mark · MCQ
Report issue

All-zero IEEE binary32 encoding

Number Systems & Computer Arithmetic

Question 4, GATE 2008: In IEEE floating-point representation, what does hexadecimal 0x00000000 represent?

(A) Normalized value 2^(−127)
(B) Normalized value 2^(−126)
(C) Normalized value +0
(D) Special value +0
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Step through it (6 steps)

1. Split binary32 into sign, exponent and fraction fields. Every field is zero here.
2. An all-zero exponent is reserved for zero/subnormal encodings, so the normalized-number formula with an implicit leading 1 does not apply.
3. The zero fraction makes the magnitude zero; sign bit 0 makes it +0. This is the special value in D.

Original paper, page 2

1 mark · MCQ
Report issue

Radix-independent square identity

Number Systems & Computer Arithmetic

Question 6, GATE 2008: For radix r, which r satisfy √(121ᵣ)=11ᵣ?

(A) Decimal 10
(B) Decimal 11
(C) Decimal 10 and 11
(D) Any valid radix greater than 2
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. Interpret the digits by place value: 121ᵣ=r²+2r+1=(r+1)², while 11ᵣ=r+1.
2. The positive square root is r+1 for every positive radix.
3. Digit 2 is valid only when the integer radix exceeds 2. Hence all valid r>2 satisfy the equation, D; there is nothing special about decimal 10 or 11.

Original paper, page 2

2 marks · MCQ
Report issue

Signed addition overflow

Number Systems & Computer Arithmetic

Question 39, GATE 2006: An ordinary binary adder adds two n-bit two’s-complement numbers aₙ₋₁…a₀ and bₙ₋₁…b₀. Its result bits are cₙ₋₁…c₀ and carry-out is c_out. Which expression detects signed overflow? Let a=aₙ₋₁,b=bₙ₋₁,c=cₙ₋₁. Both reproductions print a continuous bar over ab in the second term of B; its scope must not be silently normalized.
Options:
(A) c_out·¬(a⊕b)
(B) ab¬c+overline(ab)c [continuous source bar; intended separate-literal reading: ab¬c+¬a¬bc]
(C) c_out⊕c
(D) a⊕b⊕c
Tap to enlarge
Your answer
Answer & solution

Answer: B only under separate-literal complement reading; printed grouped bar is ambiguous (no official key was published)

1. Signed overflow occurs when both operand sign bits agree and the result sign differs: V=ab¬c+¬a¬bc. For example, two positive operands overflowing the positive range give a=b=0,c=1.

2. Read literally as a grouped complement, the printed expression is ab¬c+¬(ab)c, not the standard overflow expression.

3. A counterexample is four-bit −8+1=−7: a=1,b=0,c=1, with no signed overflow, but ¬(ab)c=1. Therefore printed B works only if its spanning bar is intended to mean separately complemented literals. That intended reading must be stated explicitly; the original official wording and key are unavailable.

4. The other expressions are not general overflow detectors. With four-bit −1+1=0, c_out=1,c=0 and C incorrectly signals overflow. D fails on −8+(−1), whose sign bits are a=b=1,c=0: D=0 although overflow occurs. A misses positive overflow 7+1 because c_out=0.

5. Teaching check: Compute overflow from operand and result signs, then check the scope of every complement. Carry-out is an unsigned carry indicator, not signed overflow. The retained B answer is conditional on the separate-literal reading, not a verified literal-source or official-key answer.

Original paper, page 5

1 mark · MCQ
Report issue

Twos-complement integer range

Number Systems & Computer Arithmetic

Question 16, GATE 2005: Representable n-bit two’s-complement range? A −2^(n−1) through 2^(n−1)−1; B −(2^(n−1)−1) through 2^(n−1)−1; C −2^(n−1) through 2^(n−1); D −(2^(n−1)+1) through 2^(n−1)−1.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

The most significant bit has weight−2n−1 and the remaining bits sum from 0 to 2n−1−1. Thus the represented range is−2n−1 through 2n−1−1, A.

The most significant bit has weight−2n−1, while lower bits contribute from 0 through 2n−1−1. Setting only the sign bit gives the minimum; setting all lower bits and clearing the sign bit gives the maximum. There are exactly 2n values in the asymmetric interval, including zero once, so A.

Original paper, page 2

1 mark · MCQ
Report issue

Octal to hexadecimal conversion

Number Systems & Computer Arithmetic

Question 17, GATE 2005: Convert octal 657 to hexadecimal: A 1AF; B D78; C D71; D 32F. Clearer GateForum source confirms option A.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Step through it (9 steps)

657 in octal is 6×64+5×8+7=431. Dividing into hexadecimal digits gives 1×256+10×16+15=1AF, A. Equivalently, octal bits 110101111 regroup as 0001 1010 1111.

Convert via place values:6·8²+5·8+7=384+40+7=431. In hexadecimal 431=1·256+10·16+15, giving 1AF. Equivalently octal digit triples 110101111 become 0001 1010 1111. The answer is A, spelling 1AF; the clearer alternate confirms the faint final glyph in that choice.

Original paper, page 2

1 mark · MCQ
Report issue

Equality in two number bases

Number Systems & Computer Arithmetic

Question 19, GATE 2004: If the base-x numeral 73 equals the base-y numeral 54, which pair (x,y) is possible?
Options:
(A) 8,16
(B) 10,12
(C) 9,13
(D) 8,11
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Step through it (6 steps)

1. The equation is 7x+3=5y+4, or 7x−5y=1. Among the options x=8,y=11 gives 56−55=1 and both bases exceed their digits.

2. Thus D; both numerals represent 59.

3. Teaching check: A two-digit numeral ab in base r equals ar+b, rather than a×10+b. Substitution for (8,11) gives 7×8+3=59 and 5×11+4=59. Valid bases must also exceed every digit used; algebra alone would not suffice otherwise.

Original paper, page 3

2 marks · MCQ
Report issue

Product of signed eight-bit numbers

Number Systems & Computer Arithmetic

Question 66, GATE 2004: A=11111010 and B=00001010 are eight-bit two’s-complement numbers. Which listed eight-bit two’s-complement result represents their product? Option B follows GFG (10011100); GateForum instead prints 10111100.
Options:
(A) 11000100
(B) 10011100
(C) 10100101
(D) 11010101
Question 66, GATE 2004: A=11111010 and B=00001010 are eight-bit two’s-complement numbers. Which listed eight-bit two’s-complement result represents their product? Option B follows GFG (10011100); GateForum instead prints 10111100.
Options:
(A) 11000100
(B) 10011100
(C) 10100101
(D) 11010101
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Step 1: 11111010 represents 250−256=−6 and 00001010 represents 10. Their product is −60, which fits in eight signed bits.

Step 2: Its encoding is 256−60=196=11000100, option A. A full sixteen-bit product is its sign extension, 1111111111000100; the options clearly request the eight-bit representation.

Step 3: Teaching check: Negating 11111010 by invert-and-add-one gives magnitude 00000110=6, so the signed operand is −6. The product −60 fits in [−128,127], avoiding overflow. Check the chosen output by decoding 11000100 as 196−256=−60.

Original paper, page 9

1 mark · MCQ
Report issue

Signed binary divisibility

Number Systems & Computer Arithmetic

Question 9, GATE 2003: Interpret every bit string as an eight-bit two’s-complement integer. Which is divisible by 11111011? A. 11100111; B. 11100100; C. 11010111; D. 11011011.
Question 9, GATE 2003: Interpret every bit string as an eight-bit two’s-complement integer. Which is divisible by 11111011? A. 11100111; B. 11100100; C. 11010111; D. 11011011.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Step through it (12 steps)

1. For an eight-bit word with most significant bit 1, subtract 256 from its unsigned value. The divisor is −5, so only signed multiples of 5 qualify. Dividing −25 by −5 gives the integer 5; the other listed values leave nonzero remainders.

2. The 8-bit two’s-complement divisor 11111011 is 251−256=−5. The listed values 11100111,11100100,11010111,11011011 are respectively−25,−28,−41,−37. Only−25 is divisible by−5, so A.

Original paper, page 1

1 mark · MCQ
Report issue

Binary representation of a quarter

Number Systems & Computer Arithmetic

Question 1.14, GATE 2002: Which statement describes decimal 0.25?
(A) It equals binary 0.1.
(B) It equals binary 0.01.
(C) It equals binary 0.00111… .
(D) It cannot be represented exactly in binary.
Tap to enlarge
Your answer
Answer & solution

Answer: B and C if the trailing ones continue forever (no official key was published)

Step 1: Evaluate both binary expansions as real numbers.

Step 2: In0.001111…, the first one is in the third fractional position, so its value is 1/8+1/16+1/32+… . Multiplying this sum by 1/2 and subtracting leaves half the sum equal to 1/8, hence the sum is 1/4. No finite truncation equals 1/4, but the infinite expansion does. The ellipsis is therefore essential to the recorded ambiguity.

Conclusion: The terminating binary representation is 0.01₂=2−2=1/4, B. But the printed alternative C,0.001111..., also equals sum_(j=3)^∞2−j=(1/8)/(1−1/2)=1/4 when the ellipsis means infinitely repeated ones. Thus both are exact real-number representations, analogous to decimal 0.999...=1. B is the unique terminating representation, but the prompt does not restrict to terminating representations. This is an overlapping-options issue, not an official-key claim.

Original paper, page 2

1 mark · MCQ
Report issue

Twos-complement representation of negative fifteen

Number Systems & Computer Arithmetic

Question 1.15, GATE 2002: Which bit string is a two’s-complement representation of decimal −15?
(A) 1111; (B) 11111; (C) 111111; (D) 10001.
Question 1.15, GATE 2002: Which bit string is a two’s-complement representation of decimal −15?
(A) 1111; (B) 11111; (C) 111111; (D) 10001.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Step through it (10 steps)

Step 1: Choose a width that can represent the value.

Step 2: The n-bit two’s-complement range is−2n−1 through 2n−1−1. Four bits cannot hold−15, while five bits can. At width five, +15 is 01111; complementing gives 10000 and adding one gives 10001. Interpreting10001 as unsigned 17 and subtracting 32 independently checks−15.

Conclusion: At least 5 bits are needed because the 4-bit signed range is−8 through 7. In5 bits, −15 is 25−15=17=10001₂, D. Strings consisting entirely of ones represent−1, not−15.

Original paper, page 2

1 mark · MCQ
Report issue

Purpose of sign extension

Number Systems & Computer Arithmetic

Question 1.16, GATE 2002: In which operation is sign extension a step?
(A) Floating-point multiplication; (B) Signed 16-bit integer addition; (C) Arithmetic left shift; (D) Conversion of a signed integer from one size to another.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Step 1: Compare zero extension with sign extension.

Step 2: For a positive number, the sign bit is zero, so sign extension simply adds leading zeros. For a negative number, adding leading ones preserves the signed interpretation: 10001 has unsigned value 17−32=−15, and 11110001 has unsigned value 241−256=−15. Zero-extending 10001 would instead yield+17.

Conclusion: When a signed two’s-complement integer is widened, copy its sign bit into the new high-order positions. This preserves the numerical value; for example 10001₂ (5-bit−15) becomes 11110001₂ (8-bit−15). This is the size-conversion operation in D.

Original paper, page 2

1 mark · MCQ
Report issue

Overflow when adding opposite signs

Number Systems & Computer Arithmetic

Question 1.21, GATE 2002: Which statement about overflow in two’s-complement addition is correct?
(A) A carry from the sign-bit addition always flags overflow.
(B) Adding a positive value to a negative value cannot overflow.
(C) Overflow is flagged when the carries from the sign bit and the preceding bit agree.
(D) None of these.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Step 1: Contrast carry with signed overflow.

Step 2: In four bits, 0111+0001=1000 overflows the signed range even though there is no final carry. Conversely, 1111+0001=0000 with a carry represents−1+1=0 without signed overflow. These examples rule out a carry-only test. Opposite-sign operands always have a sum between the two operands and therefore within range.

Conclusion: If a≥0 and b<0 are representable, their sum lies between b and a and remains representable. Thus opposite-sign addition cannot overflow, B. For two’s complement, overflow is the XOR of the carry into and out of the sign position, not simply the outgoing carry or equality of those carries.

Original paper, page 3

2 marks · MCQ
Report issue

Hexadecimal twos complement of negative 539

Number Systems & Computer Arithmetic

Question 2.10, GATE 2001: Choose the three-hex-digit two’s-complement representation of decimal −539 from ABE,DBC,DE5,9E7.
Tap to enlarge
Your answer
Answer & solution

Answer: C for the displayed 12-bit width (no official key was published)

Step through it (5 steps)

Step 1: Convert 539 to hexadecimal:539=2·256+1·16+11=21B₁₆. The three-hex-digit answer options imply 12 bits.

Step 2: Complement each hex digit to F, giving DE4, then add one to obtain DE5. Independently,1000₁₆−021B₁₆=0DE5₁₆.

Thus C. A wider representation would sign-extend with leading F digits; two’s-complement representation is width-dependent, so DE5 is interpreted using the options’ width.

Original paper, page 5

1 mark · MCQ
Report issue

Positive integer in twos-complement representation

Number Systems & Computer Arithmetic

Question 1.6, GATE 2000: Represent positive decimal 43 in the eight-bit two’s-complement options: 01010101,11010101,00101011,10101011.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Step through it (3 steps)

Step 1: Decompose 43=32+8+2+1, giving binary 101011.

Step 2: Since the number is positive, two’s complement uses its ordinary binary representation with leading zero sign extension: 00101011.

Thus C.

Original paper, page 1

2 marks · MSQ
Report issue

Signed representations of zero

Number Systems & Computer Arithmetic

Question 2.17, GATE 1999: Which schemes have two zeros: sign-magnitude,ones complement,twos complement,none?
Tap to enlarge
Select all that apply
Answer & solution

Answer: A,B (no official key was published)

In sign-magnitude, magnitude bits all zero represent zero with either sign bit, producing +0 and −0. In ones complement, complementing the all-zero positive representation yields the all-one negative-zero pattern. In twos complement, negation complements then adds one, returning zero to the all-zero pattern after overflow is discarded; the all-one pattern represents −1 instead. Thus exactly A and B have two zero representations.

Original paper, page 5

2 marks · MCQ
Report issue

Solving for a radix

Number Systems & Computer Arithmetic

Question 5.4, GATE 1997: Given sqrt ((224)r)=(13)r, find base r among 10, 8, 5, 6.
Tap to enlarge
Your answer
Answer & solution

Answer: C: 5 (no official key was published)

Step through it (6 steps)

Convert the positional numerals to values: (224)r=2r²+2r+4 and (13)r=r+3. Squaring gives 2r²+2r+4=(r+3)²=r²+6r+9. Rearranging yields r²−4r−5=(r−5)(r+1)=0. A valid positive radix containing digit 4 must exceed 4, so r=5, option C. Check 224₅=64 and 13₅=8, whose square is 64.

Original paper, page 5

2 marks · MCQ
Report issue

Counting set bits using hexadecimal

Number Systems & Computer Arithmetic

Question 2.12, GATE 1995: Count ones in the binary representation of 3·4096+15·256+5·16−3 in GFG; the alternate prints +3.
Tap to enlarge
Your answer
Answer & solution

Answer: C: 10 (no official key was published)

Before subtracting three, the number is hexadecimal 3F50. Subtracting gives 3F4D, whose nibbles 0011,1111,0100,1101 contain 2+4+1+3=10 ones. Thus the answer happens to agree despite the different arithmetic expressions. The subtraction borrows from the previous nibble; treating its low digit as an independent negative digit would not give a binary representation.

Original paper, page 4

Report issue

Binary fraction to decimal

Number Systems & Computer Arithmetic

Question 6.5.a, GATE 1993: Convert (110.101)₂ to decimal.
Question 6.5.a, GATE 1993: Convert (110.101)₂ to decimal.
Tap to enlarge
Answer & solution

Answer: 6.625 (no official key was published)

Step through it (8 steps)

The integer bits have weights 4,2,1 and contribute 4+2+0=6. The fractional bits have weights 1/2,1/4,1/8 and contribute 1/2+0+1/8=0.625. Add the two parts to get 6.625. Fractional bit positions continue negative powers of the base; treating .101 as a decimal fraction would not preserve the given binary value. This is one of the two separately retained conversion subparts sharing the printed group marks.

Original paper, page 5

Report issue

Decimal to hexadecimal

Number Systems & Computer Arithmetic

Question 6.5.b, GATE 1993: Convert (1118)₁₀ to base H as printed. Interpret H explicitly.
Question 6.5.b, GATE 1993: Convert (1118)₁₀ to base H as printed. Interpret H explicitly.
Tap to enlarge
Answer & solution

Answer: 45E₁₆, if H denotes hexadecimal (no official key was published)

Taking H as the conventional hexadecimal notation, divide 1118 by 16: quotient 69,remainder 14=E. Divide 69 by 16: quotient 4,remainder 5. The final quotient 4 is the leading digit, giving 45E. Verify by expansion: 4·256+5·16+14=1024+80+14=1118. The source labels the desired base H rather than the number 16, so the hexadecimal interpretation is stated. If H were instead an unspecified variable radix, a unique numeral could not be supplied.

Original paper, page 5

Descriptive
Report issue

Signed addition overflow

Number Systems & Computer Arithmetic

Question 4(a), GATE 1992: Explain when addition in fixed-width two’s-complement arithmetic overflows, and why carry out of the most significant bit is not sufficient.
Tap to enlarge
Answer & solution

Answer: Overflow iff equal-sign operands produce the opposite-sign result; V = carry into sign bit XOR carry out. (no official key was published)

For a w-bit two’s-complement word the representable interval is −2w−1 through 2w−1−1. Hardware retains the low w bits of the mathematical sum. Overflow means the mathematical signed sum lies outside this interval, not merely that an unsigned carry was discarded.

Let a,b be the operand sign bits and s the retained result sign bit. The overflow flag is V=(¬a∧¬b∧s)∨(a∧b∧¬s). Two nonnegative numbers overflow only by producing a sign bit of 1; two negative numbers overflow only by producing a sign bit of 0. Opposite-sign operands cannot overflow: their sum lies between the operands and hence within the representable interval.

Equivalently, if c_in is the carry into the sign-bit adder and c_out its outgoing carry, V=c_in XOR c_out. This follows by considering the sign-bit full-adder cases: for equal operand signs an incorrect result sign occurs precisely when these carries differ; for unequal signs they agree.

For four bits, 0111+0001=1000 represents 7+1 as −8: overflow occurs despite no outgoing carry. Conversely 1111+0001=0000 with carry 1 represents −1+1=0 correctly: carry occurs without overflow. Finally 1000+1111=0111 with carry 1 is −8+(−1), which really does overflow. These examples separate the unsigned carry flag from the signed overflow flag.

Original paper, page 5

2 marks · Other
Report issue

Population count of a hexadecimal expression

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

2 marks · Other
Report issue

Second bit of a binary product

Number Systems & Computer Arithmetic

Question 1(v), GATE 1991: A=a3a2a1a0 and B=b3b2b1b0 are unsigned four-bit numbers. Express product bit c1.
Question 1(v), GATE 1991: A=a3a2a1a0 and B=b3b2b1b0 are unsigned four-bit numbers. Express product bit c1.
Tap to enlarge
Answer & solution

Answer: c1=(a1b0) XOR (a0b1) (no official key was published)

The column of weight 1 contains only a0b0, so it produces c0 and no carry into the weight-2 column. That next column contains a1b0 and a0b1. Adding two bits gives their XOR as the low result bit and their AND as carry to weight 4. Hence c1 is the XOR of the two partial products. Higher input bits cannot contribute to this column because their positional weights are at least four. Ordinary OR would be wrong when both partial products are one.

Original paper, page 1