A digital computer has 32-bit instructions. There are a number ofdifferent instr
ID: 1830858 • Letter: A
Question
A digital computer has 32-bit instructions. There are a number ofdifferent instruction formats, and the number of bits in eachformat used for opcodes varies depending on the bits needed forother fields. If the first bit of the opcode is 0, then there arethree opcode bits. If the first bit of the opcode is 1 and thesecond bit of the opcode is 0, then there are six opcode bits. Ifthe first bit of the opcode is 1 and the second of the opcode is 1,then there are nine opcode bits. How many distinct opcodes areavailable for this computer?Explanation / Answer
32-bit word with 3 scenarios: CASE 1: least-sig bit = 0 ? 3-bit opcode 32 - 3 = 29 bits for data (we don't care about this...) least-sig bit must equal 0, so this leaves us with 3 - 1 = 2 bitsremaining. total 3-bit opcodes = 2^2 = 4 CASE 2: least-sig bits = 01 ? 6-bit opcode 32 - 6 = 26 bits for data least-sig bits must equal 01, so this leaves us with 6 - 2 = 4 bitsremaining. total 6-bit opcodes = 2^4 = 16 CASE 3: least-sig bits = 11 ? 9-bit opcode 32 - 9 = 23 bits for data least-sig bits must equal 11, so this leaves us with 9 - 2 = 7 bitsremaining. total 9-bit opcodes = 2^7 = 128 therefore, distinct opcodes for this hypothetical computer = 4 + 16+ 128 = 148 hope that helps...
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.