Docsity

Homework 1 Solutions | Operating Systems | COP 4600, Assignments of Operating Systems

Toggle sidebar
bg1
1. (30 points)
Using the hypothetical machine from the lecture notes (Hardware Considerations
pages 12-17). Assume that we have the following instruction set:
Binary Opcode Instruction Semantics
0001 Load AC from memory address
0010 Store AC to memory address
0011 Load AC from I/O device
0100 Right shift AC 1 bit
0101 Add to AC from memory address
0110 Multiply to AC from memory address
0111 Store AC to I/O device
For instructions that access I/O devices, they I/O device is treated similar to memory in
that the 12-bit address identifies a particular external device. Using a technique similar
to that used in the notes, show the step-by-step execution of the following program.
All addresses are given in hexadecimal. Assume the following:
1. The program is loaded starting at address 300.
2. The next value retrieved from device 5 is 3.
3. Memory location 840 contains the value E.
4. Memory location 841 contains the value B.
The program in hexadecimal:
3005
5840
7006
1841
4000
5840
2842
1
COP 4600 – Introduction To Operating Systems – Summer 2009
Homework #1 – 130 points
Due: In class Tuesday June 9th. NO LATE ASSIGNMENTS ACCEPTED
Answer each of the following questions completely. Make sure that your answers are
neatly written and very readable. Points will be deducted if your assignment is not
presented in a neat format. For example, don’t turn it in on notebook paper torn out of
a spiral notebook.
pf3

Partial preview of the text

Download Homework 1 Solutions | Operating Systems | COP 4600 and more Assignments Operating Systems in PDF only on Docsity!

  1. (30 points) Using the hypothetical machine from the lecture notes (Hardware Considerations pages 12-17). Assume that we have the following instruction set: Binary Opcode Instruction Semantics 0001 Load AC from memory address 0010 Store AC to memory address 0011 Load AC from I/O device 0100 Right shift AC 1 bit 0101 Add to AC from memory address 0110 Multiply to AC from memory address 0111 Store AC to I/O device For instructions that access I/O devices, they I/O device is treated similar to memory in that the 12-bit address identifies a particular external device. Using a technique similar to that used in the notes, show the step-by-step execution of the following program. All addresses are given in hexadecimal. Assume the following: 1. The program is loaded starting at address 300. 2. The next value retrieved from device 5 is 3. 3. Memory location 840 contains the value E. 4. Memory location 841 contains the value B. The program in hexadecimal: 3005 5840 7006 1841 4000 5840 2842

COP 4600 – Introduction To Operating Systems – Summer 2009

Homework #1 – 130 points

Due: In class Tuesday June 9th. NO LATE ASSIGNMENTS ACCEPTED Answer each of the following questions completely. Make sure that your answers are neatly written and very readable. Points will be deducted if your assignment is not presented in a neat format. For example, don’t turn it in on notebook paper torn out of a spiral notebook.

SOLUTION

Note: repeatedly copy these three tables and fill in the values as each instruction is executed by the machine. Note that the program values will not change so you can fill that in first and either copy each time or just leave the program part blank for subsequent steps. memory CPU registers ADDRESS (in hex)

VALUE

(in hex) (^) REGISTER

VALUE

(in hex) PC AC IR ADDRESS (in hex)

VALUE

(in hex) 5 6 Device values