a. What is CPT? What does it mean if we have high CPT? b. Given two machines A a
ID: 3810506 • Letter: A
Question
a. What is CPT? What does it mean if we have high CPT? b. Given two machines A and B. They have performance of 35 MIPS (millions instructions per second) and 15 MIPS for certain benchmarks, respectively. Can you consider that machine A is faster than B? why?. c. What is an Instruction Set Architecture (ISA)? What is ISA about? d. What are procedure call calling convention? Give an example of a MIPs calling convention, and explain why it is useful. e Instead of using a special hardware multiplier, it is possible to multiply using shift and add instructions. Suppose we want to put 18 times the value of $a0 into $v1, ignoring any overflow that may occur. Show a minimal sequence of MIPS instructions for doing this without using a multiply instruction.Explanation / Answer
The CPU (Core Processing Unit) is the brain of your computer. CPU usage refers to your computer's processor and how much work it's doing.
A high reading means your computer is running at the maximum level or above normal level for the number of applications running.
Slow performance, freezing and shutdowns are all symptoms of high CPU use.
High CPU Usage May Be Caused
Running too many applications at once
Many CPU issues are because of an overload of processes running, and too little resources to handle all of them.
You need to find which processes are clogging up your computer's performance and remedy them.
You can download a program such as FixCleaner which can help you find out the programs which are giving you a high CPU use reading.
c)
The Instruction Set Architecture (ISA) is the part of the processor that is visible to the programmer or compiler writer. The ISA serves as the boundary between software and hardware. We will briefly describe the instruction sets found in many of the microprocessors used today. The ISA of a processor can be described using 5 catagories:
Operand Storage in the CPU
Where are the operands kept other than in memory?
Number of explicit named operands
How many operands are named in a typical instruction.
Operand location
Can any ALU instruction operand be located in memory? Or must all operands be kept internaly in the CPU?
Operations
What operations are provided in the ISA.
Type and size of operands
What is the type and size of each operand and how is it specified?
d)
Passing Named Arguments. A statement in a Sub or Function procedure can pass values to called procedures using named arguments. You can list named arguments in any order. A named argument consists of the name of the argument followed by a colon and an equal sign (:=), and the value assigned to the argument.
Rules of MIPS calling function:
Rule 1: The first instruction in the function manipulates $sp to allocate F words of stack.
addi $sp, $sp, -F*4 where F = A + L + P + (1 for $ra if needed) + (1 for $fp if in use) + (2 for $gp) + padding. F is the frame size in words, and should be even.
Corollary 1: $sp is not changed at any other point than the first and last instructions in the function.
Rule 2: If you want to use any preserved register in any place during the function, you must store them into the stack when you enter the function (not when you use it). Let’s assume we are saving s0, s1, and s2 registers, as well as $ra and $sp. Then we would write:
sw $ra, (F-1)*4 ($sp) (not needed for leaf functions)
sw $fp, (F-2)*4 ($sp)
sw $s2, (F-3)*4($sp)
sw $s1, (F-4)*4($sp)
sw $s0, (F-5)*4 ($sp)
Rule 3. After saving preserved registers, copy $sp into $fp, so that from now until you start returning, you can use offsets from $fp to access the stack locations. Save and restore local variables as needed after this point, using $fp and the spots already allocated for them on the stack.
Rule 4: You may pass information into a function through only $a0-$a3 and extra stack arguments. As the called function, you may not use the value held in any other register except $sp, $fp, $gp and $ra(i.e. don’t try to use $v0, $s0). The #4 (fifth) argument to the current function is available at (F+4)*4($fp), the #5 at (F+5)*4($fp), etc. You may store argument 0 from $a0 into its reserved spot at F*4($fp), arg1 into (F+1)*4($fp), etc., if you want.
Rule 5: You may pass information out of a function through only $v0-$v1, not $a0-$a3.
Rule 6: You may only enter a function at its beginning. You may not jal into the middle of a function.
Rule 7: You may have only one jr $ra in each function. It is the last instruction in the function, following the instructions that restore the registers saved as in Rule 2.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.