ITC544 Computer Organisation and Architecture: MARIE, ISA Assignment

Verified

Added on  2024/05/29

|10
|564
|271
Homework Assignment
AI Summary
This document presents a solution to an assignment focusing on MARIE assembly language and Instruction Set Architecture (ISA) within the context of computer organization. The solution includes a Fibonacci sequence program written in MARIE assembly, along with outputs for specific input values (7, 15, and 20). It also addresses questions regarding address fields in instructions and provides code representations of an equation (A = (B + C) * (D – E)) using 0-address, 1-address, 2-address, and 3-address code formats. The assignment solution provides insights into assembly language programming, memory addressing, and different instruction set architectures. Desklib provides students access to solved assignments and resources.
Document Page
Mohammed Ikram Ullah Khan 11644124
ITC544
Computer Organisation and
Architecture
ASSESSMENT 4
MARIE and ISA
Student Name: Mohammed Ikram Ullah Khan
Student ID: 11644124
Page 1 of 10
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Mohammed Ikram Ullah Khan 11644124
Contents
Task 1.........................................................................................................................................3
(a)...........................................................................................................................................3
(b)...........................................................................................................................................4
Task 2.........................................................................................................................................7
Task 3.........................................................................................................................................8
Appendix..................................................................................................................................10
List of Figures
Figure 1: Output when input=7..................................................................................................4
Figure 2: Output when input=15................................................................................................5
Figure 3: Output when input=20................................................................................................6
Page 2 of 10
Document Page
Mohammed Ikram Ullah Khan 11644124
Task 1
(a)
Program of Fibonacci:
ORG 000
INPUT USER /User enter Value of N
SUBT TWO /Deduct 2
PRINT, STORE Z /Inside Z, it is fill with values of AC
CLEAR /AC=0
ADD I1 /I1 is added to AC
ADD I2 /I1 is added to AC
STORE TOTAL /Total value is been stored
LOAD I2 /I2 is loaded with AC
STORE I1 /I1 is been stored with AC
LOAD TOTAL /TOTAL is been loaded values of AC
STORE I2 /AC is is going to fill with I2
LOAD Z /Accumulator is loaded with Z
SUBT ONE /1 is deducted from this
SKIPCOND 000 /As soon as AC<0, 000 is skipped
JUMP PRINT /Loop has been jumped
LOAD TOTAL /AC is been loaded values of Total
OUTPUT /Print Output
HALT /stop program
I1, DEC 0
I2, DEC 1
Page 3 of 10
Document Page
Mohammed Ikram Ullah Khan 11644124
ONE, DEC 1
TWO, DEC 2
USER, DEC 0
Z, DEC 0
TOTAL, DEC 0
(b)
Output when input=7
Figure 1: Output when input=7
Output when input=15
Page 4 of 10
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Mohammed Ikram Ullah Khan 11644124
Figure 2: Output when input=15
Output when input=20
Page 5 of 10
Document Page
Mohammed Ikram Ullah Khan 11644124
Figure 3: Output when input=20
I think 2147483647 is the extreme value upto which the program can give correct values.
Because Fibonacci can resolve up to [(2^31)-1].
Page 6 of 10
Document Page
Mohammed Ikram Ullah Khan 11644124
Task 2
According to given question,
Address fields are 4
Therefore,
2 address instruction= 6 x 24 x 24 = 1536
And, 1 instruction address= 30*24 = 480
Also 211 instructions are there. So it is going to be 2048 instructions.
So 0 address are = (2048) - (1536+480)
=32
Page 7 of 10
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
Mohammed Ikram Ullah Khan 11644124
Task 3
Equation as per question:
A= (B + C) * (D – E)
The above equation can be represented in terms of code:
0-address code
push B
push C
add
pop A
push D
push E
sub
push A
mpy
pop A
1-Address code
lda B
add C
sta A
lda D
sub E
mpy A
sta A
2-Address Code
Page 8 of 10
Document Page
Mohammed Ikram Ullah Khan 11644124
load A, B
add A, C
load X, D
sub X, E
mpy A, X
3-Address code
add A,B,C
sub X,D,E
mpy A, A, X
Page 9 of 10
Document Page
Mohammed Ikram Ullah Khan 11644124
Appendix
Page 10 of 10
chevron_up_icon
1 out of 10
circle_padding
hide_on_mobile
zoom_out_icon
logo.png

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]