Professional Documents
Culture Documents
SCHOOL OF COMPUTING
EXAMINATION FOR
Semester 1 AY2013/14
Q1
Q2
Q3
Total Score
ANSWER SHEET
Q4
Q5
Q6
/100
Page 1 of 15
A
0
X
1
X
1
X
0
X
Next State
B
1
X
0
X
1
X
0
X
C
0
X
0
X
0
X
0
X
Flip-Flop A
JA
KA
0
X
X
X
1
X
X
X
X
0
X
X
X
1
X
X
Flip-Flop B
JB
KB
1
X
X
X
X
1
X
X
X
1
X
X
1
X
X
X
Flip-Flop C
JC
KC
0
X
X
X
0
X
X
X
0
X
X
X
0
X
X
X
Full marks: 10
Grading scheme:
Filling in the table correctly: 3 mark
Six K-maps: 1 mark each
Getting circuit correct: 1 marks
Afternote: Some of you has Jc = C by assuming that
the dont cares are 1. I took away a mark for this
because I feel it is not as simple as 0.
JA = B
KA = B
B
X
1
B
X
X
JB= 1
KB = 1
B
X
X
B
X
1
JC = 0
ANSWER SHEET
KC = 0
B
X
0
B
X
X
Page 2 of 15
Full marks: 5
Grading scheme:
Getting A correct: 2 mark
Getting B correct: 3 marks
ANSWER SHEET
Page 3 of 15
Full marks: 3
Grading scheme:
Final answer correct: 2 marks
Working: 1 mark
0x44e13800
ANSWER SHEET
Guard bit
= 1
Round bit
= 0
Sticky bit
= 1
Full marks: 3
Grading scheme:
1 mark for each bit (subject to correctness of working)
No working provided or working wrong: 1 mark
Page 4 of 15
1.01010001100101010111111
+ 0.00000000000000010000110101
---------------------------1.01010001100101101000101101
Rounding to nearest, we get the result of:
1.010100011001011010001102 x 216
0100 0111 1010 1000 1100 1011 0100 0110
or 0x47A8CB46
Full marks: 6
Grading scheme:
Performing the addition correctly: 3 marks
(Partial marks for partially correct answer all will
depend on my estimation of how many percent is the
answer correct.)
Rounding correctly done: 1 mark
Final answer in hex correct: 2 marks
Final answer not presented in hex: 1 marks
ANSWER SHEET
Page 5 of 15
Full marks: 3
Grading scheme:
Partial marks for partially correct answer all will
depend on my estimation of how many percent is the
answer correct.
Afternote: in the first version, I had the constant as
0xFEED. I will be lenient on this.
ANSWER SHEET
Page 6 of 15
$t0, $a1, $0
bne
sll
$t1, $a1, 2
# Multiply index by 4
add
lw
$v0, -4($t0)
LOOP:
beq
lw
$t1, -4($t0)
slt
bne
# Get ARR[i-1]
# decrement address
NEXT:
LOOP
jr
$ra
OUT:
# Current min already in return value $v0
Full marks: 12
Grading scheme:
Partial marks for partially correct answer all will
depend on my estimation of how badly wrong is your
answer.
ANSWER SHEET
Page 7 of 15
Signal
Value
Read reg 1
0xD
Read reg 2
0x5
Write reg
X / 0x2
RegDst
RegWrite
ALUSrc
Branch
Address
ALUOp
0x2
MemWrite
MemRead
MemtoReg
0x6945204
0x6208
Full marks: 5
Grading scheme:
For each incorrect entry that is not a dont-care in the answer,
0.5 marks, subjected to a minimum total mark of 0.
ANSWER SHEET
Page 8 of 15
Full marks: 5
Grading scheme:
Points 1 and 3: 1 mark each
Point 2: 2 marks
How well the answer is written up: 1 mark
ANSWER SHEET
Page 9 of 15
Clock Cycle
i-1
i
i+1
1
0
0
1
0
0
1
0
0
0
0
0
0
1
0
No. The situation is not correctly handled. While a NOP was inserted as the
load-use hazard was detected, when the load finishes accessing memory, the
current hardware only forwards into the ALU as RT. But for a sw instruction, the
ALU uses RS and the immediate to compute the address and discards the RT.
Instead the incorrect RT read from the register file by the sw instruction is
written into memory.
Full marks: 4
Grading scheme:
Filling up the table correctly: 2 marks
Identifying the issue in the handling: 2 marks
ANSWER SHEET
Page 10 of 15
The existing load-use hazard mechanism will insert a NOP, and the forwarding
needs to be done as above.
Full marks: 4
Grading scheme:
Identifying the forwarding path correctly: 2 marks
Explaining the solution: 2 marks
ANSWER SHEET
Page 11 of 15
ANSWER SHEET
Initial State
Loop
BR
00
00
00
01
00
00
00
01
Page 12 of 15
00
00
PC at OUT
Loop
BR
01
00
Full marks: 8
Grading scheme:
Each of the entries before the last two: 0.5 mark each
Last two entries: 1 mark each
ANSWER SHEET
Page 13 of 15
Full marks: 3
Grading scheme:
Getting the number of bits for each field correct: 1 mark
Getting the total for each set correct: 1 mark
Getting the total correct: 1 mark
Valid
1
Tag
0x10020947
Word1
0x80104A3C
Hit
Word0
0x80104A38
Miss
M[0x04008112]
Index
0
1
2
3
Valid
1
1
Tag
0x10020947
0x801022
Word1
0x80104A3C
0x04008114
Hit
ANSWER SHEET
Word0
0x80104A38
0x04008110
Miss
Page 14 of 15
M[0x80104A9B]
Index
0
1
2
3
Valid
1
1
1
Tag
0x10020947
0x801022
0x10020953
Word1
0x80104A3C
0x04008114
0x80104A9C
Hit
Word0
0x80104A38
0x04008110
0x80104A98
Miss
M[0x04008118]
Index
0
1
2
3
Valid
1
1
1
1
Tag
0x10020947
0x801022
0x10020953
0x801023
Hit
Word1
0x80104A3C
0x04008114
0x80104A9C
0x0400811C
Miss
Word0
0x80104A38
0x04008110
0x80104A98
0x04008118
M[0x80104A38]
Index
0
1
2
3
Valid
1
1
1
1
Tag
0x10020947
0x801022
0x10020953
0x801023
Hit
Word1
0x80104A3C
0x04008114
0x80104A9C
0x0400811C
Miss
Word0
0x80104A38
0x04008110
0x80104A98
0x04008118
M[0x0071881A]
Index
0
1
2
3
Valid
1
1
1
1
Tag
0x10020947
0xE3103
0x10020953
0x801023
Hit
Word1
0x80104A3C
0x0071881C
0x80104A9C
0x0400811C
Miss
Word0
0x80104A38
0x00718818
0x80104A98
0x04008118
Full marks: 12
Grading scheme:
Two marks for each reference.
For each reference, correctly identifying hit or miss is 0.5
mark, the rest is for getting the hexadecimal entry correct.
End of Answer Sheet
ANSWER SHEET
Page 15 of 15