42
ICC
12.
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. Figure 11 shows how the
hex value 0x12345678 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.
Figure 11: Big Endian Storage
Figure 12 demonstrates how the hex value 0x12345678 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.
Figure 12: Little Endian Storage