A digital computer has a memory unit with a 32bit instructio

A digital computer has a memory unit with a 32-bit instruction and a register file with 64 registers. The instruction set consists of 130 different operations. There is only one type of instruction format, with an opcode, a register file address, and an immediate operand. Each instruction is stored in one word of memory. How many bits are needed for the opcode? How many bits are left for the immediate operand? If the immediate operand is used as an unsigned address to memory, what is the maximum number of words that can be addressed in memory? What are the largest and smallest values of signed 2cm binary numbers that can be accommodated as an immediate operand?

Solution

Given information:
1. There are 64 registers , that means 2^6 = 64 , 6 bits are needed for the Register .
2. There are 130 instructions , that means 2^8 = 256 , 8 bits are needed because 2^7 = 128 which is less than 130 , so we need one more bit i.e 8 here.
3. Total instruction size is 32 .
4. Instruction format is Opcode | Register | Immediate Operand

a) Bits needed for the Opcode -> 8 as computed above (2^ 8 = 256 as need more than 2^7 = 128 , so 8)

b) Bits left for Immediate Operand = 18
Instructiuon format is Opcode | Register | Immediate Operand
Total bits is 32 so 32 - 8(Opcode) - 6 (Register) = 18 .

c) We know that if the adress space is 2^ N for N bit address , So if Immediate Operand is used as unsigned address to memory , Maximum words that can be addressed are 2^18 = 262144 .

d) Largest and Smallest Values of Signed 2s binary Numbers
We know that Signed 2s compement Ranges from -(2^(n-1)) to   2^(n-1) - 1 for n bits , so which is equal
to -2^17 and 2^17 - 1 => -131072 (Smallest) and 131071 (Largest)

Thanks, I hope it clarifies

 A digital computer has a memory unit with a 32-bit instruction and a register file with 64 registers. The instruction set consists of 130 different operations.

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site