ITC544 Assignment 2: Exploring MARIE & ISA Architecture Concepts

Verified

Added on  2023/06/05

|4
|565
|123
Homework Assignment
AI Summary
This document presents a comprehensive solution to Assignment 2 for ITC544, covering MARIE and ISA architecture. The solution addresses several key areas, including calculating the number of bits required for opcodes and addresses, determining the maximum memory size, and identifying the largest unsigned binary number that can be accommodated in memory. The assignment explores different addressing modes like immediate, direct, indirect, and indexed, calculating the effective addresses in each case. It also provides assembly code solutions for arithmetic expressions, demonstrating efficient memory access optimization. Furthermore, the solution offers a detailed explanation of MARIE instructions, including their hexadecimal codes, descriptions, and functionalities, such as load, store, add, subtract, input, output, and conditional skips. The final part of the solution includes the hexadecimal code, memory locations, and assembly instructions for a sample program, along with the value stored in the accumulator upon program termination.
Document Page
Page 1 of 4
Full Name
Student ID No.
ITC544
Assignment 2: MARIE & ISA
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
Page 2 of 4
Question 1
1. 122 different opcodes cater for 122 different operations .
2x=122, x= log 122
log 2
¿ 6.93
Sinceisnot practically convenient deal with decimal bits , we round off the answer .
Thus x=7 Therefore the number bits needed for the opcode=7 bits
2. T he number of bits ¿ Total Number of bits−The number used for opcodes
¿ 16−6.93
¿ 9.07
≈ 9
Hence the number of bits ¿ the address part if the instruction is9.
3. T he maximum allowable ¿ memory =29
¿ 512 Bytes
4. The largest unsigned binary number that can be accomodated∈one word of memory
¿ 216
¿ 65536
Thus 65536 is the largest unsigned binary number that can be accommodated∈one word memory .
Question 2
Given that theaccumulator ( AC )=500 ,
1. Immediate=1000+500=1500
2. Direct =1400+500=1900
3. Indirect=1300+500=1800
4. Indexed =1000+500=1500
Question 3
Using the arithmetic expression S=(A+B)-(C+D)
Load A
Add B
Store Temp1
Load C
Add D
Store Temp2
Load Temp1
Document Page
Page 3 of 4
Subt Temp2
Store Sum /Total of nine memory accesses; given that we execute C+D first, the process can
be carried out with 7 memory accesses.
Given that the processor has more than three registers:
Load R1, A
Load R2, B
Add R1, R2
Load R3, C
Load R4, D
Add R3, R4 // the operation does not required memory access
Subt R1, R4 //The operation does not required memory access
Store Sum // total of five memory accesses.
Question 4
Mnemonic Hex Description
0 JnS X Store the PC address X and jump X+1
1 Load X Load Contents of address X into AC
2 Store X Store the content of AC at address X
3 Add X Add the content of address X to AC
4 Subt X Subtract the content of address X from AC
5 Input Input a value from the keyboard into AC
6 Output Output the value in AC to the display
7 Halt Terminate program
8 Skipcond Skip next instruction on Condition
9 Jump X Load the value of X into PC
A Clear Put all zeros in AC
B Addl X
Use the value of X as true address of the data operand to add to
AC Indirect
C Jumpl X Use the value at X as the address to jump to
D Loadl X Use the value at X as the address of the value to the Load
IndirectE Storel X Use the value at X as the address of the location of storing value
Document Page
Page 4 of 4
a)
Hexadecimal
Code
100 Start LOAD A 1108
101 ADD B 3109
102 STORE D 210B
103 CLEAR A000
104
OUTPU
T 6000
105 ADDl D B10B
106 STORE B 2109
107 HALT 7000
108 A, HEX 00FC 00FC
109 B, DEC 14 000E
10A C, HEX 108 108
10B D, HEX 0000 0000
b)
Symbol
Locatio
n
A 108
B 109
C 10A
D 10B
Start 100
c) The value stored in the ANC when the program terminates is 0108.
chevron_up_icon
1 out of 4
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]