Jump to content

hawx

Members
  • Posts

    2
  • Joined

  • Last visited

hawx's Achievements

Lepton

Lepton (1/13)

0

Reputation

  1. Ok so, for 1st questions. On a 16-bit CPU, the 2 byte should be placed on addresses divisible by 2. So I have to separate 0xDEAD into 2 bytes that is: DE AD where DE16 = 22210 & AD16 = 17310 So DE is divisible by 2 but AD is not. If so then, AE16=17410 ; AC16=17210 ; AA16=17010 are all divisible by 2, so which byte is the right one? And What I have understood from "Data structure alignment" theory is that for 16bit CPU the aligned address is 2-byte so there would be log2(2) = 1 least-significant zeros when expressed in binary: DE (1101 1110) & AD (1010 1101) Here the 1st byte has 1 least-significant zero where as the 2nd byte (AD) does not. So the only way a 2nd byte havs 1 least sig. zero is with: AE, AC or AA Same outcome as dividing by 2.... I don't think I have fully understood what a byte and word address is. Are the hex digits the byte addresses? I'm confused...
  2. I'm not sure how to work out the answer for these 2 questions: (1) Consider a byte address 0xDEAD on 16-bit machine. What is the corresponding word address? a) 0xDEAD b ) 0xDEAB c) 0xDEAE d) 0xDEAC e) 0xDEAA (2) Consider a byte address 0xDEAD on a 32-bit machine. What is the corresponding word address? a) 0xDEAC b ) 0xDEAB c) 0xDEAE d) 0xDEAD e) 0xDEAA I understand that 16-bit has 2bytes & 32-bit has 4-bytes. For question (1) would i take DE and AD, if so how do i convert is into word addr.? I don't understand the term "word" clearly.... Please explain this and question Thanks for your help:)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.