Skip to content

Select your region & language

Global

Region

Fundamentals of Digital Measurement - Part 15: "Floating-Point Format and Data Transfer"

This time, continuing from last time, we will discuss various floating-point data formats and how to read them on an external PC.
I will talk about methods and other related topics.

Digital data obtained from digital measuring instruments such as FFT analyzers can be read on a PC or similar device.
In order to assign data to a variable, you need to understand the format and order of that data.

The digital data format of the measured/analyzed results can be broadly divided into fixed-point format and floating-point format.
It can be divided into the following. As for fixed-point format, it is mainly from the digital input of an A/D converter.
This is a time-based data sequence, for example, in 16-bit two's complement format (2 bytes).
When reading byte by byte using a terminal or similar device, the desired numerical value (integer binary data)
Let x be the value of the original text. Then, convert it as follows:

  • 16-bit two's complement format
    16-bit two's complement format

The problem here is what order the 1-byte data is read in, i.e., the measuring instrument
It's about the order in which they are sent from the side.

Generally, a computer can access data where each point consists of multiple bytes in memory on a byte-by-byte basis.
The method of storing data in memory is to store the higher byte (M) in the lower address (bit
Gwentic (a method of storing data in a lower address, such as little-endian)
There are two types.

For example, the above 2-byte data (16-bit data, where the value is 1234H in hexadecimal)
If the data is stored starting from address 1000H, it would look like Figure 1.

  • Fundamentals of Digital Measurement - Part 15: "Floating-Point Format and Data Transfer" _NO.1
    Big Endian
  • Fundamentals of Digital Measurement - Part 15: "Floating-Point Format and Data Transfer" _NO.2

Figure 1. Differences in storage methods for multibyte data (when using 2 bytes)

When 1 data is 4 bytes (32-bit data, where the numerical value is 12345678H in hexadecimal)
The same applies to (Figure 2).

  • Fundamentals of Digital Measurement - Part 15: "Floating-Point Format and Data Transfer" _NO.3

Big Endian

  • Fundamentals of Digital Measurement - Part 15: "Floating-Point Format and Data Transfer" _NO.4

Little Endian

Figure 2. Differences in storage methods for multibyte data (when using 4 bytes)

A comparison of the two methods is shown in Table 1. Recently, biendian systems that support both methods have been adopted.
There are also CPUs that do this (such as PowerPC). Also, LAN networks (TCP/IP protocol)
It appears that the rule is that multi-byte data is transferred using the big-endian method.

  Features Main compatible CPUs
Big Endian When the memory is displayed, the arrangement is human
Easy to understand in between
Motorola-based CPUs
(68 series)
Little Endian For computers, processing is easy.
And the speed increases.
It is also memory efficient.
Intel-based CPUs
(x86 system)

Table 1. Comparison of storage methods

As in the example above, the data transferred from the interface is read one byte at a time.
If you want to put the data into variables, you can convert each data point into a numerical variable as long as you know the data format and transfer order.
That would be ideal.

In measuring instruments, raw time data from the A/D converter is processed, so the result is ordinary.
The data will be in floating-point format. This is the IEEE standard format explained in the previous measurement column.
The main floating-point formats, including those shown, are represented in Figure 3.

  • Fundamentals of Digital Measurement - Part 15: "Floating-Point Format and Data Transfer" _NO.5
  • Fundamentals of Digital Measurement - Part 15: "Floating-Point Format and Data Transfer" _NO.6
  • Fundamentals of Digital Measurement - Part 15: "Floating-Point Format and Data Transfer" _NO.7
  • Fundamentals of Digital Measurement - Part 15: "Floating-Point Format and Data Transfer" _NO.8

Figure 3. Various floating-point formats

The first and second figures in Figure 3 are floating-point formats (single precision and double precision) according to the IEEE 754 standard.
It has become a standard format supported by modern CPUs and programming languages.
The third is BASIC, a language commonly used on older personal computers and developed by Microsoft.
This is the floating-point format. The fourth one is the floating-point format used with 8/16 bit microcontrollers.
This is the format used in the Am9511A arithmetic unit (manufactured by AMD). It is a floating-point data format.
Of course, the data is multi-byte (4 bytes for single precision, 8 bytes for double precision), so
The order in which they are arranged is also important.

In modern high-level programming languages such as C, it is possible to input binary data from external devices.
Commands and functions that stop, read, and automatically store the data in a specified array variable.
It is available. In this case, the order and format of the data will match those of the reading PC.
It is important to have this.

In the case of fixed-point format, usually only the order of the data needs to be considered, but floating-point
In multi-point data, not only the order of the data points but also the data format (which format, single precision or double precision) is important.
You also need to consider accuracy. From the device's perspective, you need to consider the data transfer order and floating-point format.
We have provided commands that you can specify.

In recent years, measuring instruments have been designed to be compatible with the currently dominant Windows PCs, so the data transfer order is little-end.
The mainstream approach for Dian and floating-point formatting is to comply with the IEEE 754 standard.

(Addendum) January 9, 2009

The standard binary file (DAT file) for our FFT analyzer (DS/CF series)
When reading the data with other software, the data order (endianness) and floating-point format are also important.
This is how it will be. DAT files are all big-end for compatibility with previous analyzers.
It is saved in Ian.

Please refer to the "CF Standard Binary File Specification" on the FAQ site.

Ono Sokki- DS-2000 FAQ - CF Standard Binary File Specifications

(Excerpt from the email newsletter issued on December 18, 2008)