Question: For this homework, you will explore different types of integers. As you know the C / C + + standard leaves issues such as the

For this homework, you will explore different types of integers. As you know the C/C++ standard leaves issues such as the number of bits and numeric format up to the compiler (unlike some other languages). For purposes of this homework, we will assume that long integers are 64 bit twos complement (TC), and integers
are 32 bit TC.
Recall that to convert an- n-bit integer k to a m-bit integer where m>n we need to account for two cases:
1. If k is negative, concatenate 1s to the more significant part. For example, 1011 becomes 11111011(where n=4, m=8)
2. If k is non-negative, concatenate 0s to the more significant part. For example, 0011 becomes 00000011.
This is called sign extension.
Write MIPS code to convert an array A of integers to an array B of long integers. Both arrays have size n.
You may treat A, B, and n as HLL variables.
As usual, you are required to both draw a CFG and may only use certain instructions
(excluding functions). Note that we have not covered any instructions dealing with doublewords.
You may choose to first write this in C-ish pseudocode though it is not required. But a CFG is required.
The instructions you can use are addi, addi, jal, lw, sw, slti, bne, j, jr, Ret, RetOne. Only use these, dont use other ones.
PLEASE DO ALL WELL, FOLLOW ALL DIRECTIONS,
DO FULL MIPS CODE WITH ALL COMMENTS PER CODE, PROPER MIPS, SHOW WHAT YOU ARE DOING BASED ON INSTRUCTIONS SAID.
DO A PROPER CFG TOO!! CFG IS A FLOW CHART, MAKE A FLOW CHART BEFORE THE MIPS. all directions are clearly stated above.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!