Computer Organization and Assembly Language

Fall 2007


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 like advantage, disadvantage, complexity, and limitation, and discussion.

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/27.

Assignment 2


Write a program to check if a positive number is a prime. The given number is a 32-bit unsigned integer varied from 1 to 4294967295 (2^32-1).

Input       : k
Output     : 1 (if k is a prime) or 0 (if k is not a prime)
Due date  : 11/25
Submission: Closed
Grading    : Bonus points will be added for those with good algorithms and/or performance analysis.

Assignment 3

Write a program to perform addition, subtraction and division on 48-bit unsigned hexadecimal integers. If the result of addition is larger than FFFFFFFFFFFF or the result of subtraction is smaller than 0, then output "overflow." The program should include 4 procedures, addition, subtraction, and two versions of division. The two division procedures should be implemented with the addition and subtration procedures. In the report, you should compare the performance of the two versions of division. Note that you are NOT allowed to use the floating-point instructions in this assignment.

Input an expression: ABCDEFABCDEF + 123456123456
Output: BE0245BE0245

Input an expression: FEDCBAFEDCBA123456123456
Output: overflow

Input an expression: 123456123456 - 1234512345
Output: 122221C11111

Input an expression: 123456123456 - ABCDEFABCDEF
Output: overflow

Input an expression: ABCDEFABCDEF / 123456
Output: 9700038...105B1F                (version 1)
Output: 9700038...105B1F                (version 2)

Due date  : 12/22 (extended)
Submission:
Closed
Grading    : Bonus points will be added for those with good algorithms and/or performance analysis.

Assignment 4

Write a classic snake game, as shown in real mode. In this game, a player uses the arrow keys, up, down, left and right, to navigate the snake to eat the food. Each time the snake eats the food, his tail grows longer. When the snake goes off the screen or hits his own tail, the game is over. The program should provide the functions of play, pause and stop. Bonus points will be given for other interesting features like sound effects, speed changing, additional walls, and multiple players.

Example of Snake Game

Due date  : 1/5
Submission:
Closed
Grading    : Bonus points will be added for those with good algorithms and/or performance analysis.