Suppose the main memory of the Pep8 were completely filled w
Suppose the main memory of the Pep/8 were completely filled with unary instructions. How many instructions would it contain? (b) What is the maximum number of instructions that would fit in the main memory if none of the instructions is unary? (c) Suppose the main memory is completely filled with an equal number of unary and nonunary instructions. How many total instructions would it contain?
Solution
(a)
The memory of Pep/8 is 65,536 bytes. In this each instruction contain 8 bits. The unary instruction contain only the instruction specifier, which has 8 bits.
1 byte instruction * 65,536 bytes = 65,536 instructions
(b)
Non-unary instruction contain instruction specifer and operand specifier. The instruction specifer has 8 bits and operand specifier has 16 bits. A non-unary instruction take 3 bytes.
Therefore, the maximum number of instructions if none of the instructions is unary are = 65,536 bytes / 3 bytes
= 21,845 instructions
(c)
Unary need 1 byte and non-unary need 3 byte = 4 bytes
so, 65,536 / 4 = 16,384.They have equal number of instructions.
Toatal number of instructions = unary instructions + non-unary instructions
= 16,384 + 16,384
= 32,768 instructions
