Você está na página 1de 1

123456789012345678901234567890121234567890123456789012345678901212345678901234567890123456789012123456789012345678901234567890121234567890123 123456789012345678901234567890121234567890123456789012345678901212345678901234567890123456789012123456789012345678901234567890121234567890123 12345678901234567890123456789012123456789012345678901234567890121234567890123456789012345678901212345678901234567890123456789012123456789012 12345678901234567890123456789012123456789012345678901234567890121234567890123456789012345678901212345678901234567890123456789012123456789012

Application Brief AB-32

Application Brief AB34

Big Endian to Little Endian Data Conversion


Using 3.3V Bus Switches
by Refugio Jones August 18, 1999 Introduction
Byte order storage can significantly impact the compatibility between devices within and outside of a system. The order in which data is stored into memory varies according to the application at hand. Big Endian and Little Endian describe the order or sequence in which multi-byte data is stored in memory. Little Endian specifies that the least significant byte is stored in the lowest memory address. The Intel PentiumTM and Compaq/Dec AlphaTM processors are Little Endian. In turn, Big Endian formatting takes the most significant byte and stores it in the lowest memory address (see Figure 1). The Motorola 680x0 and Sun SuperSPARCTM are Big Endian.
M+3 31 24 23 M+2 16 15

Application Description
Often, based on the application, it is required to convert Big Endian into Little Endian formatting or visa versa. Figure 2 show how Pericoms 3.3V Mux/Demux Bus Switches can be used to perform the required conversion. In the example, the PI3B16233 is a bidirectional device and can be easily controlled to convert from one format to the other. Given a double word that is located on the input of the A ports, the PI3B16233 can Mux the word over the B side in the desired order (see Figure 2.)

M+1 8 7

M 0

DOUBLE WORD (32-BIT) IN LITTLE-ENDIAN FORMAT BITS 0-7

M 31 24 23

M+1 16 15

M+2 8 7

M+3 0

DOUBLE WORD (32-BIT) IN BIG-ENDIAN FORMAT M = Most Significant Memory Location or Word

Figure 1. Big Endian vs. Little Endian Memory Formatting

PI3B16233
M3 D24 - D31 8 M3 M0 M2 D16 - D23 8 M2 M1 M0 M2 M1 M3

Intel CPU
Little Endian (Low Order Byte At Starting Address)

Memory

PI3B16233
M1 D8 - D15 8 M2 M0 D0 - D7 8 M3 M1 M2 M3 M0

Motorola CPU
Big Endian (High Order Byte At Starting Address)

Figure 2. Converting Between Big Endian and Little Endian

09/16/99

Você também pode gostar