Question
Perform the following arithmetic and logical operations on the following after converting them into binary. Please show all steps. For multiplication, show the steps that
Perform the following arithmetic and logical operations on the following after converting them into binary. Please show all steps. For multiplication, show the steps that the multiplier will take according to method discussed in class (also found in slides shared in contents). Please use 16 bit representation. Do not put spaces in the binary numbers.
1- mul(8, 7) [md = 8, mr = 7]
2- mul(10, 10) [md = 10, mr = 10]
by using this method (instead of using md =2 and mr = 3 use (8, 7) first and then do (10, 10))
int md = 2; //multiplicand int mr = 3; //multiplier int pd = 0; // product while (mr > 0) { mr = mr >> 1; //value falls into carry c if(c == 1) { pd = pd + md } md = md << 1; }
If we create a table of each step, it would look like following (after each loop iteration):
md mr c pd 10 11 0 0 100 1 1 10 1000 0 1 110
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