6/30/2021 COMP 228 Final Exam
https://moodle.concordia.ca/moodle/mod/quiz/attempt.php?attempt=2098947&cmid=2752114 1/9
Home / My courses / COMP-228-2211-AA / General / COMP 228 Final Exam
Information
At the bottom, there is room for you to upload scanned or photographed images of your work. Please allow yourself enough time
at the end of the exam to scan or photograph your work and upload it before your time is up.
https://moodle.concordia.ca/moodle/
https://moodle.concordia.ca/moodle/course/view.php?id=136415
https://moodle.concordia.ca/moodle/mod/quiz/view.php?id=2752114
6/30/2021 COMP 228 Final Exam
https://moodle.concordia.ca/moodle/mod/quiz/attempt.php?attempt=2098947&cmid=2752114 2/9
Question 1
Not yet answered
Marked out of 20.00
There is a bug in an application that is supposed to print an IEEE-754 single precision floating point number. The bug causes the
application to print out the bytes representing the number as a string of characters instead of the number. The computer this is
running on is a little-endian computer system using the ATASCII character set. The conversion table can be found below.
The following is the output that was printed out.
♥♥JA
Using the character conversion table below, what is the hexadecimal representation of the characters in this string?
Accounting for endianess, what is the 32-bit binary representation of value printed? (Before being interpreted as a floating point
number) Your answer should be 32 binary digits
What is value of the floating point number that the program was trying to output? Your answer should be in the range of 1 and
100 .
(in binary, e.g. 101.1)
(in base-10, e.g. 5.5)
A 32-bit IEEE-754 floating point number is: 1 sign bit, 8 bits for the exponent, 23 bits for the mantissa.
ATASCII
_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F
0_
♥
00
├
01
▐
02
┘
03
┤
04
┐
05
╱
06
╲
07
◢
08
▗
09
◣
0A
▝
0B
▘
0C
▔
0D
▂
0E
▖
0F
1_
♣
10
┌
11
─
12
┲
13
•
14
▄
15
▎
16
┬
17
┴
18
▌
19
└
1A
␛
1B
↑
1C
↓
1D
←
1E
→
1F
2_
20
!
21
”
22
#
23
$
24
%
25
&
26
‘
27
(
28
)
29
*
2A
+
2B
,
2C
–
2D
.
2E
/
2F
3_
0
30
1
31
2
32
3
33
4
34
5
35
6
36
7
37
8
38
9
39
:
3A
;
3B
< 3C = 3D >
3E
?
3F
4_
@
40
A
41
B
42
C
43
D
44
E
45
F
46
G
47
H
48
I
49
J
4A
K
4B
L
4C
M
4D
N
4E
O
4F
10
10
6/30/2021 COMP 228 Final Exam
https://moodle.concordia.ca/moodle/mod/quiz/attempt.php?attempt=2098947&cmid=2752114 3/9
Question 2
Not yet answered
Marked out of 20.00
5_
P
50
Q
51
R
52
S
53
T
54
U
55
V
56
W
57
X
58
Y
59
Z
5A
[
5B
\
5C
]
5D
^
5E
_
5F
6_
♦
60
a
61
b
62
c
63
d
64
e
65
f
66
g
67
h
68
i
69
j
6A
k
6B
l
6C
m
6D
n
6E
o
6F
7_
p
70
q
71
r
72
s
73
t
74
u
75
v
76
w
77
x
78
y
79
z
7A
♠
7B
|
7C
↰
7D
◀
7E
▶
7F
Part 1
Design a circuit to calculate the value of the parity bit for a four bit input using even parity. Take inputs b , b , b , b and output p .
You may use any gate (AND, OR, NOT, NAND, NOR, XOR) or circuit (Half-Adder, Full-Adder, Decoder, Multiplexer) discussed in
during the lectures.
Draw the circuit diagram needed to accomplish this and upload the drawing as part of your answer.
Part 2
As it’s own block, use the circuit you designed to calculate the parity bit in position 4 of a hamming code with 12 positions and
even parity as seen below. You only need to draw your circuit as a rectangle with 4 inputs and 1 output and you only need to
reference the bits you are using as inputs by name such as d , d , d , d , d , d , d , d .
12 11 10 9 8 7 6 5 4 3 2 1
d d d d p d d d p d p p
Draw the circuit diagram needed to accomplish this and upload the drawing as part of your answer.
Maximum file size: 250MB, maximum number of files: 1
Accepted file types
Image files used on the web .gif .jpe .jpeg .jpg .png .svg .svgz
0 1 2 3 0
0 1 2 3 4 5 6 7
7 6 5 4 8 3 2 1 4 0 2 1
Files
You can drag and drop files here to add them.
6/30/2021 COMP 228 Final Exam
https://moodle.concordia.ca/moodle/mod/quiz/attempt.php?attempt=2098947&cmid=2752114 4/9
Question 3
Not yet answered
Marked out of 10.00
Question 4
Not yet answered
Marked out of 5.00
Generate the next state of A and B for the above diagram given only knowledge of the current state of A and B. On left there are
two clocked JK flip-flops. On the right there is a half adder taking in two inputs and producing outputs C and S. C is the Carry
signal and S is the Sum signal. ~Q is the Q′ signal.
A B Next A Next B
0 0
0 1
1 0
1 1
Consider the following line of register transfer language
IR ← B
IR is the instruction register
B is a register which holds a value obtained from memory in a previous phase
Which stage of the fetch decode execute cycle would this line most likely belong to?
a. Fetch
b. Decode
c. Execute
6/30/2021 COMP 228 Final Exam
https://moodle.concordia.ca/moodle/mod/quiz/attempt.php?attempt=2098947&cmid=2752114 5/9
Question 5
Not yet answered
Marked out of 10.00
Consider the following 6502 assembly language program segment.
LDX #44 ; Load the X register with the immediate 44
TXA ; Copy X to the Accumulator
CLC ; Clear the Carry Flag
ADC #30 ; Add the immediate 30 to the Accumulator
STA 2200, X ; Perform an indexed store of the Accumulator to 2200 indexed by register X
All numbers are in base-10, express your answers in base-10.
The last line of code was a store instruction.
What value was stored?
What memory location was that value stored to?
Assuming this started with an empty pipeline, no hazards exist in the code, every instruction takes 4 cycles to run with only the
first cycle being the fetch cycle. How many cycles does it take to run this code?
6/30/2021 COMP 228 Final Exam
https://moodle.concordia.ca/moodle/mod/quiz/attempt.php?attempt=2098947&cmid=2752114 6/9
Question 6
Not yet answered
Marked out of 10.00
Given a system with:
2 way set associative cache, with a FIFO replacement policy.
A 16-bit address bus for memory
2 words of cache
A block size of 2 words
The cache has been filled from reads to these memory addresses: 66EB, D61F, 6D6B, 4DAE.
How many bits are allocated to each part of the memory address?
Tag Set Offset
Reminder: The cache has been filled from reads to these memory addresses: 66EB, D61F, 6D6B, 4DAE.
Trace the following ten memory reads. Fill in the tag and set of the address and mark down if a cache hit or cache miss occurs
All numbers are in hexadecimal, express your answers in hexadecimal
Address Tag Set
66CD
D688
9698
66C8
6D7B
D6CB
66C9
4D73
FD8E
4D1E
What is the hit rate expressed as a percentage?
%
13
8
6/30/2021 COMP 228 Final Exam
https://moodle.concordia.ca/moodle/mod/quiz/attempt.php?attempt=2098947&cmid=2752114 7/9
Question 7
Not yet answered
Marked out of 5.00
Question 8
Not yet answered
Marked out of 5.00
A Direct Memory Access Controller…
a. Performs large data transfers by means of “cycle stealing”.
b. Uses a segment of main memory to interact with I/O devices.
c. Signals to the processor that an I/O device needs attention.
A floppy disk stores data similarly to a hard drive.
Consider a floppy disk format with the following characteristics:
Two recording surfaces.
80 tracks on a recording surface.
8 sectors per track.
512 byte sectors.
How many blocks of data are there on one floppy disk?
How much storage can this floppy disk hold in Kibibytes?
KiB
6/30/2021 COMP 228 Final Exam
https://moodle.concordia.ca/moodle/mod/quiz/attempt.php?attempt=2098947&cmid=2752114 8/9
Question 9
Not yet answered
Marked out of 5.00
Question 10
Not yet answered
Marked out of 5.00
Question 11
Not yet answered
Marked out of 5.00
Order the following RAID levels such that the most reliable RAID level (one tolerates the most failiures) is first and the least
reliable is last
Most reliable Choose…
.. Choose…
.. Choose…
Least Reliable Choose…
Which programming tool converts a high level programming language into assembly language?
a. Linker
b. Assembler
c. Resident Monitor
d. Compiler
e. Basic Input Output System
Which early piece of system software only has the functionality to load and run a program?
a. Assembler
b. Linker
c. Compiler
d. Basic Input Output System
e. Resident Monitor
6/30/2021 COMP 228 Final Exam
https://moodle.concordia.ca/moodle/mod/quiz/attempt.php?attempt=2098947&cmid=2752114 9/9
Question 12
Not yet answered
Not graded
Upload any images of supporting work here. Uploads here are optional and will be used for part marks.
Maximum size for new files: 250MB
Accepted file types
Archive (ZIP) .zip
Image files used on the web .gif .jpe .jpeg .jpg .png .svg .svgz
PDF document .pdf
Files
You can drag and drop files here to add them.
Jump to…
COMP 228 Final Exam (Zoom Meeting) ▶
https://moodle.concordia.ca/moodle/mod/url/view.php?id=2751911&forceview=1