Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 64bit twos complement ( TC ),and integers are 32bit 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 1 s to the more significant part. For example, 1011becomes 11111011( where n =4,m =8)
2.If k is non - negative, concatenate 0 s to the more significant part. For example, 0011becomes 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,do this flowgorithm way

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

How can CSR be applied to sport?

Answered: 1 week ago

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago