A digital computer has a memory unit with a 32-bit instruction and a register fi
ID: 655330 • Letter: A
Question
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.
a) How many bits are needed for the opcode?
b) How many bits are left for the immediate operand?
c) 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?
d) What are the largest and smallest values of signed 2s complement binary numbers that can be accommodated as an immediate operand?
Explanation / Answer
a)
An opcode indicates the instruction to be executed.
Consider the number of operations in the instruction set is 130.
Convert 150 to binary format.
The binary format of 130 =(10000010)2.
The number of bits used to represent the number of operation in binary format is 8 bits.
Therefore, the required bits for opcode are 8 bits.
b)
Consider the memory unit with 32 bits per instruction.
The bits required for opcode are 8 bits.
The computer has 64 registers then the number of bits required for the register field is given as follows:
64=26. Then, the number bits of required for the register field is 6 bits.
The formula for the number bits lefts for the immediate operand is as follows:
=32-8-6 = 18.
Therefore, the number bits lefts for the immediate operand is 18 bits.
c)
The number of the immediate operand bits (N) = 18.
Formula for the number of words in the memory is 2N.
Substitute N= 18 in the above formula.
Therefore, the maximum number of words addressed in the memory =218=262144.
d)
The number of the immediate operand bits (N) = 18.
The range of the signed 2’s complement is -(2N-1) to (2N-1-1).
The largest value of the signed 2’s complement is,
= 2N-1-1 = 218-1-1 =217-1
The smallest value of the signed 2’s complement is,
= -(2N-1) = -(218-1) = -217.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.