Skip to content
Official PYQ · 1998

GATE CS 1998 Q2.20 — Number Representations (Fixed and Floating Point)

Explain with AI

Suppose the domain set of an attribute consists of signed four digit numbers. What is the percentage of reduction in storage space of this attribute if it is stored as an integer rather than in character form?

Choose one option
View worked solution

Answer: C

To find the percentage reduction in storage space, we compare the storage requirements of the attribute in character form versus integer form.

1. Storage in Character Form

A signed four-digit number (e.g., -9999 or +1234) consists of:

  • 11 sign character (+ or -)
  • 44 digit characters

This requires a total of 55 characters. Since each character typically takes 11 byte of storage, the total space required in character form is:

Storagechar=5 bytes\text{Storage}_{\text{char}} = 5 \text{ bytes}

2. Storage in Integer Form

The range of signed four-digit numbers is from −9999-9999 to +9999+9999. The total number of distinct values in this range is:

9999−(−9999)+1=19999 values9999 - (-9999) + 1 = 19999 \text{ values}

To represent 1999919999 distinct values, the minimum number of bits required is:

⌈log⁡2(19999)⌉=15 bits\lceil \log_2(19999) \rceil = 15 \text{ bits}

In standard computer systems, memory is allocated in bytes. The smallest standard integer size that can accommodate 1515 bits is a 22-byte (1616-bit) short integer (which can store values from −32768-32768 to +32767+32767). Thus, the space required in integer form is:

Storageint=2 bytes\text{Storage}_{\text{int}} = 2 \text{ bytes}

3. Percentage Reduction

The reduction in storage space is:

Percentage Reduction=Storagechar−StorageintStoragechar×100%\text{Percentage Reduction} = \frac{\text{Storage}_{\text{char}} - \text{Storage}_{\text{int}}}{\text{Storage}_{\text{char}}} \times 100\%

Percentage Reduction=5−25×100%=60%\text{Percentage Reduction} = \frac{5 - 2}{5} \times 100\% = 60\%

Hence, the percentage of reduction in storage space is 60%.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Number Representations (Fixed and Floating Point) questions