in English suomeksi Exercises

Computer Organization I, HW 2

  1. Memory reference modes. Assume that for each instruction below the starting point is the state given in this slide. For each instruction, please give the effective memory address and either the modified register contents or the address and the contents of the modified memory location. If some instructions are not legal, give explanation for it.
    1. LOAD R4, 200
    2. LOAD R3, One(R1)
    3. LOAD R3, =One(R1)
    4. STORE R0, One(R1)
    5. STORE R2, @9(R3)
    6. LOAD R0, @R1
    7. LOAD R1, @(R1)
    8. STORE R1, @(R1)
    9. STORE R0, R1
    10. LOAD R1, =X(R0)
    11. STORE R2, =One

  2.  
  3. Ttk-91 computer and its simulator
    1. What data types can be processed in ttk-91 computer at machine instruction level? Are there data types, that can be processed at machine instruction level with some modern computers, but not with ttk-91?
    2. What different methods are there to reference data in memory with ttk-91 computer at machine instruction level?
    3. Can one machine instruction modify both the contents of a register and memory? How or why not?
    4. How large number will fit into the constant part of the ttk-91 instruction? What can be done, if a bigger number is needed?
    5. Assume that there were 256 registers in ttk-91 instead of just 8. What effect would this have for the machine instruction structure?
    6. Assume that we add 46 new machine instructions to process various length integers and floating point values, truth values, characters and character strings. What effect would this have for the machine instruction structure?

  4.  
  5. Arrays and records
    1. Most programming languages implement 2-dimensional arrays row-wise. Why would one do it this way? Will one save memory? Is the solution faster than storing data column-wise? Why?
    2. Assume that you have 1-dimensional array Person, whose elements are 5-field records {id, height, weight, grade, level}. Give ttk-91 instructions to implement assignment "X = Person[i].grade".
    3. Give ttk-91 instructions to implement assignment "X = T3D[i][j][k]", where T3D is 3-dimensional array stored row-wise.

  6.  
  7. [2 hwp] Titokone and TitoTrainer
    1. Learn to use Titokone and TitoTrainer.
    2. Do level A TitoTrainer problems a-050, a-100, a-110 and a-150. You may want to run the programs (defined in TitoTrainer) first in Titokone and only then in TitoTrainer. This way you receive better error messages and have better software development environment. You may use your own study circle for consult, but try to solve problems independently.
    3. If you want, you may do all other level A TitoTrainer problems for project 1.