ITC544 Assignment 2 Solution - Computer Architecture and Instructions

Verified

Added on  2021/05/31

|8
|280
|34
Homework Assignment
AI Summary
This assignment solution for ITC544 covers key concepts in computer architecture and instruction sets. The solution addresses questions related to MARIE, ISA instructions, and addressing modes. It includes analysis of instruction formats, calculations of memory usage, and conversion of expressions into different addressing code formats (3-address, 2-address, 1-address, and 0-address). The document also examines the limitations of a machine and the error values it generates. The assignment is a valuable resource for students studying computer architecture and related topics, providing detailed explanations and solutions to help understand the concepts of computer organization and assembly language programming.
Document Page
MARIE and ISA Page 0 of 8
Assignment 2: MARIE and ISA
Name of Student
Student ID
Subject Code (ITC544)
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
MARIE and ISA Page 1 of 8
Table of Contents
Answer to question 1.......................................................................................................................2
Answer to question 2.......................................................................................................................4
Answer to question 3.......................................................................................................................5
Document Page
MARIE and ISA Page 2 of 8
Input: 21
Output: 10946
a.
Input: 22
Document Page
MARIE and ISA Page 3 of 8
Output:
Input: 23
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
MARIE and ISA Page 4 of 8
Output:
Input: 24
Document Page
MARIE and ISA Page 5 of 8
Output: -19168
Machine displayed the error value at 24. Since 23 is the threshold value of
machine due to which at 24, it displayed the error value. Therefore, if the value of n= 23
it is considered as maximum number to provide correct result.
Answer to question number 2
Number of possible instructions is 2^11=2048
Given that the size of the address field is 4.
Number of 2-addressing instruction = 6×2^4 ×2^4 =1536
Number of 1-addressing instruction = 30×2^4 =480
Number of accommodations left = 2048 – 2016 = 32
Document Page
MARIE and ISA Page 6 of 8
Answer to question number 3
Given expression, A = (B+C)*(D-E)
3 addressing code for the expression is
ADD R1, B, C
SUB R2, D, E
MUL A, R1, R2
2 addressing code for the expression is
LOAD R1, B
ADD R1, C
LOAD R2, D
SUB R2, E
MUL R2, R1
STORE A, R2
1 addressing code for the expression is
LOAD B
ADD C
STORE T
Load D
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
MARIE and ISA Page 7 of 8
SUB E
MUL T
STORE A
0 addressing code for the expression is
PUSH B
PUSH C
ADD
PUSH D
PUSH E
SUB
MUL
Store A
chevron_up_icon
1 out of 8
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]