Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This assignment examine your basic understanding of CPU performance and MIPS Assembly. To cover these concepts, answer the bellow questions ( Q 1 - Q
This assignment examine your basic understanding of CPU performance and MIPS Assembly. To cover these concepts, answer the bellow questions QQ:
Part CPU Performance and Energy Efficiency Analysis points
Instructions:
Using the formulas provided in the course material in Week answer the following questions. Show all your work and the steps leading to the final answer. After performing the calculations, provide a brief analysis of what the results indicate about the CPU's performance and energy efficiency.
Q CPU Performance Calculation points:
Given a CPU with a clock frequency of GHz and a CPI Cycles Per Instruction of calculate the execution time for a program that has million instructions.
Define the performance of this CPU in terms of instructions per second.
Q Clock Period and Frequency Relationship points:
If the clock frequency of a CPU is doubled from GHz to GHz explain how this affects the clock period. Calculate the new clock period.
Q Energy Efficiency Evaluation points:
Consider a CPU that performs times operations and consumes Watts of power. Calculate the CPU's operations per Watt using the given formula. Discuss what this value suggests about the CPU's energy efficiency.
Q Comparative Analysis points:
Compare two CPUs where:
o CPU A has a clock rate of GHz CPI of and performs times operations using Watts.
o CPU B has a clock rate of GHz CPI of and performs times operations using Watts.
Calculate the CPU time for a program with million instructions and the overall ssjops per Watt for both CPUs. Which CPU is more energyefficient?
PART MIPS Assembly Programming
Objective
This assignment aims to reinforce your understanding of MIPS assembly language and the use of various instructions in creating assembly programs. You are expected to demonstrate your ability to use arithmetic operations, control flow, logical operations, and procedure calls.
Instruction:
Task : C# Program
Study the following C# program bellow also attached to the assignment that performs the following operations:
Defines an array of integers with at least elements.
Calculates the sum of the elements in the array.
Determines the difference between the largest and smallest elements in the array.
Implements a simple function that multiplies two numbers and returns the result.
Task : MIPS Assembly Translation points
Translate the C# program shown in Task into MIPS assembly code. Your MIPS program mainly contains some of the instructions that you studied in your class such as add, sub, lw sw addi, bne, j jal, beq, sll srl slt slti, and jr
Implement a leaf procedure to multiply two numbers.
Implement a nonleaf procedure that calls the leaf procedure and uses its result.
Include comments on each line to explain the MIPS assembly instructions used.
C# Code:
using System;
class Program
static void Main
Task : Define an array of integers with at least elements.
int numbers ;
Task : Calculate the sum of the elements in the array.
int sum CalculateSumnumbers;
Task : Determine the difference between the largest and smallest elements in the array.
int difference FindMaxnumbers FindMinnumbers;
Task : Implement a simple function that multiplies two numbers and returns the result.
int product Multiply;
Output results to the console
Console.WriteLineSum of array elements: sum;
Console.WriteLineDifference between the largest and smallest elements: difference;
Console.WriteLineProduct of and : product;
Calculates the sum of an array of integers
static int CalculateSumint array
int sum ;
for int i ; i array.Length; i
sum arrayi;
return sum;
Finds the maximum value in an array of integers
static int FindMaxint array
int max array;
for int i ; i array.Length; i
if arrayi max
max arrayi;
return max;
Finds the minimum value in an array of integers
static int FindMinint array
int min array;
for int i ; i array.Length; i
if arrayi min
min arrayi;
return min;
Multiplies two integers and returns the result
static int Multiplyint a int b
return a b;
Step 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