Fixed Point Representation Tutorial with Examples of Computer
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.
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.
- 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.
Sorting in Design and Analysis of Algorithm Study Notes with Example
Follow Us On Cyber Point Solution Youtube Channel : Click Here
Follow Us on Social Platforms to get Updated : twiter, facebook, Google Plus
Learn More Ethical Hacking and Cyber Security click on this link. cyber security