big endian vs little endian, how to do data bus conversion

Status
Not open for further replies.

ilikebbs

Advanced Member level 4
Joined
Nov 30, 2002
Messages
104
Helped
3
Reputation
6
Reaction score
1
Trophy points
1,298
Activity points
705
for example:
If CPU has 22 bit address bus a[21:0], 32 bit data bus d[31:0] and it is big endian,
Generally we do endian conversion like this.
d[7:0] ---- chip_data[0:7]
d[15:0] ---- chip_data[0:15]
d[31:0] ---- chip_data[0:31]

My question is that since the unit for big endian and little endian is byte, why do not we do endian conversion like this:
===d[7:0] ---- chip_data[0:7]
===d[15:8] ---- chip_data[7:0]; d[7:0] ---- chip_data[15:8];
===d[31:24] ---- chip_data[7:0]; d[23:16] ---- chip_data[15:8]; d[15:8] ---- chip_data[23:16];d[7:0] ---- chip_data[31:24];

thanks for your help.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…