Fixed-point representation is a method of storing real numbers in a computer system where the position of the decimal (or binary) point is fixed. This method divides the number into an integer part and a fractional part; the split is determined by the number of bits allocated for each, and the binary point remains in the same position.
The Binary Point
The binary point works the same way as the decimal point: it separates the integer part from the fractional part.
- Bits to the left of the binary point have weights 20,21,22...
- Bits to the right of the binary point have weights 2−1,2−2,2−3...
Example in Decimal:
26.5 = 2×101+6×100+5×10−1
Example in Binary:
11010.12 = 16+8+2+0.5 = 26.5
Shifting Pattern
When an integer is shifted right by one bit in a binary system, it is comparable to being divided by two. Since we cannot represent a digit to the right of a binary point in the case of integers since there is no fractional portion, this shifting operation is an integer division.
- A number is always divided by two when the bit pattern of the number is shifted to the right by one bit.
- A number is multiplied by two when it is moved left one bit.
Fixed Point Number
Understanding fixed point number representation requires knowledge of the shifting process described above. Simply by implicitly establishing the binary point to be at a specific place of a numeral, we can define a fixed point number type to represent a real number in computers (or any hardware, in general). Then we will just use this implicit standard to express numbers.
Two arguments are all that are required to theoretically create a fixed point type:
- Width of the number representation.
- Binary point position within the number.
the notation fixed<w, b>, where "w" stands for the overall amount of bits used (the width of a number) and "b" stands for the location of the binary point counting from the least significant bit (counting from 0).
Unsigned Representation
For example, fixed<8,3> signifies an 8-bit fixed-point number, the rightmost 3 bits of which are fractional.
Representation of a real number:
00010.1102
= 1 * 21 + 1 * 2-1 + 1 * 2-2= 2 + 0.5 + 0.25
= 2.75

Signed Representation
Negative integers in binary number systems must be encoded using signed number representations. In mathematics, negative numbers are denoted by a minus sign ("-") before them. In contrast, numbers are exclusively represented as bit sequences in computer hardware, with no additional symbols.
Signed binary numbers (+ve or -ve) can be represented in one of three ways:
- Sign-Magnitude form
- 1’s complement form
- 2’s complement form
Sign-Magnitude form: In sign-magnitude form, the number's sign is represented by the MSB (Most Significant Bit also called as Leftmost Bit), while its magnitude is shown by the remaining bits (In the case of 8-bit representation Leftmost bit is the sign bit and remaining bits are magnitude bit).
55 10 = 001101112
−55 10 = 101101112
1’s complement form: By complementing each bit in a signed binary integer, the 1's complement of a number can be derived. A result is a negative number when a positive number is complemented by 1. Similar to this, complementing a negative number by 1 results in a positive number.
55 10 = 001101112
−55 10 = 110010002
2’s complement form: By adding one to the signed binary number's 1's complement, a binary number can be converted to its 2's complement. Therefore, a positive number's 2's complement results in a negative number. The complement of a negative number by two yields a positive number.
55 10 = 11001000 + 1 (1's complement + 1 = 2's complement)
-55 10 = 11001001 2
Fixed Point Representation of Negative Number
Consider the number -2.5, fixed<w,b> width = 4 bit, binary point = 1 bit (assume the binary point is at position 1). First, represent 2.5 in binary, then find its 2's complement and you will get the binary fixed-point representation of -2.5.
2.5 10 = 0101 2
-2.5 10 = 1010 2 + 1 (1's complement + 1 = 2's complement)
-2.5 10 = 1011 2

1's Complement Representation Range
One bit is essentially used as a sign bit for 1's complement numbers, leaving you with only 7 bits to store the actual number in an 8-bit number.
Therefore, the biggest number is just 127 (anything greater would require 8 bits, making it appear to be a negative number).
The least figure is likely to be -127 or -128 as well.
1's complement:
127 = 01111111 : 1s complement is 10000000
128 = 10000000 : 1s complement is 01111111
We can see that storing -128 in 1's complement is impossible (since the top bit is unset and it looks like a positive number)
The 1's complement range is -127 to 127.
2's Complement Representation Range
Additionally, one bit in 2's complement numbers is effectively used as a sign bit, leaving you with only 7 bits to store the actual number in an 8-bit integer.
2's complement:
127 = 01111111 : 2s complement is 10000001
128 = 10000000 : 2s complement is 10000000
we can see that we can store -128 in 2s complement.
The 2s complement range is -128 to 127.