![]() |
TECHNICAL NOTES
- DT7
|
Terminology
We will first define some terminology used throughout the rest of this document.
A field of length L, consists of a group of L consecutive bytes in a system buffer, within which is contained the floating point number Nfp, in ASCII format. The number may be right or left justified, or in general placed anywhere within the field. The sign '-' must be included within the field for negative numbers, while the sign '+' is optional for positive numbers. The sign may be placed immediately to the left of the most significant digit, or there may be some blanks in between.
In general, the acceptable format for Nfp is as follows:
S[+]SD[.]DS ....... for positive numbers
S-SD[.]DS ......... for negative numbers,
where:
S = zero or more spaces (20hex)
D = zero or more digits ('0' to '9')
[x] = zero or one instance of character 'x'.
A subfield consists of C consecutive bytes, right justified within the field (1< = C < = L) (as will be discussed in a later section, in the case of 'ASCII Fourth Difference' data types, which use the 32-bit conversion, a subfield of length C > L may be specified, to indicate that (C - L) leading zeros must be assumed).
The example below shows a field of length L = 10, and a subfield with C = 6:

The syntax for specifying a pseudo trace is now based on these concepts of field and subfield. Basically, the 'offset' parameter remains the same as before, and instead of providing a 'count', we must now provide the field length L, and the subfield length C. In general, the syntax is as follows:
BUFF ssssH llccH ,
where 'BUFF' is the named buffer, 'ssss' is the offset from the base address of the buffer, 'll' is the field length L in hexadecimal, and 'cc' is the subfield length in hexadecimal.
As a practical example, consider the following contents of the IEEE buffer, where 'x' denotes a "don't care":

To specify a pseudo trace for the three least significant digits in the number, as indicated by the subfield above, the syntax would be:
EEEB 3 0703H
Scaling for 16-bit Conversions
The number Nfp is converted into a value V in units of volts, between -10.0 and +10.0, represented using 16-bit 2's complement notation.
The conversion is carried out by "removing" the decimal point in Nfp (if present), isolating the number within the subfield, and assuming an implicit decimal point to the right of the most significant digit of the resulting integer, denoted by N.
More formally, the conversion is as follows:
| V = N x 10-C+1 , if '.' is not included in the subfield |
(1)
|
= N x 10-C+2 , otherwise.
As an example, consider the field {+ 12.456}, with L=8 and C=3. Then we have:
Nfp = 12.456
N = 456
V = N . 10-C+1 = 456 x 10-3+1= 4.56
Several other examples are summarized in Figure 1. Notice that with 16-bit precision, only four decimal places are significant.
Figure 1 - Examples of scaling interpretation for 16-bit conversion
Scaling for 32-bit Conversions (4th Difference)
A) General Description.
For creation of pseudo traces using the '4th Difference' data type, the computations require of an internal 32-bit 2's complement representation. However, only the 16 least significant bits are used to generate the trace information; with this, for a straight ASCII to binary conversion, the internal representation of the input number Nfp in units of volts is:
| V' = 216 x V , |
(2)
|
where V is as defined in (1).
The complete process involves (a) conversion of Nfp to a 32-bit value V; (b) processing of V through the basic 4th difference algorithm; (c) division of the output of the fourth difference by 16, resulting in a (32-bit) value V4D; and (d) truncation to a 16-bit number for the generation of the trace, by considering only the 16 least significant bits of V4D, as explained above; this results in V'4D = 216 x V4D. Notice that the division by 16 scales the output of the 4th difference so that V4D has equivalent units to V (e.g., if the number Nfp corresponding to V is in units of 'gamma', then the output of the 4th difference processing, N4Dfp, corresponding to V4D, will also be in units of 'gamma'). For illustration, a block diagram of the complete process is shown in Figure 2.
Figure 2 - Block diagram of Fourth Difference processing.
Given the equivalence in the units of V4D and V, in order to determine the scaling on the chart recorder, it suffices to consider the value V' corresponding to a given input Nfp. For example, for a magnetometer input of 6 digits (XXXXX.X), for an input of 1 gamma we would have the field {____1.0} , where L = 7. If we take C = 7 to specify the pseudo trace, we have:
Nfp = 1.0 , L = 7 , C = 7
N = 10
from (1): V = 10 x 10-7+2 = 0.0001 volts
from (2): V' = 216 x V = 6.55 volts
If a sensitivity of 1 gamma/cm is desired on the chart recorder, we must select a sensitivity S, given by:
S = V' [volts/gamma] x 1 [gamma/cm] = 6.55 volts/cm
B) Overflow considerations.
Given the limitation of 16 bits to encode the output of the Fourth Difference
algorithm, one must be careful to avoid overflowing. Recalling that if
a perfect hash sequence of amplitude A is processed by this algorithm,
one obtains at the output an equivalent hash sequence of amplitude 16A,
a safe restriction to ensure that no overflow occurs, is to limit the voltage
difference between two consecutive samples, (V, according to:
| | |
(3a)
|
so that we have:
| | |
(3b)
|
This restriction may be a problem if the field length L is too small to allow specification of a subfield C, long enough to ensure that for typical variations in the signal voltage, inequality (3) be satisfied. In these cases, one can specify a subfield length C, such that C > L, which will indicate to the conversion routine that (C-L) leading zeros should be assumed; this has the same effect as "moving" the original data to some temporary buffer, where (C-L) zeros could then be inserted before it.
To illustrate the above, consider a field with L = 7, as follows:
![]()
This could be, for example, the result of a binary to ASCII conversion of one of the analog channels. If the maximum amplitude of the steps was limited to 0.1 units, and we wanted to create a Fourth Difference pseudo-trace with L=7, C=7, we would have:
|
V| = 0.01 volts ,
which does not satisfy (3). To avoid this problem, we could specify C=9, which effectively results in the field shown below:
![]()
With this, we have that the maximum step translates into:
|
V| = 0.0001 volts ,
which does satisfy (3).
Notice that this mechanism also provides the means to easily test the correctness of the algorithm. If the input field was indeed generated from one of the analog channels as suggested before, with a square waveform of amplitude Xi = 0.1 volts used as the input, and a pseudo-trace with L=7, C=9 being created, at the points of transition the output should show the spikes characteristic of the Fourth Difference processing, with an amplitude of Xo, given by:
Xo = (Xi/1000) . (6/16) . 216 = 2.4575 volts
This example is illustrated in Figure 3.

Figure 3 - Example showing the response of the Fourth Difference
algorithm to an input step.
|
|
|
|
|
|
|