Computer Organisation I

Exercise 6, (7.12-10.12.2004)

  1. Java programs (byte code) can be executed in (at least) four different ways: interpretation, ordinary compilation, Just-In-Time compilation and directly on a Java processor.
    1. Give examples on situation where interpretation would be better than any other way. Give reasoning for your examples.
    2. Give similar examples and reasoning to situations where the other ways to execute Java programs would be the best choise.
    3. What would be the best choise to execute (Java) programming laboratory exercise? Why?

     

  2. Java virtual machine. Assume the following. X, Y and Z are local variables nr 3, 4, and 5. Tbl points to a 20 element array and it (Tbl) is stored into local variable nr 6.
    1. Give machine instructions to increase value of X by 5.
    2. Give machine instructions to assign value Y+Z to X.
    3. Give machine instructions to assign value of Tbl[3] to Y

     

  3. Executing Java programs.
    1. Under what circumstances would a program written in Java be faster than a similar program implemented in C or C++? Why?
    2. Under what circumstances would a program written in Java be slower than a similar program implemented in C or C++? Why?
    3. Assume that you can well both Java and C. You have been given a certain programming task and you can choose the language. Which one you would choose and why?

       

    4. Self-modifying code. What does the program mystery.k91 do? How does it do that? What about program mystery3.k91? How does it do that?

      What benefits one could (hope to) get from this kind of programming style? What problems would there be?

       

    5. [1 hwp] Fill in the Student Feedback form (only in Finnish, sorry). Give extra care in your answers to questions 14 and 19. Bring answers to the following additional questions also to the practice session for discussion.

      In question 14 ("Miten kurssia voisi kehittää? or "How the course could be made better") answer also to the following: 

      1. How many hours have you used for this class altogether up to now?
        For lectures? Practices sessions? Self study?
      2. What proportion of the lectures did you attend to?  (100%, 90%, ...)
      3. Was the timetable of the course fast/adequate/slow?
      4. Did you use the English language books? How much?
      5. Did you use Auvo Häkkinen's material "Tietokoneen toiminta"? How much?

      In question  19 ("Muita kommentteja ..." or "Other comments ...") answer also to the following: 

      1. Did you istall Titokone on your homecomputer? Which version (Windows 98/2000/XP, Linux, Mac)?
      2. Your opinion about Titokone?
      3. What changes should be made to make Titokone better?
      4. What kind of errors have your found from Titokone?
    Päivi Kuuppelomäki