
Communication GUI Guide
GXE600 Series
TDK-Lambda
<Page>
41/41
5.3 Q format
Q format is a numerical type for handling decimal virtually with integer data.
GXE treat all values as integers (Binary numbers).
So GXE handles numeric values with Q format data when you need decimal values.
In the Q format, when written as Q"n" format, data is handled assuming that there is a decimal point between the "n" th bit
and the "n - 1" th bit of the data.
Example ) 1.25 [Q10]
1.25 [Q10] = 1.25 x 210 = 1280d = 0x0500 = 0b0000 0101 0000 0000
In the case of a signed integer,
"b15" is sign bit.
20 + 2-2 = 1 + 0.25 = 1.25
The numerical resolution becomes 2-n.
Example) In Q10 format, 2-10=1/1024
Therefore, for values that cannot be divided by 2-n, it shall be an approximate value.
For example, when decimal number is 0.1, decimal operation can be divided by first decimal place and value can be
accurately expressed.
However, because binary operation cannot divide the value, truncation errors occur even if the number of digits in the
decimal part is increased.
Assuming that it is expressed in Q16 format [16 decimal places]
0.1 [Q16] = 0.1 x 216 = 6553d = 0x1999 = 0b0001 1001 1001 1001
It becomes a circulating binary decimal of 1100 from the bit weight of 2-4.
Returning the value of this binary number to decimal number, it will be 0.0999908447265625.
(it will not be exact 0.1)
Because it is a circular decimal, truncation errors do not disappear even if infinitely increasing the number of digits.
・
When the numerical data is normalized
The actual value is the reference value when the normalized data is 1.0.
As the numerical value becomes a decimal number, GXE handles normalized data in Q format.
・
Conversion of physical quantity (voltage and current) and normalized data
Normalized data = physical quantity / reference value
Physical quantity = reference value x normalized data
・
Example of output voltage measurement value of 24V model
Reference value = Nominal voltage = 24 [V]
When the output voltage = 23.5 [V]
Normalized data = 23.5 / 24 = 0.97917
Q format representation of normalized data
Q10 format: INT (normalized data * 210) = 1002d = 0x03EA
Q14 Format: INT (normalized data * 214) = 16042d = 0x3EEA
Conversely, when converting the normalized data expressed in the Q format to the physical quantity
Physical quantity = reference value x Qn format data x 2 - n
0 0 0 0 0 1 0 1 0 0 0 0 0 0 0
b0
0
b1
b2
b3
b4
b5
b6
b7
b8
b9
b10
b11
b12
b13
b14
b15
仮想小数点
2
-1
2
-2
2
-10
2
1
2
0
2
5
ビット重み
整数部
小数部
Virtual decimal point
Bit weight
Decimal
Integer