[理工] Register與Memory Size問題

看板Grad-ProbAsk作者 (Wayne)時間5年前 (2019/04/20 12:04), 編輯推噓1(102)
留言3則, 1人參與, 5年前最新討論串1/1
今天看到一題如下,請問要如何計算? If the computer has 32 data registers (R0 to R31), 2000 words in memory, and 16 different instructions. What is the minimum size of an add instruction in bits if a typical instruction use the following format: add R0 R2 (A) 14 (B) 13 (C) 28 (D) 29 答案是給A 請問是如何得出的? 感謝各位! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.36.233.66 ※ 文章網址: https://www.ptt.cc/bbs/Grad-ProbAsk/M.1555733064.A.511.html

04/20 12:14, 5年前 , 1F
16 instrs. => op code要4碼
04/20 12:14, 1F

04/20 12:14, 5年前 , 2F
32 regs => rs/rt要5碼
04/20 12:14, 2F

04/20 12:14, 5年前 , 3F
所以此type的指令需要4+5+5=14碼
04/20 12:14, 3F
文章代碼(AID): #1Skff8KH (Grad-ProbAsk)