Spring 05_Test3_sol_prob4b

# Spring 05_Test3_sol_prob4b - 0 0 0 0 0 0 2 0 3 1 1 0x12 54...

This preview shows page 1. Sign up to view the full content.

Problem 4 (25 Points): a) Write the microcode to the following steps. 1) M[R3] R2 2) R2+R1 R2 3) R2 M[R3] Step cX cY cZ RWE imm. en. imm val. au en s / a lu. en. l.f. st. en. s.t. store en. load en. w / r mem. sel. 1 2 3 b) You would like to place the value 0x1254AF10 into R1 using the immediate register, but you can only input 16 bits at a time. Write a code that first places 0xAF10 into R2, then 0x1254 into R3. Then use necessary operations to complete the task. Step cX cY cZ RWE imm. en. imm val. au en s / a lu. en. l.f. st. en. s.t. store en. load en. w / r mem. sel. 1 0 2 1 1 0xAF 10 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 0 0 0 0 0 0 2 0 3 1 1 0x12 54 1 0 0 0 0 0 0 3 2 2 1 1 -16 0 0 1 0 0 0 0 4 2 2 1 1 16 0 0 1 0 0 0 0 5 3 3 1 1 -16 0 0 1 0 0 0 0 6 2 3 1 1 0 1 0 0 0 0 0 0 0 7 8 9 1) R2 = R0 addi 0xAF10 2) R3 = R0 addi 0x1254 3) shift R2 left by 16 bits, logical (to clear the ones that would be added in the sign extension) 4) shift R2 right by 16 bits, logical 5) shift r3 left, logical by 16 bits 6) R1 = R2+R3 The unmarked spots are “don’t cares.” Note, when writing this in assembly code, you can replace first step with addiu \$2,\$0,0xAF10. This does not do the sign extension....
View Full Document

## This note was uploaded on 10/26/2011 for the course ECE 2030 taught by Professor Wolf during the Spring '07 term at Georgia Tech.

Ask a homework question - tutors are online