Fundamentals of Computer Architecture - Jan 2003 (PAST PAPER)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

CS1031

One and a Half Hours

UNIVERSITY OF MANCHESTER

Fundamentals of Computer Architecture

January 2003

Answer Question One and ONE other Question

The use of electronic calculators is not permitted.

[PTO]
2 CS1031

1. This question examines fundamental background material and is compulsory.

a) Express the 8-bit binary pattern 1011 1001


i) in hexadecimal notation
ii) in octal notation (2 marks)

b) To which decimal number does the binary pattern 1011 1101 correspond assuming
that it represents
i) An unsigned binary integer
ii) A signed binary integer in 1’s complement notation
iii) A signed binary integer in 2’s complement notation
iv) A signed binary integer in sign and magnitude notation (4 marks)

c) If register r1 contains the value 0x5c and register r2 contains the value 0x6a, what are
the results of the following ARM instructions
i) eor r0, r1, r2
ii) bic r0, r1, r2
iii) mov r0, r1, ror #4 (6 marks)

d) Explain, with the aid of a diagram illustrating the layout of affected memory locations,
the result of the following ARM instruction
stmda r8!, {r4-r6, r0} (4 marks)

e) How many address bits are required to address 64 Mbyte of memory in a byte
addressed memory. (2 marks)

f) Explain the purpose of the CPSR register in an ARM processor. (2 marks)

2. a) All instructions in the ARM instruction set may be conditionally executed. Discuss the
advantages and disadvantages of this feature. (4 marks)

b) The following subroutine prints in hexadecimal format a number held in register r1.
Explain the purpose of each line of code.
Note: it is not enough to merely state the effect of a particular instruction, you should
also indicate how that statement contributes to the goal of the subroutine. For example,
the correct explanation of the statement
HexOut mov r2, #8
is not “move the value 8 into r0”, but rather “Hexout is a label which identifies the
subroutine. Register r2 is used as a loop counter and is initialised to the value 8
because there are 8 hexadecimal digits to be printed” (10 marks)
3 CS1031

SWI_WriteC EQU &0


SWI_Exit EQU &11

HexOut mov r2, #8


LOOP mov r0, r1, lsr #28
cmp r0, #9
bhi ASCII
add r0, r0, #"0"
swi SWI_WriteC
b NEXT
ASCII
add r0, r0, #"A"-10
swi SWI_WriteC
NEXT
mov r1, r1, lsl #4
subs r2, r2, #1
bne LOOP
mov pc, r14

c) Rewrite this code taking advantage of conditionally executed instructions to remove


unnecessary branches. (6 marks)

3. a) What is meant by a coprocessor? (4 marks)

b) Floating point calculations may be computed using a coprocessor.


Explain why this functionality is not incorporated directly into the ARM instruction set.
(2 marks)

c) Discuss the various compiler options (e.g. software libraries or hardware coprocessors)
for providing facilities for floating point calculations (4 marks)

d) Describe the IEEE 754 representation of a single precision floating point number
(6 marks)

e) Discuss the reasons for the format chosen for the IEEE 754 standard (4 marks)

You might also like