ITC544 Computer Organisation and Architecture: MARIE and ISA Analysis

Verified

Added on  2024/05/30

|11
|673
|254
Homework Assignment
AI Summary
This assignment solution for ITC544 Computer Organisation and Architecture focuses on the MARIE simulator and Instruction Set Architecture (ISA). It includes a program to generate Fibonacci numbers using the MARIE simulator, along with test results for various user inputs, demonstrating the program's functionality and limitations. The solution also addresses questions related to instruction formats, calculating the number of possible zero-address instructions based on given instruction and address field sizes. Furthermore, it provides code snippets for evaluating an arithmetic expression using different addressing schemes: 0-address (stack-based), 1-address (accumulator-based), 2-address, and 3-address instructions. Desklib provides a platform for students to access such solved assignments and study resources.
Document Page
ITC544
Computer Organisation and Architecture
ASSESSMENT 4
MARIE and ISA
Student Name:
Student ID:
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
Student Name Student ID
Contents
Task 1.........................................................................................................................................2
(a)...........................................................................................................................................2
(b)...........................................................................................................................................4
Task 2.........................................................................................................................................7
Task 3.........................................................................................................................................8
Appendix..................................................................................................................................10
List of Figures
Figure 1: Output 1......................................................................................................................4
Figure 2: Output 2......................................................................................................................5
Figure 3: Output 3......................................................................................................................6
Page 1 of 11
Document Page
Student Name Student ID
Task 1
(a)
Program of Fibonacci number using MARIE simulator is shown below:
ORG 000
INPUT USER /Value from user is going to be taken through this
SUBT TWO /2 is going to be subtracted from here
PRINT, STORE Z /All the value of Z is going to be stored in AC
CLEAR /Through this, the value stored in the AC is going to be zero
ADD N1 /In AC, N1 is going to be added
ADD N2 /In AC, N2 is going to be added
STORE TOTAL /Through this total values are going to be stored
LOAD N2 /Value of N2 is going to be stored in AC
STORE N1 /values are going to be stored in N1
LOAD TOTAL /Now in AC value of total is going to be stored
STORE N2 /Now, N2 is going to be stored in AC
LOAD Z /All the values of Z are going to be stored in AC
SUBT ONE /1 is going to be subtracted from this
Page 2 of 11
Document Page
Student Name Student ID
SKIPCOND 000 /If AC<0 then skip condition of 000
JUMP PRINT /Through this loop is going to be printed
LOAD TOTAL /In AC total is going to be added
OUTPUT /Output is going to be displayed through this
HALT /Process is going to be halted
/INITILIZATIONS
N1, DEC 0
N2, DEC 1
ONE, DEC 1
TWO, DEC 2
USER, DEC 0
Z, DEC 0
TOTAL, DEC 0
Page 3 of 11
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
Student Name Student ID
(b)
If user enters input as 17:
Figure 1: Output 1
If user enters input as 20:
Page 4 of 11
Document Page
Student Name Student ID
Figure 2: Output 2
If user enters input as 4:
Page 5 of 11
Document Page
Student Name Student ID
Figure 3: Output 3
The maximum value up to which this program run correct value is 2147483647. This is due
to the fact that Fibonacci runs up to (2^31-1).
Page 6 of 11
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
Student Name Student ID
Task 2
As per given case scenario, size of instruction is 11 bits, therefore,
Total number of instruction can be= 211 = 2048
Also the size of address field as per scenario = 4 bits
So the instructions having a number of 2 address = 6*24*24
= 6*16*16
= 1536
And the address associated with 1 instruction= 30*24
= 30*16
= 480
As a result, number of 0 addresses that are possible = (2048) - (1536+480)
= (2048) – (2016)
= 32
Page 7 of 11
Document Page
Student Name Student ID
Task 3
As, A= (B + C) * (D – E)
Code for 0 address
push B
push C
add
pop A
push D
push E
sub
push A
mpy
pop A
Code for 1 address
lda B
add C
sta A
lda D
sub E
mpy A
sta A
Code for 2 address
load A, B
add A, C
Page 8 of 11
Document Page
Student Name Student ID
load X, D
sub X, E
mpy A, X
Code for 3 address
add A,B,C
sub X,D,E
mpy A, A, X
Page 9 of 11
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
Student Name Student ID
Appendix
Page 10 of 11
chevron_up_icon
1 out of 11
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]