269
ICC
13.
Appendix A: Database Endianness
A key feature of the Millennium Series gateways is the ability to change the byte
order storage scheme for data in the database between big endian and little
endian. The database endianness is the convention used to store multi-byte data
to or retrieve multi-byte data from the database. The selected endianness affects
the end-to-end consistency of multi-byte data between the two networks on the
gateway.
To better understand how this byte-ordering scheme works, the following explains
how the gateway stores and retrieves multi-byte data to and from the database.
Data is stored into the database starting at the low address and filled to higher
addresses. The endianness determines whether the most-significant or least-
significant bytes are stored first.
Let’s look at some examples that demonstrate this.
This example shows how
the hex value 12345678 is
stored into the database
using a big endian byte
order. Since the hex value
12 is the most significant
byte, it is stored at address
“a”, the lowest address.
This other example shows
how the hex value 12345678
is stored into the database
using a little endian byte
order. Since the hex value
78 is the least significant
byte, it is stored at the lowest
address.
Similarly, data is retrieved
from the database starting at the low address. The endianness decides whether
the first byte is the least-significant byte or the most-significant byte of the multi-
byte number.
Here are some examples that demonstrate this.
Figure 101: Big Endian Storage
Figure 102: Little Endian Storage