Instructor's Manual: Computer Organization: Basic Processor Structure James Gil de Lamadrid NOTE: (For Complete File, Download link at the end of this File) 1 / 4
Instructor's Manual: Computer Organization: Basic Processor Structure Introduction
This is an accompanying manuscript to the bookComputer Organization: Basic
Processor Structure. The book is designed to be used to present the curriculum to a one semester course, that combines topics in computer organization, and computer architecture, at the undergraduate level, or as a remedial graduate course. We teach this type of course as a graduate program requirement, in a graduate program that is geared toward students that come into the program with undergraduate degrees in other elds.The material presented in the book is reinforced by exercises. The answers to these exercises can be classied as follows.Digital circuitry.Machine code.Written work.Digital circuitry can be constructed on paper, as a simulation, on a programmable device, or on a breadboard, using small-scale integrated circuitry. We have used all three of theses techniques, in our courses. Machine code can be written for the BRIM machine, and run on the BRIM simulator, which, like this manuscript, also accompanies the book.We do not view the book, nor this instructor's manual as a script. we expect the instructor to add, and modify material, to suit their teaching emphasis, and style. Although we supply answers to all exercises, this not meant to supply the instructor with "canned" exercises, and solutions. It is expected that the instructor would want to modify exercises, and introduce new exercises, which would require the instructor to work out solutions. In this sense, we view the material in this manual as more of guidelines for how exercises might be developed.Chapter 1 Exercise 1.1 Draw the AST for the following C++ statements.(a)m = (a + y) * (x - 3); (b)n = a * b * 5; (c)p = y = v / 4;
1 2 / 4
Instructor's Manual: Computer Organization: Basic Processor Structure Solution (a)m = (a + y) * (x - 3);= m * + - a y x 3 (b)n = a * b * 5;= n* *5 a b (c)p = y = v / 4;= p= y/ v 4
2 3 / 4
Instructor's Manual: Computer Organization: Basic Processor Structure Exercise1.2 Compile the C++ statements from Exercise 1.1 into assembly code. Use the op-codesdiv, andsubfor division, and subtraction, respectively.Solution (a)m = (a + y) * (x - 3); load R0, a load R1, y add R0, R0, R1 load R1, x sub R1, R1, #3 mult R0, R0, R1 store m, R0 (b)n = a * b * 5; load R0, a load R1, b mult R0, R0, R1 mult R0, R0, #5 store n, R0 (c)p = y = v / 4; load R0, v div R0, R0, #4 store y, R0 store p, R0 Exercise 1.3 Assemble the following assembly code into machine code. Assume that the machine language op-codes forload,store,mult,add,div, andsubare 18, 19, 13, 14, 15, and 16, respectively. Also assume that the variablexis stored at location M[50].(a)load R1, x mult R2, R1, #9 store x, R2 (b)sub R0, R1, #8 div R2, R0, #2
- / 4