![Xilinx Virtex-II Pro PPC405 Скачать руководство пользователя страница 41](http://html1.mh-extra.com/html/xilinx/virtex-ii-pro-ppc405/virtex-ii-pro-ppc405_user-manual_3410279041.webp)
March 2002 Release
349
Virtex-II Pro™ Platform FPGA Documentation
1-800-255-7778
Operand Conventions
R
Byte Ordering
The order that addresses are assigned to individual bytes within a scalar (a single data
object or instruction) is referred to as
endianness
. Halfwords, words, and doublewords all
consist of more than one byte, so it is important to understand the relationship between the
bytes in a scalar and the addresses of those bytes. For example, when the processor loads a
register with a value from memory, it needs to know which byte in memory holds the high-
order byte, which byte holds the next-highest-order byte, and so on.
Computer systems generally use one of the following two byte orders to address data:
•
Big-endian
ordering assigns the lowest-byte address to the highest-order (“left-most”)
byte in the scalar. The next sequential-byte address is assigned to the next-highest
byte, and so on. The term “big endian” is used because the “big end” of the scalar
(when considered as a binary number) comes first in memory.
•
Little-endian
ordering assigns the lowest-byte address to the lowest-order (“right-
most”) byte in the scalar. The next sequential-byte address is assigned to the next-
lowest byte, and so on. The term “little endian” is used because the “little end” of the
scalar (when considered as a binary number) comes first in memory.
The following sections further describe the differences between big-endian and little-
endian byte ordering. The default byte ordering assumed by the PPC405 is big-endian.
However, the PPC405 also fully supports little-endian peripherals and memory.
Structure-Mapping Examples
The following C language structure,
s
, contains an assortment of scalars and a character
string. The comments show the values assumed in each structure element. These values
show how the bytes comprising each structure element are mapped into memory.
struct {
int a;
/* 0x1112_1314 word */
long long b;
/* 0x2122_2324_2526_2728 doubleword */
char *c;
/* 0x3132_3334 word */
char d[7];
/* ’A’,’B’,’C’,’D’,’E’,’F’,’G’ array of bytes */
short e;
/* 0x5152 halfword */
int f;
/* 0x6162_6364 word */
} s;
C structure-mapping rules permit the use of padding (skipped bytes) to align scalars on
desirable boundaries. The structure-mapping examples show how each scalar aligns on its
natural boundary (the alignment boundary is equal to the scalar size). This alignment
introduces padding of four bytes between
a
and
b
, one byte between
d
and
e
, and two bytes
between
e
and
f
. The same amount of padding is present in both big-endian and little-
endian mappings.
Содержание Virtex-II Pro PPC405
Страница 1: ...R Volume 2 a PPC405 User Manual Virtex II Pro Platform FPGA Developer s Kit March 2002 Release...
Страница 14: ...322 www xilinx com March 2002 Release 1 800 255 7778 Virtex II Pro Platform FPGA Documentation Preface R...
Страница 252: ...560 www xilinx com March 2002 Release 1 800 255 7778 Virtex II Pro Platform FPGA Documentation R...
Страница 260: ...568 www xilinx com March 2002 Release 1 800 255 7778 Virtex II Pro Platform FPGA Documentation R...
Страница 562: ...870 www xilinx com March 2002 Release 1 800 255 7778 Virtex II Pro Platform FPGA Documentation R...