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 CC 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 bit twos complement TC and integers
are bit TC
Recall that to convert an nbit integer k to a mbit integer where mn we need to account for two cases:
If k is negative, concatenate s to the more significant part. For example, becomes where n m
If k is nonnegative, concatenate s to the more significant part. For example, becomes
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 Cish 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
