Start Multiplier0 = 1 1. Test Multiplier0 Multiplier0 = 0 1a. Add multiplicand to product and place the result in Product register 2. Shift the Multiplicand register left 1 bit 3. Shift the Multiplier register right 1 bit No: < 4 repetitions 4th repetition? Yes: 4 repetitions Done FIGURE 3.4 The first multiplication algorithm, using the hardware shown in Figure 3.3. If the least significant bit of the multiplier is 1, add the multiplicand to the product. If not, go to the next step. Shift the multiplicand left and the multiplier right in the next two steps. These three steps are repeated 32 times. 2. Using 4-bit numbers to save space, multiply 4 * 7, or 0100*0111. Use the algorithm outlined in the flowchart in figure 3.4 and fill in what numbers, in the table, would populate in the Multiplier, Multiplicand, and Product in each step of each iteration. Iteration Step Multiplier Multiplicand Product 0 Initial Values 0111 0000 0100 0000 0000 1a: 1->Prod=Prod+Mcand 1 2. Shift left Mcand 3. Shift right Mult 2 1a: 1->Prod=Prod+Mcand 2. Shift left Mcand 3. Shift right Mult 3 4 1a: 1->Prod=Prod+Mcand 2. Shift left Mcand 3. Shift right Mult 1a: 1->Prod=Prod+Mcand 2. Shift left Mcand 3. Shift right Mult
Added by Elizabeth H.
Close
Step 1
Step 1: Read the text carefully to ensure there are no spelling, typographical, grammatical, OCR, or mathematical errors. Show more…
Show all steps
Your feedback will help us improve your experience
Adi S and 59 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Adi S.
Akash M.
2.1 Problem Statement The numbers X and Y are found at locations x3120 and x3121, respectively. Write a program in LC-3 assembly language that does the following: Compute the difference X - Y and place it at location x3122. Place the absolute values |X| and |Y| at locations x3123 and x3124, respectively. Determine which of |X| and |Y| is larger. Place 1 at location x3125 if |X| is, a 2 if |Y| is, or a 0 if they are equal. 2.1.1 Inputs The integers X and Y are in locations x3120 and x3121, respectively: x3120: X x3121: Y 2.1.2 Outputs The outputs at their corresponding locations are as follows: x3122: X - Y x3123: |X| x3124: |Y| x3125: Z where Z is defined as: if |X| > |Y|: Z = 1 if |X| < |Y|: Z = 2 if |X| = |Y|: Z = 0 (2.1)
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD