in English suomeksi Exercises

Computer Organization I, HW 3

  1. Integers. Assume, that desimal number -13 is stored in memory in byte address 0x1230. What are the contents of bytes 0x1230-0x1233, when that number is stored in the following representation:
    1. 32 bit Big-Endian sign and magnitude
    2. 32 bit Big-Endian two's complement
    3. 16 bit Big-Endian two's complement
    4. 8 bit Big-Endian two's complement
    5. 32 bit Big-Endian one's complement
    6. 16 bit Big-Endian biased by 32767
    7. 32 bit Little-Endian two's complement
    8. 16 bit Little-Endian two's complement
    9. 8 bit Little-Endian two's complement

  2.  
  3. Floating point numbers
    1. Give an example of a real number that can be exactly represented as floating point number.
    2. Give an example of a real number that can not be exactly represented as floating point number. How big is the error?
    3. What is IEEE floating point representation of desimal number 4.25? Is it exact or not?
    4. What is binary number 101010.1010 in decimal?
    5. What is IEEE floating point representation of desimal number 5.1? Is it exact or not?
    6. Compute the values for expressions "(1.0666668-1.0666666) * 1.23456" and "1.0666668*1.23456 - 1.0666666*1.23456" using some programming language supporting 32-bit IEEE floating points. Insert some output statement in the first expression before the multiplication, (see, e.g.. test.c), so that the compiler would not optimize the code too much. Why are the results different? Which one is correct? Why would using 64-bit IEEE floating point numbers (C:n or Java data type double) remove this discrepancy?

     
  4. Assume that programming language MyLan has boolean and floating point data types. For example, one can use boolean or float variables in MyLan programs.
    1. Ttk-91 does not have such data types. Could one make a MyLan compiler for ttk1, so that one could run MyLan programs in ttk-91? If the answer is "yes", how would one implement boolean operation AND and floating point addition? If the answer is "no", why not?
    2. How should one expand ttk-91 architecture (hardware) definition so that ttk-91 could execute floating point operations in hardware? Specify precisely all such modifications.

  5.  
  6. Memory references and interrupts
    1. How many memory references is needed to run machine instruction "STORE R1, @5(R2)"? What are they?
    2. How many memory references is needed to run machine instruction "ADD R4, R5"? What are they?
    3. How are interrupts implemented in the processor? What happens after the interrrupt is processed?
    4. Assume that certain application requires its own interrupt handler to be invoked with certain interrrupts. How would one implement this in practice at machine instruction level, i.e., how does one select just that interrupt handler with certain interrupts when this application is running?
    5. Give an example on a situation where it would be good the disable interrupt handling? How is this done at processor level? What happens if interrupts are disabled very long time?
    6. Some processors have an option to define whether floating point overflows cause an interrupt or not. What use would such an option be for and how could one utilize it?

  7.  
  8. Do level B TitoTrainer problems b-120, b-150, b-350 and b-370.

Teemu Kerola