View worked solution
Answer: 500
To find the total memory consumed by the program, we first determine the size of a single instruction in bits, align it to the nearest byte, and then multiply by the total number of instructions.
1. Calculating the size of each field in an instruction:
- Opcode: Since there are instructions in the instruction set, the number of bits required is:
- Source Registers: There are registers, requiring bits per register. For two source registers:
- Destination Register: One destination register requires:
- Immediate Value: Given as:
2. Total size per instruction:
Summing the bits of all five fields:
3. Byte-alignment:
Each instruction must be stored in a byte-aligned fashion (i.e., its size must be a multiple of bits). Therefore, we round up the size of each instruction to the nearest byte:
4. Total memory for 100 instructions:
Free practice · Your answers on this page are not saved.
