5. Suppose we have a 32-bit computer with an instruction set that supports immediate instructions as shown below:
Opcode Source Register Destination Register immediate
6 bits 5 bits 5 bits 16 bits
(a) How many registers at most does this computer have? (5%)
(b) How many operations at most can this computer have? (5%)
(c) What is the range of the number in the “immediate” field in 2'scomplement format? (5%)
SOL:
Given computer = 32 bits
Opcode = 6bits
Source Register = 5 bits
Destination Register = 5 bits
Immediate field = 16bits
a) The no of register the computer have = 2no of register bits
here Source Register = 5 bits, Destination Register = 5bits
5 bits are allocated for registers
No of register bits = 5
The no of registers the computer have = 25 = 32
so No of registers = 32
b) The no of operations the computer have = 2no of bits in opcode
= 26
= 64
so No of operations the computer have = 64
c) Given immediate field = 16 bits
The range of 2's complement format of n bits = -2n-1 to +(2n-1 -1)
The range of number in immediate field in 2's complement format is = -216-1 to +(2n-1 -1)
= -215 to +(216-1 -1)
= -215 to +(215 -1)
= -32,768 to 32,767
Get Answers For Free
Most questions answered within 1 hours.