A 32-bit instruction has a 6-bit opcode and two register fields for a 32-register file, with the rest used for a signed two’s complement immediate. What range can the immediate hold?

Correct answer C. -32768 to 32767

Explanation

32 registers need 5 bits each, so 6 + 5 + 5 = 16 bits are used and 16 remain for the immediate. A 16-bit two's complement field spans -2^15 to 2^15 - 1, that is -32768 to 32767. 0 to 65535 is the unsigned range of the same field, and -2048 to 2047 is the range of a 12-bit field. Instruction format design always trades register count against immediate width.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.