Finding the maximum number of registers that can be assigned to certain machine?
ID: 3856015 • Letter: F
Question
Finding the maximum number of registers that can be assigned to certain machine?
I am confused on what they are doing here
Can somebody please explain?
Instruction Encoding - Example What is the max number of registers that can be designed in a machine given: 16-bit instructions Num. opcodes 100 * All instructions are (reg, reg) reg (i.e., 2 source operands, 1 destination operand) opcode dest src1 src2 16 bits 1. num opcode bits =log2(100)-7 2. num bits for operands 16-7 9 3, num bits per operand = 9 / 3-3 4. maximum number of registers 2A3 8Explanation / Answer
here total length of instruction = 16 bits
number of opcodes = 100
value of 100 in binary = 1100100 so it needs 7 bits to store 100 different opcodes
now remaining bits = 16 -7 = 9bits
9 bits can be divided among dest,src1 and src2 registers
9 divided by 3 = 3
so 3 bits each for each of these three registers
7+3+3+3 = 16 bits
opcode = 9 bits dest = 3 bits src1 = 3 bits src2 = 3 bitsRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.