In: Computer Science
6. Assume a computer has a physical memory organized into 64-bit words. Using hexadecimal notation, give the word address and offset within the word for each of the following byte addresses.
Byte address |
Word address |
Offset |
0x000b |
||
0x03ff |
||
0x07fc |
Ans:
Given that the physical memory is organised into 64-bit words i.e. 8 bytes each.
=> Each word consists of 8 bytes.
therefore, memory will be addressed as starting from 0x0000
Since each word is of 8 byte therefore next address would be 0x0008 and then 0x0010 and next would be 0x0018 and so on.
=> In order to detemine the next word address we need to divide the byte address with 8 and use the quotient (q) as:
Word address = 0x0000 + (q*8)16
Byte address = Word address + offset
and offset will be the remainder (r) which means that in that particular word the given Byte address refers to the (r+1)th byte.
1) 0x000b = (11)10
=> 11/8 = 1 and remainder (r) = 3
quotient (q) = 1 means 2nd word in the memory.
=> Word address = 0x0008
& offset = 3 (=> address belongs to the 4th byte in this word)
2) 0x03ff = (1023)10
=> 1023/8 = 127 and remainder (r) = 7
q = 127 means 128th word in the memory.
=> Word address = 0x0000 + (127*8)16 = 0x03f8
& offset = 7 (=> address belongs to 8th byte in this word)
3) 0x07fc = (2044)10
=> 2044/8 = 2040 and r = 4
q = 2040 means 2041th word in the memory
=> Word address = 0x0000 + (2040*8)16 = 0x07f8
& offset = 4 (=>address belongs to 5th byte in this word)