BIG-ENDIAN AND LITTLE ENDIAN ASSIGNMENTS
To enable instructions to refer
to individual bytes, the smallest addressable unit in most computers is a byte rather
than a word and such computers are called byte addressable. If the word length
is 32 bits, then 4 bytes can be placed in a word.
The two different schemes used are :-
- Big-Endian Assignment
- Little-Endian Assignment
In Big-Endian assignment, bytes
are numbered starting with most significant byte of a word.
In Little-endian assignment, bytes are numbered
from least significant byte of a word. Word is given the address of its least
significant byte.
Word
Address
|
Big-Endian
|
|
|
|
Word
Address
|
Little-Endian
|
|
|
|
0
|
0
|
1
|
2
|
3
|
0
|
3
|
2
|
1
|
0
|
4
|
4
|
5
|
6
|
7
|
4
|
7
|
6
|
5
|
4
|
8
|
8
|
9
|
10
|
11
|
8
|
11
|
10
|
9
|
8
|
12
|
12
|
13
|
14
|
15
|
12
|
15
|
14
|
13
|
12
|
MSB –––––––––-> LSB MSB –––––––––––> LSB
Word Address
|
Byte Address
|
Word Address
|
Byte Address
|
||||||
0
|
0
|
1
|
2
|
3
|
0
|
3
|
2
|
1
|
0
|
4
|
4
|
5
|
6
|
7
|
4
|
7
|
6
|
5
|
4
|
.
.
.
|
.
.
.
|
||||||||
2k - 4
|
2k - 4
|
2k - 3
|
2k - 2
|
2k - 1
|
2k - 4
|
2k - 1
|
2k - 2
|
2k - 3
|
2k - 4
|
Big-endian assignment
|
Little-endian assignment
|
No comments:
Post a Comment