Addressing Modes- Q7

+3 votes

A machine has 2 types of general purpose register: Integer and Float. Integer registers are total 16 in number and floating point registers are total 64 in number. The machine has 2 Byte long instructions. There are four types of instructions:
Category-1 Category-2, Category-3 and Category 4.
Category-1: Instructions with 2 integer inputs and 1 integer output. These are 4 in number
Category-2: Instructions with 1 float input and 1 float output. These are 8 in number
Category-3: Instructions with 1 integer input and 1 float output. These are 14 in number
Category-4: Instructions with 1 float input only. These are N in number

Both source and destination register(s) are explicitly mentioned in the instruction where ever applicable.
What is the value of N?

asked Jun 4 in Computer Organization by gbmentor (54,290 points)
reshown Jun 5 by gbmentor

2 Answers

–1 vote
 
Best answer
machine has 2 byte = 16 bits instruction format, therefore, possible encodings = 2^16.
    As the processor has 16 integer register, number of bits for one integer register = 4 (2^4 = 16)
    As the processor has 64 floating point register, number of bits for one floating point register = 6 (2^6 = 64).
    For type-1 category having 4 instructions each having 3 integer register operands (4*3 = 12 bits) will consume 4 * 2^12 = 2^14 encodings.
    For type-2 category having 8 instructions each having 2 floating point register operands (2*6 = 12 bits) will consume 8 * 2^12 = 2^15 encodings.
    For type-3 category having 14 instructions each having 1 integer register and 1 floating point register operands (4 + 6 = 10 bits) will consume 14 * 2^10 = 14336 encodings.
    For type-4 category instructions, number of encodings left = 2^16 – 2^14 – 2^15 – 14336 = 2048.
    For type-4 category having N instructions each having 1 floating point register operand (6 bits) will consume N* 2^6 = 2048 (calculated from previous step). Therefore, N = 32.
answered Jun 5 by vinayakjhapro18 (2,940 points)
0 votes
N=32 is correct answer.
answered Jun 5 by tsnikhilsharmagate2018 (19,690 points)
Answer:
...