Fraction Length Greater Than Word Length
A fraction length greater than the word length of a fixed-point number occurs when the number has an absolute value less than one and contains leading zeros.
x = fi(.0234,1,8)
x = 0.0234 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 8 FractionLength: 12
View the binary representation of
There are four implicit leading zeros after the binary point and before the binary
representation of the stored integer because the fraction length of
is four greater than the word length.
Convert from binary to decimal the binary representation of
four leading zeros, and scale this value according to the fraction length.
ans = 0.0234
The result is the real world value of
You can also find the real world value using the equation .
Start by finding the stored integer of
Q = storedInteger(x)
Q = 96
Use the stored integer to find the real world value of
real_world_value = double(Q) * 2^-x.FractionLength
real_world_value = 0.0234