Re: [理工] [計組] 指令個數

看板Grad-ProbAsk作者 (jigfopsda)時間13年前 (2010/09/21 23:07), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
※ 引述《juan19283746 (小阮)》之銘言: : A given computer has 16bit instruction. Operand address are specified : using 6bit field. There are 13 two-operand instructiond and 13 : zero-operand instructions required. What is the maximum number of one-operand : instruction the can be provided in this computer ? : (A)192 (B)191 (C)64 (D)63 : 答案給B : 我的解法... : (2^4-13)*6^2-13 = 95 : 想請問這題正確的解法 謝謝 就假設operand都在16個bits的最後面, two-operand instruction需要12個bits決定operand,所以指令數最多2^(16-12) = 16個 用掉13個,所以前4個bits剩下三種組合可以識別指令(instructions)。 接下來考慮後12個bits, one-operand instruction需要6個bits決定operand,所以指令數最多2^(12-6) = 64個。 加上前面4個bits剩下的三種組合後為64 * 3 = 192。 但是前10個bits要留一個組合識別zero-operand instructions, 只要留一個是因為沒有operand所以最後6個bit總共可以識別2^6 > 13個。 所以答案為 192 - 1 == 191。 希望這樣講夠清楚@@ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 203.67.37.229 ※ 編輯: jigfopsda 來自: 203.67.37.229 (09/21 23:13)
文章代碼(AID): #1CcCewUe (Grad-ProbAsk)
文章代碼(AID): #1CcCewUe (Grad-ProbAsk)