HOMEWORK #1 CSE 410 Fall 98  

Due: Friday October 9, in class


Homework Policy: Late homeworks will not be accepted.

1. Select some artifice other than a computer system or telephone, such as an airplane, bridge, household appliance, medical instrument, elevator, . . . , and briefly present its architecture using a hierarchy of at least three architectural levels or layers. Use no more than 1/2 page including figures.

2a.Take the following machine language code and rewrite it in assembly language. Assume that the the instructions are stored in sequential locations, starting at address 200.
                1 2 1 2
                3 2 1 3
                2 2 1 2
                5 2 1 2
                4 2 1 1
                8 2 0 7
                7 2 0 0
                1 2 1 2
                4 2 1 3
                2 2 1 2         
                0 7 9 0
                0 0 5 8
                0 0 0 1
                0 0 0 1
b. What does the program do?

3. Write assembly language code to compute the nth Fibonacci number, Fib(n), where Fib(1)=1, Fib(2)=2, and Fib(n)= Fib(n-1)+Fib(n-2) for n>2. Your code should work for any positive integer value of n. Assume that the value of n is stored initially in a location named "n". After computing Fib(n), your code should halt with Fib(n) stored in a location named "Fib".

4. Counting with your Fingers and Toes
a. How high can you count using both hands? Assume that each finger (including thumb) is a binary bit, with finger extended indicating a 1 and finger touching palm meaning a 0.
b. Repeat part a but using both hands and both feet.
c. Using both hands and both feet, consider a representation of numbers in two's complement, with the big toe on the left foot as the sign bit. What is the range of expressible numbers?

5. In the following operations, the numbers are represented in 8-bit two's complement. Perform the indicated computations.
        i) 00101101 + 01101111          ii) 11111111 + 11111111
        iii) 00000000 - 11111111        iv) 11110111 - 11110111