Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Task Instructions 1 . Consider the following assembly code given in Figure 1 that adds numbers 1 0 0 - 1 2 0 ( inclusive
Task Instructions
Consider the following assembly code given in Figure that adds numbers inclusive and stores the final sum in register R
Consider the iterations where i is equal to at the beginning of the loop.
Firstly, draw the symbol table for the program with the relevant memory locations allocated for the predefined symbols, labels and variables.
Next, for each instruction, fill in the given table for each explaining the values in each component. You have to do this for iteration
Your explanation within the table will include which instruction is fetched, the values in the different registers and ALU operation, how the PC value is determined line numbers are given next to each instruction and also what buses are involved. An example is given below for your reference Complete this description for the highlighted lines of code only.
Upload the pdf document to OnTrack.
Assembly code
Calculates the sum of numbers to and stores the result in R
Initializing the variables # @
# DA
# @i
# MD value is stored in RAM # @
# DA
# @n
# MD value is stored in RAM # @sum
# Mvalue is stored in RAM
The loop that calculates the sum LOOPbeginning of the loop # @i
# DM
# @n
# DDM
# @STOPLOOP
# D;JGT if I n goto STOPLOOP # @i
# DM
# @sum
# MMD sum sum i # @i
# MMi i # @LOOP
#;JMP STOPLOOP
# @sum
# DM
# @R
# MD RAM sum END
# @END
#;JMP
Iteration :
Example:
@i
PC
output ROM ip ROM
op Value stored in A
register ALU Value stored in D
register RAM
ip or
op PC
value
Bus: Address
bus
Bus: Address
bus @i NA NA NA
Bus: Control
bus
DM
PC
output ROM ip ROM op Value stored in A regist er ALU Valu e stor ed in D regi
ster RAM ip or op PC value
Bus: Address bus
Bus: Address bus D M
Bus: Control bus NA Assigns the value from RAM
to the D register
Bus: Data bus
Bus: Data bus Output form RAM
is output and send as input to the ALU.
Bus:
Data bus
Bus: Control bus
Follow the examples given above for the rest of the instructions:
@n
PC
output ROM
ip ROM
op Value stored in A
register ALU Value stored in D
register RAM
ip or op PC
value
DDM
PC
output ROM
ip ROM
op Value stored ALU Value stored RAM
ip or
op PC
value
in A
register in D
register
@STOPLOOP
PC
output ROM
ip ROM
op Value stored in A
register ALU Value stored in D
register RAM
ip or op PC
value
D;JGT if I n goto STOPLOOP
PC
output ROM
ip ROM
op Value stored in A
register ALU Value stored in D
register RAM
ip or op PC
value
@i
PC
output ROM
ip ROM
op Value stored in A
register ALU Value stored in D
register RAM
ip or op PC
value
DM
PC
output ROM
ip ROM
op Value stored in A
register ALU Value stored in D
register RAM
ip or op PC
value
@sum
PC
output ROM
ip ROM
op Value stored in A
register ALU Value stored in D
register RAM
ip or op PC
value
MMD sum sum i
PC
output ROM
ip ROM
op Value stored in A
register ALU Value stored in D
register RAM
ip or op PC
value
@i
PC
output ROM
ip ROM
op Value stored in A
register ALU Value stored in D
register RAM
ip or op PC
value
MMi i
PC
output ROM
ip ROM
op Value stored in A
register ALU Value stored in D
register RAM
ip or op PC
value
@LOOP
PC
output ROM
ip ROM
op Value stored in A
register ALU Value stored in D
register RAM
ip or op PC
value
;JMP
PC
output ROM
ip ROM
op Value stored in A
register ALU Value stored in D
register RAM
ip or op PC
value
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started