Assume that a new machine has been developed. Give justification of the selection of every addressing mode? – IGNOU MCA Assignment 2014 – 15

By | October 6, 2014

MASTER OF COMPUTER APPLICATIONS
Course Code : MCS-012
Course Title : Computer Organisation and Assembly Language Programming
Assignment Number : MCA (2)/012/Assign /2014-15
Maximum Marks : 100
Weightage : 25%

Assume that a new machine has been developed. This machine has 64 general purpose registers of 64 bits each. Out of these 64 registers, 32 registers are used as stack for subroutine calls. The machine has 1 GB main memory with memory word size of 64 bits. The Instructions of this machine is only one memory word. An instruction of the machine consists of opcode – 6 bits, addressing mode specification – 2 bits and remaining bits for specifying the operand addresses. An ADD instruction on this machine has a fixed opcode 110011. The four possible addressing modes for the ADD instruction are coded using the 2 bit addressing mode field. Each ADD instruction involves three operands with at least one of the operand as register operand. Design four ADD instructions, involving at least four different types of addressing modes. Give justification of the selection of every addressing mode

 

Total general purpose registers = 64

All Register equal size = 64 bits

Registers used as stack for subroutine calls = 32

Main memory = 1 GB

Memory word size = 64 bits

Instructions size = one memory word = 64 bits

Opcode = 6 bits

Addressing mode = 2 bits

Remaining bits = operand addresses

An ADD instruction has a fixed opcode = 110011

Each ADD instruction involves = 3 operands (with at least 1 as register operand)

 

Design four ADD instructions, involving at least four different types of addressing modes. Give justification of the selection of every addressing mode

 

Please note the following points:

  • The opcode size is 6 bits. So, in general it will have 26 = 32 operations.
  • There is three operand address machine.
  • There are two bits for addressing modes. Therefore, there are 22 = 4 different addressing modes possible for this machine.
  • The last field (8 – 64 bits = 56 bits) here is the operands or the addresses of operands field.

 

Addressing Mode = 2 bits

   Instruction_Format_01

An ADD instruction has a fixed opcode = 110011

Each ADD instruction involves = 3 operands (with at least 1 as register operand)

 

Since One register operand has to be involved in all Addressing modes, so we have to use first operand as Register for all modes and this will be common for all.

Instruction_Format_02

IMMEDIATE addressing mode:

Instruction_Format_03

ADD R 12 13                              R = 12 + 13

 

In case of immediate operand the maximum size of the unsigned operand would be 225

DIRECT addressing mode:

Instruction_Format_04

ADD R A B                                 R = A + B

 

In case it is an address of operand in memory, then the maximum physical memory size supported by this machine is 225 = 32 MB.

REGISTER addressing mode:

Instruction_Format_05

ADD R1 R2  R3                             R1 = R2 + R3

 

There are 64 general purpose registers. Therefore, there is 64 = 26 (6-bits for Register address)

REGISTER INDIRECT addressing mode:

Instruction_Format_06

ADD R1 R2 R3                              R1 = R2  + R3

ADD R1 (R2 ) (R3 )                       R1 = (R2 ) + (R3 )

ADD R A B                                 R = A + B

 There are 64 general purpose registers. Therefore, there is 64 = 26(6-bits for Register address)

 

Total Selected Addressing Modes:

00 – IMMEDIATE addressing mode

01 – DIRECT  addressing mode

10 – REGISTER addressing mode

11 – REGISTER INDIRECT addressing mode