Answered step by step
Verified Expert Solution
Question
1 Approved Answer
LC3 Question Problem 4 (12 points) Consider an algorithm which takes the absolute value of a 2's complement number stored in memory location 0x4022 and
LC3 Question
Problem 4 (12 points) Consider an algorithm which takes the absolute value of a 2's complement number stored in memory location 0x4022 and writes the result to the memory location 0x4023. (Note: The example, the absolute value of -5 is 5, and the absolute value of 15 is 15 itself.) We can represent the algorithm as the flowchart below by decomposing it into its basic constructs. Fill in the missing instructions for each block. (5) a. Start Yes No Halt b. Convert the above algorithm to an LC-3 program. Write the program in LC-3 binary code with comment. The program should start at memory address x3000. (Hint: use LDI and STI to access memory locations and you can store 0x4022 and 0x4023 in memory 0x3006 and 0x3007 to use) (7)
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