Forum Discussion
Altera_Forum
Honored Contributor
16 years agoAddressing in hex file
Hello, I currently design a system with SOPC based on the Nios II processor. I checked the hex file generated by the Nios II IDE after compilation. At the beginning I have the following : ...
Altera_Forum
Honored Contributor
16 years agoa byte is a byte and has 8 bit
if you address bytewide then you get access to 8 bit per access only if you want to access a word (16bit) then your address must be aglined to 16bit boundaries so possible adr is 0x0 0x1 0x2 (from 16bit point of view) what is 0x0 0x2 0x4 in bytewide view same in 32bit. the lsb of the 32bit data is the lsb of 8bit data but the msb of your 32bit is the msb of the 4. data byte think of an array and let the contect be {0,1,2,3,4,5,6,7,8,9,....} accessing this memory bytewide you will see at adr[0] 0x0 adr[1] 0x1 adr[2] 0x2 adr[3] 0x3 adr[4] 0x4 but now in 16 bit access mode adr[0] 0x0100 adr[2] 0x0302 adr[4] 0x0504 and in 32 bit adr[0] 0x03020100 adr[4] 0x07060504 if you write down the possible addresses in binary maybe this helps you 8 bit 00000 00001 00010 00011 00100 00101 16 bit 00000 00010 00100 00110 01000 32 bit 00000 00100 01000 01100 10000 showing only the lowest 5 adr bits