University of Helsinki Department of Computer Science
 

Department of Computer Science

Department information

 

Computer Organization II, Spring 2010, Exercise 4

These homework exercises will be covered in practice session on Wednesday 10.2.2010.

This fourth week's homework covers computer arithmetics and instruction sets (Sections 9, 10, and 11).

SPECIAL TASK:

Submission on paper (1-2 pages) on Wednesday 10.2.2010 during the exercise meeting.

Remember to put your name and exercise group information on the submitted papers.

  1. Learning diary

    Continue maintaining the learning diary through out the course.

    This weeks submission should cover the issue in your diary after the previous submission.

    You could reflect the course content with your earlier knowledge, point out the interesting and not so interesting areas.

    Try to estimate the number of hours used for the course during this period and also mentions what the hours were used for.

  2. Article

    L. Peng et.al.: Memory hierarchy performance measurement of commercial dual-core desktop processors. Journal of Systems Architecture 54(2008) 816-828. (publisher Elsevier)

    The article is based on measuring performance differences of three commercial processors.

    Please write (In Finnish or in English) a short (approximately 1 page) review of the paper. Please focus in your review in such questions as

    1. Which of the processor was best and why?
    2. Name also at least one situation where one of the others was better and explain why.
    3. At the end explain based on this article what kind of architecture features would you recommend for a boss, friend or small company and why. Please do not just pick one of the processors, but try to list more general features.
    Please notice that you need not read and memorize the article. You just need to be able to make your own opinion about the content. You may be critical about the content.

HOMEWORK:

  1. Booth's algorithm
    1. Problem 9.14: Given x=0111 and y=1011 in twos complement notation (i.e., x=7, y=-5), compute the product using Booth's algorithm.
    2. Is is possible that Booth's algorithm would be clearly slower than normal (=unsigned binary integer) multiplication algorithm for twos complement integers? If it is, please give an example. If it is not, please give a detailed reasoning.
    3. Why does the Booth's algorithm NOT need the C bit as used in the multiplication of unsigned binary integers?

  2. Floating-point
    1. Problem 9.36: One of the most serious erros in computer calculations occurs when two nearly equal numbers are subtracted. Consider A=0.11177 and B=0.11122. The computer truncates all values to four decimal digits. Thus A'=0.1117 and B'=0.1112.
      1. What are the relative errors for A' and B'?
      2. What is the relative error for C'=A'-B'?
    2. Problem 9.37: To get some feel for the effects of denormalization and gradual underflow, consider a decimal system that provides 6 decoimal digits for the significand and for which the smallest normalized number is 10-99. A normalized number has one nonzero decimal digit to the left of the decimal point. Perform the following calculations and denormalize the results. Comment on the results.
      1. (2.50000 x 10-60) x (3.50000 x 10-43)
      2. (2.50000 x 10-60) x (3.50000 x 10-60)
      3. (5.67834 x 10-97) - (5.67812 x 10-97)

  3. Machine instructions
    1. Problem 10.6: Compare zero-, one-, two- and three-address machines by writing programs to compute X=(A+BxC)/(D-ExF) for each of the four machines. The instructions available for use are as follows:
      0 address 1 address 2 address 3 address
      PUSH M
      POP M
      ADD
      SUB
      MUL
      DIV
      LOAD M
      STORE M
      ADD M
      SUB M
      MUL M
      DIV M
      MOVE (X < - Y)
      ADD ( X < - X + Y)
      SUB ( X < - X - Y)
      MUL ( X < - X x Y)
      DIV ( X < - X /Y)
      MOVE (X < - Y)
      ADD ( X < - Y + Z)
      SUB ( X < - Y - Z)
      MUL ( X < - Y x Z)
      DIV ( X < - Y /Z)

      NOTE: You may assume that variables A, B, C, D, E, F, and X are in memory.

    2. Problem 11.18: Consider the results of Problem 10.6. Assume that M is a 16-bit memory address and that X,Y, and Z are either 16-bit addresses or 4-bit register numbers. The one-address machine uses accumulator, and the two- and three-address machines have 16 registers and instructions operating on all combinations of memory locations and registers. Assuming 8-bit opcodes and instruction lengths that are multiple of 4 bits, how many bits does each machine need to compute X?
      NOTE: calculate the size of the 'program' in bits.

  4. Memory addressing
    1. Problem 11.7: How many times does the processor need to refer to memory when it fetches and executes an indirect-address-mode instruction if the instruction is (a) a computation requiring a single operand; (b) a branch?

      Give also an example instructions for parts (a) and (b).

    2. Problem 11.8: The IBM 370 does not provide indirect addressing. Assume that the address of an operand is in main memory. How would you access the operand?

  5. Problem 10.17: Appendix 10A points out that there are no stack-oriented instructions in an instruction set if the stack is to be used only by the processor for such purposes as procedure handling. How can the processor use stack for any purpose without stack-oriented instructions?

Tiina.Niklander@cs.helsinki.fi