====== CSE2021 Midterm ====== **General Information** * The midterm will be held on Jul 16 at SLH-E from 7-9pm. * This is a closed-book, 2-hour test. * No aids allowed. No calculators allowed. Blank sheets of paper are not allowed. * The MIPS green card and system call sheets will be provided. ---- **Scope of the Midterm** The scope of the midterm includes all materials covered in the lectures and the labs, up to and including LabD. In particular, you should revise the following important topics: * Convert numbers (integer and real values) to/from binary, hex and decimal. * Translate high-level programs (e.g., Java) to assembly programs. * Convert assembly instructions to machine language and back. * Understand the fetch-execute cycle concept, performance issues such latencies, CPI, clock rates, bus rates, etc. * Understand MIPS design issues such as why is there no ''subi'' instruction in MIPS?; why is there no shift-left-arithmetic instruction?. * Understand memory usage issues such as why don't we store attributes of objects in ''.data''. * Given a MIPS program, you should be able to figure out the output(s) and values of all the registers used in the program (assuming a 32-bit machine and all integers are signed). * You should be able to write a sequence of MIPS instructions or a complete MIPS program in order to accomplish a required task. (You are not allowed to use pseudo instructions). * You should know all the MIPS instructions presented in the {{mipsgreencard.pdf|MIPS Green Card}}, what they do and how to use them. * You should also prepare yourselves by reading chapters 1, 2, and 3 in the textbook. ---- **Sample Midterm and Answers** You can try this [[http://www.cse.yorku.ca/~lan/2021/midterm/sample.pdf|sample midterm]], compare your answers with its [[http://www.cse.yorku.ca/~lan/2021/midterm/ans.txt|solutions]] and discuss your questions/answers with other students in the [[http://forum.cse.yorku.ca/viewforum.php?f=76|Discussion Group]]. ---- **Midterm Solutions** [[http://www.cse.yorku.ca/~lan/2021/midterm/sol.pdf|Midterm Solutions]]