CEG 2131 - Fall 2003 - Final
CEG 2131 - Fall 2003 - Final
University of Ottawa
School of Information Technology and Engineering
Number:___________________________________________________
Notes:
You may use the back of the pages for any side work. This will not be
marked.
Instruction formats and PSR format for the ARC are given on page 8.
3. The ARC architecture contains 32 bit program counter, the purpose of this counter is:
(a) Keeps track of instruction being executed
(b) Shows size of the program
(c) Shows size of the memory
(d) Keeps track of return address
6. The ARC ALU operations include ADDCC and ADD, these operations:
(a) Both carry out additions using two’s complement on A, B buses
(b) The first one (ADDCC) only carry out additions using two’s complement
(c) The second one (ADD) only carry out additions using two’s complement
(d) None of them carry out additions using two’s complement on A, B buses.
Page 3 of 14
7. In order to access data item whose address is known at assembly time we use:
(a) Immediate addressing mode
(b) Direct addressing mode
(c) Indirect addressing mode
(d) Register indirect addressing mode
10. Given 16M x 1 bit RAM module, in order to construct 32M x 8 bit RAM you need:
(a) 8 modules
(b) 16 modules
(c) 32 modules
(d) None of the above
Page 4 of 14
(i) The following is a single-precision IEEE 754 bit pattern. Show the numerical value as
a base 2 significand with an exponent (e.g. 1011 x 24). Note: spaces are only shown for
clarity
1 1000 0000 0000 0000 0000 0000 0000 000 Answer:.. - 1 x 21……
(ii) Write the IEEE 754 single precision bit pattern for the following number:
(iii) Add (255)10 and (-63)10 in signed BCD, using four-digit words.
Solution:
to get the tesn’s complement of 120:
9999
- 0063
9936
1
9937
Part B (8 marks):
Show the process of serial unsigned multiplication for 11.1 (multiplicand) multiplied by
01.1 (multiplier) by treating the operands as integers. Compare your results to its decimal
equivalent.
Initial values
Multiplicand (M):
111
C A Q Comments
000 011
0 111 011 Add M to A
0 011 101 Shift right
1 010 101 Add M to A
0 101 010 Shift right
0 010 101 shift right
0 010 1.01 fixed decimal
Page 6 of 14
Solution:
Traffic 3 x 4 + 3 x 3 = 21 5 x 3 + 2 x 2 + 3 x 3 = 28 7 x 2 + 7 = 21 words
words words
Page 7 of 14
Solution:
(i)
1584: R[temp0] SEXT13(R[ir]); /extract rs2 operand
(ii)
1584 = 1024 + 512 + 32 + 16
= ( 1 10001100 00 )2
op = 10
op2 = 001
op3 = 001 100
Page 8 of 14
Solution:
A B XOR XNOR
0 0 0 1
1 0 1 0
0 1 1 0
1 1 0 1
XNOR = AB + A B
/immediate
GOTO 1615;
Fill in four memory locations for the lookup table shown above, in which each of the four
operations: add, subtract, multiply, and divide are performed on A=16 and B= 4. Show
the address and the value for each case.
Solution:
Page 10 of 14
Part B:
A Random Access Memory (RAM) unit is designed using 8x8 RAM chips. In this
question you are required to design a 32-word memory unit, whose word is on 32 bits
using the above chips. Give all the details of your design showing how the data in the
designed memory is written or read from a specific address.
Solution:
Similar to the combination of the two solutions given below, in one single diagram
containing four rows and four columns.
Page 11 of 14