Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Having trouble with this might have missed the class could anyone help? a) Write an assembly language (Table attached) program for the MIPs to perform
Having trouble with this might have missed the class could anyone help?
a) Write an assembly language (Table attached) program for the MIPs to perform the following: Output a countdown starting from an input integer and terminating with an output of zero (e.g., for an input of 3, the output will be: 3 2 1 0) Place a pseudo code version of each instruction to the right of each assembly language instruction. Assume the MIPS maps input to RAM address 0 and output to RAM address 4. b) Give the machine language for the MIPS assembly language instruction shown below. Show the field values in base 10. (A MIPs machine language table is attached.) srl $s4, $s1, 22 c) In one sentence explain why are some address modes are faster than others? d) Give the address modes of the MIPS instructions whose mnemonics are: 1) add 2) addi 3) lw Notation: R stands for Register N is and integer, written in base 10 notation I is and integer, written in base 10 notation Subscripts: D, S, O1 and O2 are register numbers, either 0, 1, 2, or 3 Examples: lw R_2, 31//load reg. 2 with contents of memory (RAM) byte 31 add R_3, R_1, R_2//add contents of R_1 and R_2 place the result in R_3 beq R_1, 16//jump to instruction at byte 16 if contents of R_1 = = R_0 beq R_1, 0//jump to instruction at byte 0 if contents of R_1 = = R_0 src R_3, R_1, R_2//Shift R_3 right circular R_2 bits Examples: lw R_2, 31//R2 leftarrow 31 add R_3, R_1, R_2//R3 leftarrow R1 + R2 beq R_1, 16//if (R1 = = R0) PC leftarrow 16 beq R_1, 0//if (R_1 = = R0) PC leftarrow 0 src R_3, R_1, R_2//R3 leftarrow R3 right circular shifted R2 bitsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started