Professional Documents
Culture Documents
CS211 Test 1 Solution S1 2022
CS211 Test 1 Solution S1 2022
Serving the Cook Islands, Fiji, Kiribati, Marshall Islands, Nauru, Niue, Samoa, Solomon Islands, Tokelau, Tonga, Tuvalu, and Vanuatu.
INSTRUCTIONS:
Page 1 of 7
1. Explain the problem that a multi-level machine solves. (3 marks)
There is a large gap between what is convenient for people and what is convenient for
computers. People want to do X, but computers can only do Y. This leads to a problem.
2. Suppose there is a 3-level machine(Level 0, Level 1 and Level 2) and you have a program written
in Level 2 language to execute in that machine. Explain one way to execute the Level 2 program
in that machine. (2 marks)
Translation – the program written at high level is translated to lower level, hence new
program is generated by the translator. The machine then executes the new program.
OR
Interpretation - write a program in L0 that takes programs in L1 as input data and carries
them out by examining each instruction in turn and executing the equivalent sequence of L0
instructions directly. This technique does not require first generating a new program in L0.
Page 2 of 7
3. Between 1792 and 1871, the following technologies were invented. Explain the two technologies
and name the inventor(s). ( 4 marks)
a) Difference Engine
b) Analytical engine
a) This mechanical device, which like Pascal’s could only add and subtract, was
designed to compute tables of numbers useful for naval navigation. The entire
construction of the machine was designed to run a single algorithm, the method of
finite differences using polynomials. (1.5 marks)
b) The analytical engine had four components: the store (memory), the mill
(computation unit), the input section (punched card reader), and the output section
(punched and printed output). The store consisted of 1000 words of 50 decimal
digits, each used to hold variables and results. The millncould accept operands from
the store, then add, subtract, multiply, or divide them, and finally return the result
to the store. Like the difference engine, it was entirely mechanical. (1.5 marks)
4. Explain what will happen if a machine does not have an instruction execution cycle. (2 marks)
The machine will not be able to fetch instructions from memory, decode and exceute any
instructions.
Page 3 of 7
6. Suppose there is a 96-bit memory and bits per cell is 12. Draw a diagram to show the memory
organization. (3 marks)
1.5 mark for correct address numbering, 1.5 marks for 12 bits in a cell,
7. Why is there a need for memories to use error detection or error-correcting codes? (2 marks)
Computer memories can make errors occasionally due to voltage spikes on the power line
or other causes. To guard against such errors, some memories use error-detecting or error-
correcting codes.
8. Given the dataword, 1011 0011 1101, use hamming error detection and correction technique to
convert the dataword to codeword using even parity? Convert the codeword into hexadecimal.
(3 marks)
11 1 1 0110 0011110 1 1 1 mark
Bit 1: 1 3 5 7 9 11 13 15 17 = 5 odd
Bit 2: 2 3 6 7 10 11 14 15 = 5 odd
Bit 4: 4 5 6 7 12 13 14 15 = 5 odd
Bit 8: 8 9 10 11 12 13 14 15 = 4 even
Bit 16: 16 17 = 1 odd
1 mark for above
Code word = 1 1110 1100 0111 1011
Hexadecimal = 1EC7B 1 mark
Page 4 of 7
9. Represent -15 in 8 bits binary in the following ways:
a. One’s complement (1 mark)
b. Two’s complement (1 mark)
+ 1
----------------------------
10. Suppose the hard disk above has 2048 cylinders, 8 tracks per cylinder, 32 sectors per track and 512
Bytes per sector. The maximum seek time is 450 msec, the time to move between adjacent
cylinders is 10 msec, the rotation time is 14. Calculate the maximum access time If the entire disk
was full of data stored consecutively, how much time would it take to read the entire disk if the
read/write head is already positioned on the first sector of the first track of the first cylinder of the
disk? (3 marks)
Total time = cylinder read + track switch + track switch wait + cylinder switch/wait
Page 5 of 7
11. Show how the following floating point value -10.575 would be stored using IEEE-754 single
precision. Give the final answer in hexadecimal. (3 marks)
Integer Part
0.575 x 2 = 1.15 1
0.15 x 2 = 0.3 0
0.3 x 2 = 0.6 0
0.6x 2 = 1.2 1
0.2 x 2 = 0.4 0
0.4 x 2 = 0.8 0
0.8 x 2 = 1.6 1
0.6 x 2 = 1.2 1
0.2 x 2 = 0.4 0
Next, rewrite this binary number in scientific form by moving the binary point to the left 3
places.
1.01010010011001… x 2 ^ 3 ( 1mark)
C1293334 ( 1mark)
The End
Page 6 of 7
[BLANK PAGE]
Page 7 of 7