In: Computer Science
Problem 3. A digital computer has a memory unit with 32 bits per word. The instruction set consists of 122 different operations. All instructions have an operation code part (opcode) and an address part (allowing for only one address). 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 address part of the instruction? c) What is the maximum allowable size for memory? d) What is the largest unsigned binary number that can be accommodated in one word of memory?
Given:
Word size = 32 bits
number of operations = 122
size of each instruction = 1 word = 32 bits
a) How many bits are needed for opcode?
=> bits for opcode = upper bound of log2(122) = 7 bits
b) How many bits are left for the address part of the instruction?
=> address bits = total bits in instruction - bits for opcode = 32 - 7 = 25
c) What is the maximum allowable size for memory?
As calculated in previous part size of each address = 25 bits
Assuming word addressable means each locations holds 1 byte of data.
=> maximum size of memory = 225 bytes = 33554432 bytes = 32 MB
If instead word addressable, then word size = 32 bits = 4 bytes
=> maximum size of memory = 32 x 4 MB = 128 MB
d) What is the largest unsigned binary number that can be accommodated in one word of memory?
As word size = 32 bits
So largest unsigned number in binary = all 32 bits are 1's = 232 - 1 = 4294967295 in binary