# Number Representation

123
 Question 1
The smallest integer that can be represented by an 8-bit number in 2’s complement form is
 A -256 B -128 C -127 D 0
GATE CS 2013    Number Representation
Discuss it

Question 1 Explanation:
See Two's complement For n bit 2's complement numbers, range of number is -(2(n-1)) to +(2(n-1)-1)
 Question 2
T he decimal value 0.5 in IEEE single precision floating point representation has
 A fraction bits of 000…000 and exponent value of 0 B fraction bits of 000…000 and exponent value of −1 C fraction bits of 100…000 and exponent value of 0 D no exact representation
GATE CS 2012    Number Representation
Discuss it

Question 2 Explanation:
The IEEE 754 standard specifies following distribution of bits: Sign bit: 1 bit Exponent width: 8 bits Significand or Fraction: 24 (23 explicitly stored) 0.5 in base 10 means 1 X 2-1 in base 2. So exponent bits have value -1 and all fraction bits are 0
 Question 3
P is a 16-bit signed integer. The 2's complement representation of P is (F87B)16.The 2's complement representation of 8*P
 A (C3D8)16 B (187B)16 C (F878)16 D (987B)16
GATE CS 2010    Number Representation
Discuss it

Question 3 Explanation:
P = (F87B)16 is -1111 1000 0111 1011 in bianry Note that most significant bit in the binary representation is 1, which implies that the number is negative. To get the value of the number perform the 2's complement of the number. We get P as -1925 and 8P as -15400 Since 8P is also negative, we need to find 2's complement of it (-15400) Binary of 15400 = 0011 1100 0010 1000 2's Complement = 1100 0011 1101 1000 = (C3D8)16
 Question 4
(1217)8 is equivalent to
 A (1217)16 B (028F)16 C (2297)10 D (0B17)16
GATE-CS-2009    Number Representation
Discuss it

Question 4 Explanation:
(1217)8 = (001 010 001 111)= (0010 1000 1111) = (28F)16
 Question 5
In the IEEE floating point representation, the hexadecimal value 0 × 00000000 corresponds to
 A the normalized value 2-127 B the normalized value 2-126 C the normalized value +0 D the special value +0
GATE CS 2008    Number Representation
Discuss it

Question 5 Explanation:

 Question 6
The value of a float type variable is represented using the single-precision 32-bit floating point format IEEE-754 standard that uses 1 bit for sign, 8 bits for biased exponent and 23 bits for mantissa. A float type variable X is assigned the decimal value of −14.25. The representation of X in hexadecimal notation is
 A C1640000H B 416C0000H C 41640000H D C16C0000H
GATE-CS-2014-(Set-2)    Number Representation
Discuss it

Question 6 Explanation:
```Since No is negative S bit will be 1
Convert 14.25 into binary 1110.01
Normalize it : 1.11001 X 2 ^ 3
Biased Exponent (Add 127) : 3 + 127 = 130 (In binary 10000010)
Mantissa : 110010.....0 (Total 23 bits)

Num represented in IEEE 754 single precision format :

1 10000010 11001000000000000000000

In Hex (Group of Four bits) -

1100 0001 0110 0100 0000 0000 0000 0000

Num becomes : C1640000
```
 Question 7
The range of integers that can be represented by an n bit 2's complement number system is
 A - 2n - 1 to (2n - 1 - 1) B - (2n - 1 - 1) to (2n - 1 - 1) C - 2n - 1 to 2n - 1 D - (2n - 1 + 1) to (2n - 1 + 1)
GATE-CS-2005    Number Representation
Discuss it

Question 7 Explanation:
For example, signed char is 8 bits, we can store from -128 to 127 using sign char. Refer http://en.wikipedia.org/wiki/Two%27s_complement for more details.
 Question 8
If 73x (in base-x number system) is equal to 54y (in base-y number system), the possible values of x and y are
 A 8, 16 B 10, 12 C 9, 13 D 8, 11
GATE-CS-2004    Number Representation
Discuss it

Question 8 Explanation:
We can solve it by converting both to decimals. 3 + 7*8 = 4 + 11*5
 Question 9
What is the result of evaluating the following two expressions using three-digit floating point arithmetic with rounding?
```(113. + -111.) + 7.51
113. + (-111. + 7.51) ```
 A 9.51 and 10.0 respectively B 10.0 and 9.51 respectively C 9.51 and 9.51 respectively D 10.0 and 10.0 respectively
GATE-CS-2004    Number Representation
Discuss it

Question 9 Explanation:
```(113. + -111.) + 7.51
= 2 + 7.51
= 9.51

113. + (-111. + 7.51)
= 113. + (-111. + 7.51)
= 113. - 103. = 10 [103.49 is rounded to 103.0]
```
 Question 10
Let A = 1111 1010 arid B = 0000 1010 be two 8-bit 2's complement numbers. Their product in 2's complement is
 A 1100 0100 B 1001 1100 C 1010 0101 D 1101 0101
GATE-CS-2004    Number Representation
Discuss it

Question 10 Explanation:
Here, we have A = 1111 1010 =  - 610 (A is a 2's complement number) B = 0000 1010 =  1010 (B is a 2's complement number)   A x B = - 6010 = 1 011 11002 = 1 100 0011 (1's complement) = 1 100 0100 (2's complement)   Thus, the product of A and B in 2's complement is 1100 0100, which is option A. So, A is the correct option.   Please comment below if you find anything wrong in the above post.
There are 23 questions to complete.
123