MIPS Computer Architecture Question Requirments to Answer: Solid Foundation of M
ID: 3586418 • Letter: M
Question
MIPS Computer Architecture Question
Requirments to Answer: Solid Foundation of MIPS Programming / Hexidecimal formatting / Byte Ordering
Asking: Good Explanation and Solution
1. (3 pts) Assume that the instruction j NEXT is at address ox0ODAEO5C, and the label NEXT is at address OxOODAFA28. Then, the 26-bit immediate stored in the jump instruction for the labe NEXT is 2. (3 pts) Assume that the instruction beq $to, $tl, NEXT is at address 0x04DAE05C, and the label NEXT sat address 0x04DAFA28·Then, the 16-bit immediate stored in th branch instruction is 3. Consider the following data definitions data varl: .byte Z, 1, 2. 5. B var2: .half -5. xDfC var3: word 0x12345678, Oxff align 3 stri: .asciiz "My Stringin a) Show the content of each byte of the allocated memory, in hexadecimal for the above data definitions. The Little Endian byte ordering is used to order the bytes within words and half words. The ASCIl code of character A is 0x41, and 'o is 0x30. Indicate which bytes are skipped or unused in the data segment. Data Segment Symbol Table Address ByteByte Byte Byte 0x10010000 0x10010004 0x10010008 0x1001000C 0x10010010 0x10010014 0x10010018 0x10010010 0x10010020 0x10010024 0x10010028 0x10010020 Label Address b) Construct a symbol table showing the symbols and their corresponding addresses in hexadecimal. c) How many bytes are allocated in the data segment including the skipped bytes?Explanation / Answer
1. The Mips instruction given is j next. The ‘next’ is lablled to address location 0x00DAFA28. So the instruction will be executed as j 0x00DAFA28
j 0x00DAFA28. The machine code for the instruction is
in Binary: 00001000110110101111101000101000
in Hex: 0x08DAFA28
So the 26 bit immediate field is 00 1101 1010 1111 1010 0010 1000
2. The Given MIPS instruction is beq $t0,$t1, next. The next is lablled to address location 0x04DAFA28. So the execution will be beq $t0 $t1 0x04DAFA28
The Machine code for the instruction is
In Binary: 00010001000010011111101000101000
In Hex: 0x1109FA28
The 16 bit immediate filed consists of 1111 1010 0010 1000 Which is the last 16 bit of the offset address.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.