MARIE and ISA: An Exploration of Computer Architecture
VerifiedAdded on 2024/05/30
|11
|673
|254
AI Summary
Contribute Materials
Your contribution can guide someone’s learning journey. Share your
documents today.
ITC544
Computer Organisation and Architecture
ASSESSMENT 4
MARIE and ISA
Student Name:
Student ID:
Computer Organisation and Architecture
ASSESSMENT 4
MARIE and ISA
Student Name:
Student ID:
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
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
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
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
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
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
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
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
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
(b)
If user enters input as 17:
Figure 1: Output 1
If user enters input as 20:
Page 4 of 11
Student Name Student ID
Figure 2: Output 2
If user enters input as 4:
Page 5 of 11
Figure 2: Output 2
If user enters input as 4:
Page 5 of 11
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
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
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
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
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
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
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
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
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
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
Student Name Student ID
Appendix
Page 10 of 11
Appendix
Page 10 of 11
1 out of 11
Related Documents
Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
© 2024 | Zucol Services PVT LTD | All rights reserved.