Computer Architecture Assignment: Memory Access and Addressing Modes

Verified

Added on  2024/07/01

|6
|732
|158
Homework Assignment
AI Summary
This assignment solution focuses on computer organization and architecture, specifically addressing instruction sets, addressing modes, and memory access. It begins by determining the number of bits required for the opcode based on the given number of operations, calculating the address part for the instruction set, and finding the maximum allowable memory size. The solution then calculates the actual value loaded into the accumulator for different addressing modes, including immediate, direct, indirect, and indexed addressing. Furthermore, it analyzes memory accesses using the MARIE architecture for a given expression and optimizes memory access by utilizing registers. Finally, the assignment provides hexadecimal codes for instructions, constructs a symbol table, and determines the value of the accumulator at program termination.
Document Page
COMPUTER ORGANISATION AND ARCHITECTURE- ASSIGNMENT 2
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Contents
Q 1:
.................................................................................................................................................. 2
Q 2:
.................................................................................................................................................. 2
Q 3:
.................................................................................................................................................. 3
Q 4:
.................................................................................................................................................. 4
Document Page
Q 1:
As the information is providing in the question

The digital computer contains the memory unit which is 16 bits in every word.

The digital computer uses the instruction set which contains the 122 different types of

operations.

Solution:

a.
As the 122 different types of operations used by the instruction set. So 122 instructions
will equal to the 2
7 therefore, 7 bits will require for the opcode. We will 7 bits will take
because 2
6 will equal to 64 bits which will smaller to the 122.
b.
As the given in the question, 16 bits are used for every word. I am calculating the left
address part for the instruction set which are 16 – 7 = 9 bits.

c.
Here, as the calculation is providing the information that 9 bits are left so maximum
allowable memory size is 2
9
d.
One word memory which will accommodate by the digital computer so the largest
unsigned number is 2
16 – 1.
Q 2:

As the information is providing in the question

1.
ADD 1000
2.
Ac = 500
3.
Content of register = 200
Solution:

Here, I am calculating the actual value that will load in the accumulator for the different types f

the addressing mode.

a.
For the immediate addressing
The value at the AC + R1’s content is 1000

Thus value in (AC) accumulator = 1000 + 500

= 1500

b.
For the Direct addressing
Value at the 1000’s address is 1400

Thus value in accumulator (AC) = 1400 + 500

= 1900

c.
For the Indirect addressing
Value at the 1000’s address is 1400. So for Indirect mode, the value at the address 1400

is 1300
Document Page
So value in (AC) accumulator = 500 + 1300
= 1800

d.
For the Indexed addressing
Value at the AC + address 1200’s content is 1000

So value in (AC) accumulator = 500 + 1000

= 1500

Q 3:

As the information is providing in the question that calculates the memory accesses by using the

MARIE rule. This information is calculating for the expression which is providing in the

question.

According to the code, there will need nine (9) memory accesses so that expression can easily

execute

Code

Load A

ADD B

Store Temp1

Load C

ADD D

Store Temp2

Load Temp1

Sub Temp2

Store Sum

Code

Load R1, A

Load R2, B

ADD R1, R2

Load R3, C

Load R4, D

ADD R3, R4 (this operation doesn’t need memory access)

Sub R1, R4 (this operation doesn’t need memory access)

Store Sum
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
As the information is providing in the question that whole architecture contains the 4 registers
such as
R1, R2, R3, and R4 therefore only five (5) memory access is needed to execute the
arithmetic operation.

Q 4:

In this question, the code is given in the question. We are performing some question which is

given below.

I.
List of the hexadecimal code is given in the table for every instruction.
S. No.

1.

2.

3.

4.

5.

6.

7.

8.

9.

10.

11.

12.

Instructions

Load A

ADD B

Store D

Clear

Output

ADDI D

Store B

HALT

HEX 00FC

DEC 14

HEX 0108

HEX 0000

Hexadecimal code

1108

3109

210B

A000

6000

B10B

2109

7000

00FC

000E

0108

0000

II.
Here, I am drawing the symbol table on the basis of the label of instructions
S. No.

1.

2.

3.

4.

5.

Location

108

109

10A

10B

100

Symbol

A

B

C

D

Start
Document Page
III. Here, I am determining the value of the AC when the program will terminate form the
memory. So according to the hexadecimal code, AC will contain the 0108
chevron_up_icon
1 out of 6
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]