Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

7. Design an expanding opscode scheme (i e, show the assignment of opcode bit pa

ID: 3599920 • Letter: 7

Question

7. Design an expanding opscode scheme (i e, show the assignment of opcode bit patterns) to allow all of the following to be encoded in a 32-bit instruction format 7 anstnuctions widh nwve 12-bit memory addreseadtres 1024 instructions with one 12-bit memory addresses and one 5-bit register address, and 50 instructions with no memory addresses or register addresses. See class notes on Instruction Set Architecture for the format in which your solution should be presented. Note that the above are not three independent cases. All instructions are needed in a single machine. If it is not possible, explain your answer. ch is not posible, eny

Explanation / Answer

Number of bits required for register address storage = 5

Number of bits required for memory address storage = 2*12=24

Instruction = 32 bits

Total bits left for opcode = 32 - (5+24) = 32-29=3

INSTRUCTION_A = OPCODE+ REG_ADDRESS + MEMORY_ADDRESS + MEMORY_ADDRESS

Since there are 7 instructions of INSTRUCTION_A type

=> OPCODE = 000,001,010,011,100,101,110

=> INSTRUCTION_A = 000 XXXXX XXXXXXXXXXXX XXXXXXXXXXXX

...............................

= 110 XXXXX XXXXXXXXXXXX XXXXXXXXXXXX

Here, X deonte either 0 or 1.

Next, second instruction type

INSTRUCTION_B = OPCODE+ REG_ADDRESS + MEMORY_ADDRESS

Number of bits required for register address storage = 5

Number of bits required for memory address storage = 12

Instruction = 32 bits

Total bits left for opcode = 32 - (5+12) = 32-17=15

Since there are 1024 instructions of INSTRUCTION_B type

And, Instructions starting with 000 to 110 cannot be used as they are already used for INSTRUCTION_A

=> OPCODE(15 bits) = 1110 0000 0000 000 ,................,1110 0111 1111 111

=> INSTRUCTION_B = 1110 0000 0000 000 XXXXX XXXXXXXXXXXX

...............................

= 1110 0111 1111 111 XXXXX XXXXXXXXXXXX  

Here, X deonte either 0 or 1.

Next, third instruction type

INSTRUCTION_C = OPCODE

Instruction = 32 bits

OPCODE=32 bits

Since there are 50 instructions of INSTRUCTION_C type

And, Instructions starting with 000 to 110 cannot be used as they are already used for INSTRUCTION_A

Also,  Instructions starting with 1110 0000 0000 000 to 1110 0111 1111 111 cannot be used as they are already used for INSTRUCTION_B

=> OPCODE(32 bits) = 1110 0111 1111 1110 0000 0000 0000 0000, ........ ..,

1110 0111 1111 1110 0000 0000 0011 0010

=> INSTRUCTION_C = 1110 0111 1111 1110 0000 0000 0000 0000

...............................

= 1110 0111 1111 1110 0000 0000 0011 0010  

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote