Big Indian Little Indian

download Big Indian Little Indian

of 1

Transcript of Big Indian Little Indian

  • 8/13/2019 Big Indian Little Indian

    1/1

    1 09/16/99

    1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 1 2 3 4 5 6 7 8 9 0 1 2 3

    1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 1 2 3 4 5 6 7 8 9 0 1 2 3

    Application Brief AB-32

    1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 1 2 3 4 5 6 7 8 9 0 1 2

    1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 1 2 3 4 5 6 7 8 9 0 1 2

    Big Endian to Little Endian Data ConversionUsing 3.3V Bus Switches

    by Refugio Jones August 18, 1999

    Byte order storage can significantly impact the compatibility be-

    tween 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/DecAlphaTMprocessors are Little Endian. In turn, Big Endian format-

    ting takes the most significant byte and stores it in the lowest

    memory address (see Figure 1). The Motorola 680x0 and Sun

    SuperSPARCTMare Big Endian.

    Figure 1. Big Endian vs. Little Endian Memory Formatting

    Application Brief AB34

    Introduction 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, thePI3B16233 can Mux the word over the B side in the desired order

    (see Figure 2.)

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

    31 23 15 724

    M+3 M+2 M+1 M

    16 8 0

    DOUBLE WORD (32-BIT) IN BIG-ENDIAN FORMAT

    M = Most Significant Memory Location or Word

    31 23 15 724

    M M+1 M+2 M+3

    16 8 0

    Intel CPU

    Little Endian

    (Low Order Byte At

    Starting Address)

    M3

    M1

    M0

    M2

    M3

    D24 - D31

    D16 - D23

    D8 - D15

    D0 - D7

    M2

    M3

    M2

    8

    8

    8

    8

    M1

    M0

    MotorolaCPU

    PI3B16233

    PI3B16233

    M0

    M2

    M3

    M1

    M1

    M0

    M3

    M2

    Big Endian

    (High Order Byte At

    Starting Address)

    Memory

    Figure 2. Converting Between Big Endian and Little Endian