Professional Documents
Culture Documents
COA - Worksheet2 ANSWERS-1
COA - Worksheet2 ANSWERS-1
(TRUE)
(TRUE)
(TRUE)
(FALSE)
6. ROMs are used to store data that generally cannot be easily changed
(TRUE)
1. List and explain the three basic techniques used for mapping blocks into cache
lines (2 mark)
ANSWER:
COA_Worksheet_1
Page 1
1. Direct Mapping
In direct mapping, each block of main memory maps to exactly one cache line.
The cache is divided into a number of lines, and each block from main memory is
assigned a specific line based on its address.
2. Associative Mapping
In associative mapping, a block from main memory can be placed in any cache
line. There are no fixed positions; the block can be stored anywhere in the cache.
3. Set-Associative Mapping
2. First define CISC and RISC Compare and contrast RISC vs CISC (2 marks)
ANSWER:
COA_Worksheet_1
Page 2
cycle. It uses a small, highly optimized set of instructions that are of fixed length
and can execute simple tasks quickly and efficiently.
Similarities
Differences
1. Instruction Set:
2. Execution Speed:
RISC aims for single-cycle execution per instruction, while CISC instructions
may take multiple cycles.
3. Hardware Complexity:
COA_Worksheet_1
Page 3
RISC architectures are simpler and easier to pipeline, while CISC
architectures are more complex but can handle more sophisticated tasks per
instruction.
4. Memory Access:
4. Draw the level of memory hierarchy diagram. Write the key parameters, as
we move down the hierarchy? (1 Marks)
COA_Worksheet_1
Page 4
Speed (Access Time): Generally, decreases as we move down the
hierarchy.
Volatility:
Accessibility:
4. Use three inputs x, y, z and three outputs A, B, C. When the binary input is 0,
1, 2, or 3 the binary output is two greater than the input. When the binary input is
4, 5, 6 and 7, the binary output is one less than the input. (2 Marks)
COA_Worksheet_1
Page 5
5. Convert (205)10 to (1pt)
6 Convert 96 to (1 pt)
COA_Worksheet_1
Page 7
1. Divide 96 by 16 (the highest power of 16 less than 96).
o Quotient: 6 (write it down)
o Remainder: 0 (convert to hexadecimal digit: 0)
2. Since the quotient (6) is less than 16, we don't need further division.
3. Combine the digits: 60.
C. Octal (base-8):
1. Divide 96 by 8 (the highest power of 8 less than 96).
o Quotient: 12 (write it down)
o Remainder: 0 (convert to octal digit: 0)
2. Divide the quotient (12) by 8:
o Quotient: 1 (write it down)
o Remainder: 4 (convert to octal digit: 4)
3. Combine the digits in reverse order of remainders: 140
COA_Worksheet_1
Page 8
Following the steps above, the two's complement of 100 (1100100 in binary) is
0011100.
Key Observation:
o 0: Positive number
o 1: Negative number
In this case, both 100 and -100 have the same magnitude (100).
COA_Worksheet_1
Page 9
3. Since it's a fraction, multiply remainders by 8: 4 (from step 2) * 8 = 34.8 ->
collect integer part (3) and new fraction (0.8)
ANSWER:
COA_Worksheet_1
Page 10
3. Final simplified expression: 2AB'C + BC = BC (AB'C term becomes
irrelevant because BC covers all possibilities).
BC
ANSWER:
11 .List down some key feature about each computer generations. (2pts)
ANSWER:
COA_Worksheet_1
Page 11
High Power Consumption: Consumed a significant amount of power and
generated a lot of heat.
Magnetic Core Memory: Magnetic core memory was used for primary
storage.
COA_Worksheet_1
Page 12
Minicomputers: The emergence of minicomputers made computing more
affordable and accessible to businesses and universities.
COA_Worksheet_1
Page 13
Internet of Things (IoT): Integration of computing devices into everyday
objects, enabling smart and interconnected systems.
12. Derive the Boolean expression for the logic circuit shown below: (1pts)
13. Determine the values of A, B, C, and D that make the sum term
equal to zero. (1pts)
ANSWER:
14. Compare zero-, one-, two-, and three-address machines by writing programs
using the follows equation (3 marks) X = (A + B * C)/(D - E * F). (2pts)
ANSWERS:
Zero-address
PUSH A
PUSH B
PUSH C
MUL // Multiply B by C
COA_Worksheet_1
Page 14
ADD // Add A to the result
PUSH D
PUSH E
PUSH F
MUL // Multiply E by F
DIV // Divide the previous result by the current top of the stack (the result of
ADD)
One-address Machine
DIV // Divide the accumulator by the current value (the result of the previous
subtraction)
Two-address Machine
COA_Worksheet_1
Page 15
MUL R1, C // Multiply register 1 by C
DIV R1 // Divide register 1 by the current value (the result of the previous
subtraction)
Three-address Machine
15. Convert the following Expression from Infix to Postfix Notation by applying a
Stack operation (2 marks) f = (a - b)/(c + d * e) (1pts)
ANSWER:
COA_Worksheet_1
Page 16