Suppose a machine encodes instructions in 32-bits according tothe following form
ID: 3612846 • Letter: S
Question
Suppose a machine encodes instructions in 32-bits according tothe following format. Assume there are 250 opcodes and 70 registers. OPCODE | DR | SR1 | SR2 | UNUSED a. What is the minimum number of bits required to representthe OPCODE field? b. What is the minimum number of bits required to representeach of the register fields (e.g., DR)? c. What is the maximum number of bits left available for theUNUSED field? Suppose a machine encodes instructions in 32-bits according tothe following format. Assume there are 250 opcodes and 70 registers. OPCODE | DR | SR1 | SR2 | UNUSED a. What is the minimum number of bits required to representthe OPCODE field? b. What is the minimum number of bits required to representeach of the register fields (e.g., DR)? c. What is the maximum number of bits left available for theUNUSED field?Explanation / Answer
Because thre are 250 op codes you would need to representminimumlly 250 numbers in the op code. Binary 250 is 11111010 whichis 8 bits. so you need at least 8 bits for the opcode.
Since there are 70 registers you would need to representminimumlly 70 numbers in each of the register fields. Binary 70 is1000110 which is 7 bits. so you need at least 7 bits for eachregister field.
so if you started with 32 bits, and need 8 for the opcode,7 for each of the 3 register fields. you need 29 bits, the restwould be unused
Related 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.