Number Systems

GATE CS previous year questions · 5 questions

GATE CS 2025 Set 1 | Question 25

MSQ · 1 mark

The number −6 can be represented as 1010 in 4-bit 2’s complement representation. Which of the following is/are CORRECT 2’s complement representation(s) of −6?

Options for GATE CS 2025 Set 1 | Question 25

Explanation

Answer: (B), (D)

To widen a 2’s complement number, copy its sign bit into every new position (sign extension). The sign bit of 1010 is 1, so \(-6\) is 1111 1010 in 8 bits and 1111 1111 1111 1010 in 16 bits.

  • (A) False: 1000 1010 is \(-128 + 10 = -118\).
  • (B) True: 1111 1010 is \(-128 + 122 = -6\).
  • (C) False: 1000 0000 0000 1010 is \(-32768 + 10 = -32758\).
  • (D) True: it is 1010 sign-extended to 16 bits, value \(-6\).

Answer: B, D

GATE CS 2025 Set 2 | Question 49

MSQ · 2 marks

Three floating point numbers \(X, Y\), and \(Z\) are stored in three registers RX, RY, and RZ, respectively in IEEE 754 single precision format as given below in hexadecimal:

RX = 0xC1100000, RY = 0x40C00000, and RZ = 0x41400000

Which of the following option(s) is/are CORRECT?

Options for GATE CS 2025 Set 2 | Question 49

Explanation

Answer: (A), (B), (C)

Read each word as sign (1 bit), biased exponent (8 bits) and fraction (23 bits); the value is \((-1)^{s} \times 1.f \times 2^{e - 127}\).

  • 0xC1100000: sign 1, exponent 10000010 = 130, fraction 001000…, so \(X = -1.125 \times 2^{3} = -9\).
  • 0x40C00000: sign 0, exponent 10000001 = 129, fraction 100000…, so \(Y = 1.5 \times 2^{2} = 6\).
  • 0x41400000: sign 0, exponent 10000010 = 130, fraction 100000…, so \(Z = 1.5 \times 2^{3} = 12\).

Now check each option: (A) \(4(-9 + 6) + 12 = 0\); (B) \(12 - 12 = 0\); (C) \(-36 + 36 = 0\). (D) fails because \(-9 + 6 + 12 = 9\).

Answer: A, B, C

GATE CS 2024 Set 1 | Question 13

MCQ · 1 mark · −0.33

Consider a system that uses 5 bits for representing signed integers in 2’s complement format. In this system, two integers \(A\) and \(B\) are represented as \(A\)=01010 and \(B\)=11010. Which one of the following operations will result in either an arithmetic overflow or an arithmetic underflow?

Options for GATE CS 2024 Set 1 | Question 13

Explanation

Answer: (B)

With 5 bits, 2’s complement covers \(-16\) to \(+15\). Decode the operands: \(A = 01010 = +10\), and \(B = 11010 = -6\) (invert and add 1 to get \(00110 = 6\)).

  • \(A + B = 4\): in range.
  • \(A - B = 10 + 6 = 16\): above \(+15\), so it overflows; the 5-bit result 10000 would read as \(-16\).
  • \(B - A = -16\): exactly the most negative value, so it fits.
  • \(2 * B = -12\): in range.

Only \(A - B\) leaves the representable range.

Answer: B

GATE CS 2024 Set 2 | Question 14

MCQ · 1 mark · −0.33

The format of a single-precision floating-point number as per the IEEE 754 standard is:

Sign
(1bit)
Exponent
(8 bits)
Mantissa
(23 bits)

Choose the largest floating-point number among the following options.

Options for GATE CS 2024 Set 2 | Question 14

Explanation

Answer: (B)

All four have sign bit 0, so compare their values using the exponent bias of 127.

  • A: exponent 0111 1111 is 127, so the value is \((2 - 2^{-23}) \times 2^{0}\), just under 2.
  • B: exponent 1111 1110 is 254, so the value is \((2 - 2^{-23}) \times 2^{127}\), about \(3.4 \times 10^{38}\).
  • C: an all-ones exponent is reserved. With a non-zero mantissa the pattern means NaN (not a number), which has no value to compare.
  • D: exponent 127 with a zero mantissa is exactly 1.

B is in fact the largest finite single-precision number, so it is the largest option.

Answer: B

GATE CS 2024 Set 2 | Question 49

MSQ · 2 marks

Which of the following is/are EQUAL to 224 in radix-5 (i.e., base-5) notation?

Options for GATE CS 2024 Set 2 | Question 49

Explanation

Answer: (A), (B), (D)

Convert every numeral to decimal using its place values.

  • \(224_5 = 2 \times 5^{2} + 2 \times 5 + 4 = 50 + 10 + 4 = 64\).
  • (A) \(64_{10} = 64\): equal.
  • (B) \(100_8 = 1 \times 8^{2} = 64\): equal.
  • (C) \(50_{16} = 5 \times 16 = 80\): not equal.
  • (D) \(121_7 = 1 \times 7^{2} + 2 \times 7 + 1 = 49 + 14 + 1 = 64\): equal.

So three of the four numerals name the same value, 64; only the hexadecimal one differs.

Answer: A, B, D