Handbook of Computer Science(cs) and IT


fixed Point Representation

Because of computer hardware limitation everything including the sign of number  has to be represented either by 0’s or 1’s.

So, for a positive number the leftmost bit or sign bit is always 0 and for a

negative number the sign bit should be 1.

Representation of Integers

The are three possible ways  to represent a number

  • Signed magnitude method
  • 1’s complement method
  • 2’s complement method

 

Signed Magnitude Method

Number is divided into two parts, one is sign bit and other part for magnitude, In example we are using 5 bit register to represent – 6 and + 6.

 

 

 

 

 

Range of Number For n bit register, MSB will be a sign bit and (n – 1) bits will be magnitude.

 

 

Key Points…………………………………………

Drawback of signed magnitude method is that 0 will be having 2 different representation one will be 10000 i.e., – 0 and the other one will be  00000 +O.

1’s Complement Method

Positive numbers are represented in same way as sign magnitude method. If number is negative, then it is represented using 1’s complement method. For this, we first need to represent the number with positive sign a then take l’s complement of this number.

 

e.g., Suppose we are using 5 bit register. The representation of –6 will be as below.

 

 

 

Key Points

  • The only drawback of 1’s complement method is that there are two different representation for zero, one is – 0 and other is + 0.

2’s Complement Method

Positive numbers are represented in same way as in sign magnitude. For representing negative number, we take 2’s complement of the corresponding positive number.

 

 

 

 

 

 

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95

Leave a Reply

Your email address will not be published. Required fields are marked *