Changes

Jump to: navigation, search

Big-endian

3,098 bytes added, 20:29, 26 April 2019
Created page with "'''Home * Programming * Data * Endianness * Big-endian''' '''Big-endian''' is most often referred to the endianness or order of multi..."
'''[[Main Page|Home]] * [[Programming]] * [[Data]] * [[Endianness]] * Big-endian'''

'''Big-endian''' is most often referred to the [[Endianness|endianness]] or order of multiple [[Byte|Bytes]] inside a composite item, such as a [[Word]] (two bytes), a [[Double Word]] (four bytes) or a [[Quad Word]] (eight bytes), which keeps the byte order (in the arithmetical sense) in the reverse order of their addresses in [[Memory|memory]] - for instance the integer 16909060 or 0x01020304.

=Memory layout=
0x01020304
{| class="wikitable"
|-
! Address
! Byte
! Significance
|-
| 0x0000
| 0x01
| MS Byte
|-
| 0x0001
| 0x02
|
|-
| 0x0002
| 0x03
|
|-
| 0x0003
| 0x04
| LS Byte
|}

=Big-Endian Files=
File index 0 maps the H-File, index 7 the A-File.

=Big-Endian Ranks=
Rank index 0 maps the eight Rank, index 7 the first Rank.

=Least Significant Ranks=
* [[Files]] are the big-end over [[Ranks|ranks]]:
<pre>
squareIndex = 8*fileIndex + rankIndex
fileIndex = squareIndex div 8
rankIndex = squareIndex mod 8
</pre>
The BERF-coordinates with Big-endian [[Files]] and Big-endian [[Ranks]]:
<pre>
enum enumSquare {
h8, h7, h6, h5, h4, h3, h2, h1, // 0 .. 7
g8, g7, g6, g5, g4, g3, g2, g1, // 8 .. 15
f8, f7, f6, f5, f4, f3, f2, f1, // 16 .. 23
e8, e7, e6, e5, e4, e3, e2, e1, // 24 .. 31
d8, d7, d6, d5, d4, d3, d2, d1, // 32 .. 39
c8, c7, c6, c5, c4, c3, c2, c1, // 40 .. 47
b8, b7, b6, b5, b4, b3, b2, b1, // 48 .. 55
a8, a7, a6, a5, a4, a3, a2, a1, // 56 .. 63
};
</pre>
''Note: If printing boards from top to bottom, one has to start with the big-end rank.''
<pre>
A B C D E F G H
+----+----+----+----+----+----+----+----+
8 | 56 | 48 | 40 | 32 | 24 | 16 | 8 | 0 | 8th rank
+----+----+----+----+----+----+----+----+
7 | 57 | 49 | 41 | 33 | 25 | 17 | 9 | 1 | 7th rank
+----+----+----+----+----+----+----+----+
6 | 58 | 50 | 42 | 34 | 26 | 18 | 10 | 2 | 6th rank
+----+----+----+----+----+----+----+----+
5 | 59 | 51 | 43 | 35 | 27 | 19 | 11 | 3 | 5th rank
+----+----+----+----+----+----+----+----+
4 | 60 | 52 | 44 | 36 | 28 | 20 | 12 | 4 | 4th rank
+----+----+----+----+----+----+----+----+
3 | 61 | 53 | 45 | 37 | 29 | 21 | 13 | 5 | 3rd rank
+----+----+----+----+----+----+----+----+
2 | 62 | 54 | 46 | 38 | 30 | 22 | 14 | 6 | 2nd rank
+----+----+----+----+----+----+----+----+
1 | 63 | 55 | 47 | 39 | 31 | 23 | 15 | 7 | 1st rank
+----+----+----+----+----+----+----+----+
A B C D E F G H - file(s)
</pre>
=Date-Format=
The big-endian date format: yyyy-mm-dd.

=See also=
* [[Little-endian]]
* [[Square Mapping Considerations]]
* [[Flipping Mirroring and Rotating]]
* [[Word]]
* [[Double Word]]
* [[Quad Word]]

=External Links=
* [https://en.wikipedia.org/wiki/Endianness Endianness from Wikipedia]
* [http://www.ietf.org/rfc/ien/ien137.txt IEN 137 - DAV's Endian FAQ - On Holy Wars and a Plea for Peace] by [http://www.myri.com/staff/cohen/ Danny Cohen], [http://ai.isi.edu/ U S C/I S I], April 1, 1980

'''[[Endianness|Up one Level]]'''

Navigation menu