Computer Organization and Assembly Language

Fall 2008


Generation Information

When an assignment involves coding, you are required to turn in the code and report online. The content of the report should include the problem, your method (i.e., algorithm), the analysis of your method and discussion. The analysis may include advantage, disadvantage, complexity, and limitation.

Note that

  • plagiary is not allowed (a demonstration to TA will be required then).

  • a penalty of 20% is assessed for each day late.

Assignment 1

Please hand in your the Hand written assignment at R302, CSIE buidling.
Due date: 10/20.

Assignment 2


Write a program to generate a random number based on the linear congruential generator (LCG) algorithm. The LCG is defined as: X_n+1 = ( a * X_n + c ) mod m. The seed X_0 is varied from 0 to m-1. Note that your program CANNOT use the operation of multiplication.

Input    :  Seed X_0, n, a and c
              m is set to be 2 to the power of 32 for simplicity and efficiency
              X_0, n (n>=0), a (0<a<m), and c (0<=c<m) are 32-bit unsigned integers
              Some examples of the parameters in common use are listed in:
                  http://en.wikipedia.org/wiki/Linear_congruential_generator
Output  :  X_n+1
Submission: Closed
Due date: 11/24.


Assignment 3

Write a calculator that performs basic arithmetic, including addition (+), subtract (-), multiplication (*), division (/), and exponent (^) of 32-bit signed integers, where the exponent is a non-negative integer. The calculator should be able to deal with complex expressions such as (2^3-4)*10/5. If the result of integer division is a real number a.b, just truncate b (like the definition of '/' for integers in C). For more information about how to use two stacks to do such calculation, please refer to the assignment 2 in our previous class.

Input    :  An arithmetic expression with $ as the end character. Each number is 32-bit signed
              integer. The length of the expression is smaller than 256.
You could assume the format of
              the input is always correct.
Output  :  The signed answer of the expression, or overflow if any in your calculation.
Submission:
Closed
Due date: 12/15.

Assignment 4

Write a simple computer virus in real mode. Three rules should be followed. (1) The virus infects COM files in the current directory. (2) Each COM file can not be infected more than once. (3) Once a COM file is infected, it should be able to infect another COM files. Bonus points will be added for those with other functions like spreading across directories, anti-virus, etc. The TA will explain how to write such a program and the way to grade your program.

Submission: 
click here
Due date: 1/5.