in English suomeksi Exercises

Computer Organization I, Autumn 2005, HT 2

To be presented in week 46 (14.-18.11.2005).
  1. [2 htp] Using the ttk-91 symbolic assembly languge, write a program, that does the same as the C program
            int x=7, y=3, z=170;  /* variables x, y, z */
            main () {             /* main program */
                y = 4;
                x = 528 - y * z;
                if (x < 40) {
                    y = x - 34;
                    }
                else {
                    y = x / y + 4;
                    z = 23;
                    }
                printf ( "%d %d %d \n", x, y, z)  /* print x, y, z */
            }
        

    Check your program by compiling and executing it with Titokone.

  2. [2 htp] Using the ttk-91 symbolic assembly languge, write a program, that

    1. Allocates space for a 8-entry array Tbl[8]
    2. At execution time initializes array Tbl so that Tbl[i] = 2*i;
    3. Reads a value for variable k from the keyboard
    4. Prints the value of array element Tbl[k]
    5. Computes the sum of values in array Tbl
    6. Prints this sum

    Check your program by compiling and executing it with Titokone.

  3. [2 htp] Design and implement one working practice practice problem. The question in your practice problem is "Why do I study Comp Org I?". Come up with at least 4 different answers with their explanations.

    The goal of this problem is to learn on how to implement practice problems, and so the answers and their explanations are not so important. This gives room for creative humor.
 

Teemu Kerola