Concordia University
Department of Computer Science
COMP520
Assignment #3
Instructor: F. SAID
Due date: Next Week
Question 1.
Write a GAL program that will prompt the user enter a positive integer and print out its Factorial. Recall that F(X)=X*(X-1)*…*3*2*1.
Question 2.
Perform the following addition/subtraction in 2’s complement (not in decimal) using 8-bit binary representation. Identify the occurences of overflow/underflow. The given integers are in decimal:
Question 3.
Let LRS(x,I) and ARS(x,I) represent the result obtained by performing logical right shift ans arithmetic right shift of (binary) x by I bits respectively. Show the effect of these 2 statements on the following values of x and I:
Question 4.
Give the hexadecimal equivalent of the following GEML instructions (32-bit format):
Now, consider the execution of (a) that is stored in memory location 1000h. Identify the contents of PC, IR, source_1, source_2, result, and reg4 after each phase of the instruction cycle (similar to Fig. 6.5).
Question 5.
Given the following memory values and one-address machine with a accumulator:
Word 50 contains 30
Word 40 contains 20
Word 30 contains 40
Word 20 contains 50, and
Accumulator contains 60.
What will be the effect of the following sequential instructions:
Question 6.
A given memory system has the following characteristics: