Consider a 32-bit processor which supports 70 instructions. Each instruction is 32 bit long and has 4 fields namely opcode, two register identifiers and an immediate operand of unsigned integer type. Maximum value of the immediate operand that can be supported by the processor is 8191. How many registers the processor has?

Consider a 32-bit processor which supports 70 instructions. Each instruction is 32 bit long and has 4 fields namely opcode, two register identifiers and an immediate operand of unsigned integer type. Maximum value of the immediate operand that can be supported by the processor is 8191. How many registers the processor has? Correct Answer 64

Data:

Each instruction = 32 bit

Number of instructions which are supported = 70

Maximum value by unsigned operand = 8191

Formula:

Opcode

Register 1 (R)

Register 2 (R)

Immediate Operand

 

In bits,

Opcode + R + R + Immediate Operand = 32

Calculation

Number of bits needed for opcode = ⌈ log2(70)⌉ = 7 bits

The maximum value of unsigned immediate operand = 8191

2n – 1 = 8191

2n = 8192 = 213

∴ n = 13 bits

7 + R + R + 13 = 32

2R = 12

∴ R = 6 bits.

Maximum registers that a processor has = 26 = 64.

Related Questions