Possible answers to the test are below the test.
CSc 262 Test 1
Friday, 19 September 1997
Each question worth 20 points.
1. You are designing a pseudo-code for a machine with 512
words of data memory, 512 words of a separate program memory,
where each memory location stores an unsigned 22-bit word.
What form would an instruction take?
Design a single arithemetic
instruction, e.g., +, and a single logical instruction, and
explain, in detail, what they would do.
2. Explain the principles of Regularity and Simplicity.
For both FORTRAN and pseudocode give examples illustrating each
of the two principles.
3. Suppose two differnt FORTRAN subprograms, say SUBA and SUBB,
respectively, have the following COMMON declarations:
COMMON /COM1/ A(3,4), B(4,20)
COMMON /COM1/ B(4,20), A(3,4)
and both subprograms have the same DIMENSION statement:
DIMENSION A(3,4), B(4,20)
Which variable in the second subprogram corresponds to the
variable A(2,2) in the first subprogram? Which variable in
the first subprogram corresponds to the variable A(1,1) in
the second subprogram?
4. In FORTRAN the assigned GOTO and the computed GOTO
Choose one of the two to eliminate and explain
how to implement the one eliminated in terms of the one
Then explain how to eliminate the one remaining