You are on page 1of 4

UNIVERSITY OF VICTORIA

FINAL EXAM
December 2013
Course Name & No.:

Introduction to Computer Architecture, CENG 255

Section(s):

A01, A02

CRN:

10388, 10389

Instructor:

Kin Fun Li

Duration:

3 hours

NAME:
STUDENT NUMBER: V00________________
This exam has a total of ?? pages including this cover sheet, ?? pages of formulas
and ? pages of questions
Students must count the number of pages and report any discrepancy immediately
to the Invigilator.
This exam is to be answered:
o On the paper
Materials Allowed: Calculator (All types)
Marking Scheme: Total marks: 45.
Answer all questions.
Justify your answers if you feel it is necessary, even for
multiple-choice questions.
Make and state appropriate assumptions.

CENG 255 INTRODUCTION TO COMPUTER ARCHITECTURE


Page 2
Hints:
A. 20 = 1; 21 = 2; 22 = 21 X 21; 23 = 21 X 22; 2n = 21 X 2(n-1)
B. The three binary number representation schemes for signed integers are:
I. Sign and magnitude where the most significant bit being 0 for a positive number and 1 for a
negative number.
II. Ones complement where a negative number is represented by the complement of its positive
representation.
III. Twos complement where a negative number is derived by adding 1 to its ones complement.
C. To subtract 2 n-bit, signed, 2s complement binary numbers (i.e., X Y), first form the 2s
complement of Y, then add to X. If the result is within -2n-1 to +(2n-1-1), simply ignore the MSB.
If the result is not within the said range, then we have an overflow.
D. Addressing Modes:
Immediate
Register
Absolute (Direct)
Indirect
Index

#value
Ri
LOC
(Ri)
(LOC)
X(Ri)

operand=value
EA= Ri
EA=LOC
EA=[Ri]
EA=[LOC]
EA=[Ri]+X

1. To push an item on top of the stack, the instruction Move NEWITEM, +(SP) is used, circle the correct
answers:
1(a) This stack grows from ( lower / higher ) address to ( lower/higher ) address in memory.
1(b) This stacks pointer SP is pointing to a ( valid / useless ) item on the stack.
2. The stack of one implementation grows from low address to high address, and the current stack pointer
is pointing to a valid item on the top of the stack. When an item is popped from the stack, should we predecrement, pre-increment, post-decrement, or post-increment the stack pointer?
3. Consider the following equation as a way to measure the performance of a computer implementation
using a particular benchmark:
Performance=1/(Number-of-Executed-Instructions*Cycle-Time*Average-Number-of-Cycles/Instruction)
To maximize performance, one has to minimize the parameters in the denominator of the above equation.
Suggest two (2) ways to minimize each of these parameters.
4a. The interrupt service routine usually involves data transfer between an input/output device and the
memory, and it seldom performs extensive computation. Offer an explanation why this is the case.
4b. What is the most important register to save before entering an ISR in step (ii) above?
5. How do we know a particular memory device is classified as primary or secondary memory?
6.Assume a primary memory has 2k words, each word has 2m bits, and access is on word boundary only.
6a. How many bits must the memory address register (MAR) be?
6b. How many bits must the memory data register (MDR) be?
7a. What is the decimal value if 1011 is a signed integer represented in sign and magnitude?
7b. What is the decimal value if 1011 is a signed integer represented in ones complement?
7c. What is the decimal value if 1011 is a signed integer represented in twos complement?

CENG 255 INTRODUCTION TO COMPUTER ARCHITECTURE


Page 3
8. Comment on the validity of this statement: Registers provide a lot of flexibility to the assembly
language programmer and the compilation of high-level language into assembly language; therefore, it is
a good idea to implement a large number of registers (for example, over a hundred).
9. In class, I often talk about efficiency with respect to time and space. Comment on time and space
efficiency of an assembly program.
10. The design of a control unit involves the sequencing and the timing of control signals. How is the
timing being regulated?
11. Using hardwiring to implement the control unit, each control signal (or microinstruction) is generated
based on several parameters.
11(a) Give 3 examples of these parameters.
11(b) Outline the process of determining how each of the control signals can be generated.
11(c) Microprogramming is another technique to implement the control unit where each microroutine
(corresponds to one assembly instruction) is stored in a control store memory. A Microroutine consists of
a sequence of microinstructions (or control signals), each of which is indexed, read, and output to the
various parts of the computer system. What are the relative advantage and disadvantage of using
microprogramming versus hardwiring.
12. Hints: see hints on Page 2.
12(a) Represent +6 in 2s complement.
12(b) Represent -2 in 2s complement.
12(c) Show the subtraction of -2 from +6 in 2s complement
13. In the memory-mapped input/output scheme an I/O devices is referenced using memory locations,
while in the IO-mapped input/output scheme an I/O device is referenced using input/output ports. A
specific processor has n-bit address and the last 256 locations in the memory are allocated for I/O devices.
13(a) What is the memory address range that the compiler can allocate a program (instructions and data)
to?
13(b) What is the memory address range that an I/O device can be assigned to?
14. When the processor receives an interrupt of higher priority than the current programs it is currently
executing, the processor will complete the execution of the current instruction before handling the
incoming interrupt. However, when the processor receives an internal exception such as divided by
zero, it will start the exception handling process immediately without completing the execution of the
current instruction. Explain this discrepancy in handling external interrupt and internal exception.
15. The speed performance of a computer system can be measured in elapsed time (wall clock time to
execute the program) or processor time (periods that the processor is active). Circle the correct answers.
15(a) As a user, which measure is more appropriate? ( elapsed time / processor time )
15(b) As a computer or electrical engineer, or hardware designer, which measure is more important? (
elapsed time / processor time )
16. Compute the time required to execute a program on a machine that operates at 1MHz (10 6). The
dynamic count of the assembly instructions of the program is 1000 and the machine executes each
instruction in 2 cycles.
18. Information in the main memory is represented by bits of 0s and 1s. While examining a particular
location in the main memory, a 4-bit item 1011 (b3b2b1b0) is found.
18 (a) Can we tell whether this is an instruction or a negative integer?
18 (b) What is the decimal value if 1011 is a signed integer represented in sign and magnitude?
18(c) What is the decimal value if 1011 is a signed integer represented in twos complement?

CENG 255 INTRODUCTION TO COMPUTER ARCHITECTURE


Page 4
19. An instruction cycle normally includes instruction fetch, decode, operand fetch from memory,
execution, interrupt handling, update program counter with the next instruction in sequence or the branch
target address. Which of steps may not be present in some of the instructions?
20. In executing a macro-instruction (also called assembly or machine instruction) the processor goes
through several steps with each step consisting of multiple actions.
20(a) Should there be any constraint(s) placed on the actions to be carried out within the same step?
20(b) Usually, the first few steps of each macro-instruction are exactly the same. Why?
21. When one types a key on the keyboard, an ASCII character is transmitted to the CPU. Upon reception
of this character, the CPU outputs the same character to the screen. This process is called echoing. Instead
of having the CPU involved, why dont we simply have this echoing process done within the
keyboard/screen unit so that the CPU is free to do other useful work?

END

You might also like