For the programming questions, you may use either the machine language of Brookshear's Appendix C, or the richer assembly language of Rege Colwell's note. A copy of the note will be stapled to the exam.
1. Show how to build a 2-input OR gate using NOT gates and 2-input AND gates. That is, produce a circuit made of ANDs and NOTs, whose behavior is exactly the same as a 2-input OR gate.
2. Using AND, OR, and NOT gates, design a circuit with inputs W, X and Y, and output Z, whose behavior corresponds to this truth table:
W X Y | Z ------------- 0 0 0 | 0 0 0 1 | 0 0 1 0 | 0 0 1 1 | 0 1 0 0 | 0 1 0 1 | 1 1 1 0 | 1 1 1 1 | 1The AND and OR gates can have any number of inputs.
3. Suppose you are given the following two 8-bit binary numbers, represented in 2's-complement notation: 00100101 and 11111001. Show the 8-bit binary addition of the two numbers, and then convert each, and the answer, to decimal notation.
4. Write a Brookshear/Colwell assembly language or machine language program that begins at location 00 and that will jump to location 50 (hex) if the byte in location FF (hex!) is the ASCII code for the letter ``F'' (01000110 binary or 46 hex), and that will jump to location 60 (hex) otherwise. You do not have to write any instructions at locations 50 or 60.
5. Some Brookshear/Colwell instructions are equivalent to one or more other instructions. What instruction could substitute for the following MOV?
MOV R2, R3 ;copy value of R2 into R3What instruction or instructions could substitute for the following JEZ?
JEZ R7, AB ;jump to AB if the contents of R7 equal 00
6. An operating system has some number of processes to run. It can either run them in batch mode--each is run to completion before starting the next--or in timesharing (or multitasking) mode--each process runs for a short ``time slice'' and then the system switches to another process. What are the advantages of the second approach?
END OF EXAM