Question: For each remaining problem, (1) draw a flowchart, and (2) write a sequence of LC-3 instructions. All tasks can be done using only ADD, AND,
For each remaining problem, (1) draw a flowchart, and (2) write a sequence of LC-3 instructions. All tasks can be done using only ADD, AND, NOT, and BR instructions. Include comments explaining each instruction.
A. Find the maximum of the values in R0 and R1, and write it into R2. Do not change R0 or R1. (NOTES: To compare two numbers, subtract one from the other and see if the result is negative, zero, or positive. To subtract, add the negative of the second number. To create the negative of a number, flip the bits and add +1.)
B.
Shift the value in R0 to the left by n bits, where n is the value stored in R1. Assume that n is a value between 0 and 15. (NOTE: To shift a value to the left by one bit, add the value to itself.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
