Monday, January 7, 2013

GATE-Digital Logic-Number System

Previous GATE questions with solutions on Digital Logic (Number System) - CS/IT

GATE-1999
1. Booth’s coding in 8 bits for the decimal number –57 is 
(a) 0–100+1000
(b) 0–100+100-1 
(c) 0–1+100–10+1
(d) 00–10+100-1

Ans: option (b)
Explanation:
Booth's Encoding: 
1. If ith bit bi is 0 and (i –1)th bit bi-1 is 1, then take bi as +1
2. If ith bit bi is 1 and (i –1)th bit bi-1 is 0, then take bi as –1
3. If ith bit bi is 0 and (i –1)th bit bi-1 is 0, then take bi as 0
4. If ith bit bi is 1 and (i –1)th bit bi-1 is 1, then take bi as 0

Note: When lsb b0= 1, assume that it had b-1 as 0, thus take b0 = –1

GATE-2000
2. The number 43 in 2's complement representation is
(a) 01010101
(b) 11010101
(c) 00101011
(d) 10101011

Ans: option(c)
Explanation:
If the number is positive: 2's complement numbers are represented as the simple binary.
Therefore 2's complement of 43 = 0010 1011
But if the question was to find 2's complement of -43 then we should proceed as below.
To find 2's complement first find the 1's complement and add 1 to the result
43 = 0010 1011
1's complement of 43 = 1101 0100   { To find 1's complement: change the bit 1 to 0 and 0 to 1 }
2's complement of 43 = 1's complement of 43 + 1 = 11010100 +1 = 11010101

GATE-2002
3. The 2's complement representation of the decimal value -15
(a) 1111     (b) 11111       (c) 111111      (d) 10001

Ans: option(d)
Explanation:
Binary representation of 15 = 1111
2's complement = 1's complement + 1 = 0000 + 1 = 0001
The 2's complement representation of the decimal value -15 = 10001.

GATE-2002
4. The decimal value 0.25
(a) is equivalent to binary 0.1
(b) is equivalent to binary 0.01
(c) is equivalent to binary 0.00111
(d) cannot be represented precisely in binary

Ans: option (b)
Explanation:
Decimal to Binary - Multiply the fraction with the radix (2) and  isolate the integer portion. Repeat this until either the fraction becomes zero or significant digits are reached.
0.25 x 2 = 0.50 => 0
0.50 x 2 = 1.00 => 1
Therefore the binary = 0.01

GATE-2003
5. Assuming all numbers are in 2’s complement representation, which of the following numbers is divisible by 1111 1011?
(a) 11100111
(b) 11100100
(c) 11010111
(d) 11011011

Ans: option (a)
Explanation:
All numbers are given in 2's complement. 
The most significant bit is 1 this means that the number is a negative number. To get the magnitude of the number perform the 2's complement of 1111 1011.

2's complement of divisor (11111011) = 1's complement  + 1 = 00000100 + 1 =00000101
Therefore, divisor = -5 (because the MSB of 2's complement was 1. Therefore its negative 5).
On doing the same as above (as done for the divisor), find the decimal value for all the options. We can see that only option (a) is exactly divisible by 2. The decimal value of option (a) is -25.

GATE-1997
6. Given √(224)r= (13)r
The value of the radix r is:
(a) 10         (b) 8          (c) 5        (d) 6

Ans: option (c)
Explanation:
Above an be written as: (224)r = (13)r2
Converting to decimal number:  
2r2 + 2r1 + 4r0 = (1r1 + 3r0)2
2r2 + 2r + 4 = (r + 3)2
r2 - 4r - 5 = 0

Root of the above equation is 5, -1. Therefore radix = 5

GATE-2004
7.  Let A = 1111 1010 and 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

Ans: option (a)
Explanation:
Since MSB of a is 1, 2's complement of A = 0000 0110. Therefore A = -6
B = 10.
A x B = -60
Since a negative number we have to find the 2's complement of -60
Represent -60 in 2's complement.
Binary of 60 = 0011 1100
2's complement = 1100 0100

GATE-2001
8. The 2's complement representation of (-539)10 in hexadecimal is
(a) ABE             (b) DBC          (c) DE5          (d) 9E7

Ans: option (c)
Explanation:
find the 2's complement of -539:-
Binary representation of 539 = 0010 0001 1011
2's complement = 1101 1110 0101
4 digits in binary represents 1 digit in hexadecimal representation.
Therefore 1101 1110 0101 = DE5

GATE-2010
9. P is a 16-bit signed integer. The 2’s complement representation of P is (F87B)16. The 2’s complement representation of 8 x P is
(a) (C3D8)16        (b) (187B)16         (c) (F878)16         (d) (987B)16

Ans: option (a)
Explanation:
Convert Hexadecimal number to binary: Representing each digit of the hexadecimal by 4 bits. Hence we get
F87B = 1111 1000 0111 1011

The most significant bit is 1 this means that the number is a negative number. To get the magnitude of the number perform the 2's complement of the number and number thus came is 1925, 
Hence P = -1925

8 x P = -15400

Since a negative number we have to find the 2's complement of -15400
Binary of 15400 = 0011 1100 0010 1000
2's Complement = 1100 0011 1101 1000
4 digits in binary represents 1 digit in hexadecimal representation.
Therefore = 1100 0011 1101 1000 = C3D8


GATE-2013
10. 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

Ans: option (b)
Explanation:
An N-bit two's-complement numeral system can represent every integer in the range −(2N1) to +(2N1  1) while ones' complement can only represent integers in the range −(2N1  1) to +(2N1  1)

Hence the smallest integer that can be represented by an 8-bit number = -28-1 = -27 = -128

5 comments:

  1. question no 2 is wrong here because they are asking 2's complement of +43 positive number . so no need to convert to 2's complement . its direct binary conversion .so option (c) is correct.

    ReplyDelete
    Replies
    1. Thank you Sri... I have corrected it.

      Delete
  2. thanx you sir . they r very helful to me.

    ReplyDelete
  3. Thanks u sir... I was actually confused in that type of questions.. thanks a lot.

    ReplyDelete