CMPT 215.3 MIDTERM EXAMINATION
March 4th, 2020
MIPS汇编代写 Ensure that your name AND student number are clearly written on the examination paper and that your name is on every page.
Total Marks: 50 CLOSED BOOK and CLOSED NOTES
no electronic devices
Time: 50 minutes
Read each question carefully and write your answer legibly on the examination paper. No other paperwill be accepted. You may use the backs of pages for rough work but all final answers must be in the spaces provided. The marks for each question are as indicated. Allocate your time accordingly.
Ensure that your name AND student number are clearly written on the examination paper and that your name is on every page.
Note: two pages are attached listing MIPS machine and assembly language instructions.
|1 ( 7 marks)|
|2 ( 6 marks)|
|3 (16 marks)|
|4 (15 marks)|
|5 ( 6 marks)|
1.General (7 marks in total – 1 mark for each part) Give the technical term that best fits each of the following descriptions or definitions. MIPS汇编代写
a)The process of combining multiple, independently developed program units.
b)A type of digital logic circuit without “memory”; the output is a function only of the current input.
c)An assembly language instruction that has no directly corresponding machinelanguage instruction; an example in MIPS assembly language is “li”.
d)A memory element storing a single bit, the value of which is changed only on a clock edge. MIPS汇编代写
e)Adata structure createdduring the assembly process that stores for each label in a program the memory address to which it corresponds.
f)Aprogram chosen to serve as the basis of performance comparison between computer systems.
g)With the IEEE 754 floating point standard, the result of dividing 0 by 0.
2.Computer Performance (6 marks intotal) MIPS汇编代写
a)(2marks) A processor with a clock cycle time of 5 nanoseconds has a CPI of 4 for a particular program. What is the MIPS rating for this program?
b)(2 marks) A program is run on a system with two types of machine languageinstructions: type A instructions each require 3 clock cycles, while type B instructions each require 1 clock If 100 million type A instructions and 400 million type B instructions are executed, what is the CPI for this program?
b)(2 marks) For a particular program as run on a particular system, the CPU execution time is 1 second, the CPI is 4, and 750 million instructions were executed. What is the clock rate as measured inGHz?
3.Arithmetic (16 marks intotal)
a)(6 marks) Perform the followingconversions:
i)-1810 to 6 bit 2’s
ii)ABC16 to base
iii)510 to base2.
b)(4 marks) Give a logic equation in sum-of-products form for the logic function F specified by the following truth table. Simplify your logic equation to the maximum extentpossible. MIPS汇编代写
|A||B||C||F(A, B, C)|
c)(2 marks) Consider the addition of 4 bit values a3a2a1a0and b3b2b1b0. Give a logic function for the “carry-in” to the most significant bit position, using quantities gi = ai bi, pi = ai + bi, and the “carry-in” to the least significant bit position CarryIn0.
d)(2 marks) Give a truth table for a 2 data input, 1 selector input multiplexor.
e)(2 marks) The IEEE 754 floating point standard allows some numbers to be represented in unnormalized form (called denormalized numbers, or “denorms”).Why?
4.Machine and Assembly Language (15 marks intotal) MIPS汇编代写
a)(2 marks) In MIPS machine language, the R format instructions need an additional field (the “funct” field) to specify the instruction type (“add”, “sub”, etc.). Why can’t this be doneusing just the 6-bit “op” field, which all MIPS instructions have, instead?
b)(3marks) Give a sequence of MIPS assembly language instructions that adds the contents of$s0 and $s1, storing the result into $s0, if the contents of $s1 are greater than 6. Otherwise, the contents of $s0 should be incremented by 28. In either case, afterwards the contents of $s0 should be copied into $s2.
c)(2 marks) Suppose that the starting address of an array of words is stored in $s0. Give a MIPS assembly language instruction that loads the contents of the second word in the array into$s1. MIPS汇编代写
d)(4 marks) Suppose that A and B are defined using “A: .word 0”, and “B: .space 100”. Give a sequence of MIPS assembly language instructions that calls a procedure “P” with its two arguments being the contents of A and the address of B, using the standard procedure call conventions, and then stores the return value from “P” into A. (You do not need to show any code for the procedure“P”.)
e)(4 marks) What is an object file, and what does itcontain?
5.Datapath and Control (6 marks intotal)
a)(4 marks) In the single clock cycle datapath discussed in class, there are two adders, separate from the ALU. What is each adder used for, and why can’t these functions be performed using theALU?
b)(2marks) Give two instruction types for which the “write control signal” for the register file inthe single clock cycle datapath discussed in class would need to be 0, so that writes to registers are disabled.