Machine Organization I
V22.0201 - Spring 2009

Assignment 1

Due: Friday, Feb . 13th

Create a program which inputs a number N and then computes the Nth term of the Fibonacci series. In this case, the series starts with 0 and 1 and, of course, each subsequent term is the sum of the preceding two. Thus,

Term 1 = 0 (by definition)
Term 2 = 1 (by definition)
Term 3 = 0 + 1 = 1
Term 4 = 1 + 1 = 2
Term 5 = 1 + 2 = 3

Note that since both input and output are BYTE quantities, there could be an error. Do NOT compute the largest fibonacci possible ahead of time. If a carry past 255 happens during your calculations, that is the time to signal that an error has occurred.

Input (N)

Output (Fib(N))

Error Code




The error code is = 0F if the Fibonacci term was calculated correctly, and is = F0 if an error occurred.

You should submit your finished code to your grader at:

s90201 [at] cs [dot] nyu [dot] edu