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
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