The example on page 190 of the textbook shows the restoring division of dividing 7 by 2. Redo the same example by now dividing 15 by 2. Confirm that the quotient is 7 and the remainder is 1 at the end of the algorithm's execution.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

The example on page 190 of the textbook shows the restoring division of dividing 7 by 2. Redo the same example by now dividing 15 by 2. Confirm that the quotient is 7 and the remainder is 1 at the end of the algorithm's execution.

Write down the answer similar to the table in Figure 3.10 page 192 of the textbook.

A Divide Algorithm
EXAMPLE
Using a 4-bit version of the algorithm to save pages, leť's try dividing 7 by2.
or 0000 0111 by 0010,
ten
two
two
Figure 3.10 shows the value of each register for each of the steps, with the
quotient being 3 and the remainder 1 Notice that the test in step 2 of whether
the remainder is positive or negative simply tests whether the sign bit of the
Remainder register is a 0 or 1. The surprising requirement of this algorithm s
that it takes n +1 steps to get the proper quotient and remainder.
ANSWER
ten
ten
Transcribed Image Text:A Divide Algorithm EXAMPLE Using a 4-bit version of the algorithm to save pages, leť's try dividing 7 by2. or 0000 0111 by 0010, ten two two Figure 3.10 shows the value of each register for each of the steps, with the quotient being 3 and the remainder 1 Notice that the test in step 2 of whether the remainder is positive or negative simply tests whether the sign bit of the Remainder register is a 0 or 1. The surprising requirement of this algorithm s that it takes n +1 steps to get the proper quotient and remainder. ANSWER ten ten
F9
F10
F11
E12
PrtSca
Chapter 3 Arithmetic for Computers
Divisor
Remainder
Quotient
00000111
0110 0111
to 000111
Step
0010 0000
Iteration
to 00
0010 0000
Initial values
0000
0.
0010 0000
1: Rem = Rem - Div
%3D
0000
2b: Rem < 0 +Div, sll Q, QO = 0
3: Shift Div right
to01 0000
t0000111
to00
111 0111
to 000111
0001 0000
to 00
1: Rem = Rem - Div
t001 0000
%3D
to 00
2b: Rem < 0 +Div, sll Q, Q0 = 0
3: Shift Div right
to 00 1000
00000111
to 00
to 00
to 00 1000
0111 1111
1: Rem = Rem - Div
to00 1000
to00 0111
to 00
2b: Rem < 0= +Div, sll Q, Q0 = 0
3: Shift Div right
%3D
to 00
to 000100
to 000111
to 00
to000100
O000 0011
1: Rem
Rem - Div
%3D
t001
to00 0100
to000011
2a: Rem 20 = sll Q, Q0 = 1
3: Shift Div right
4
to 000010
to 000010
0o 000011
O000 0001
t001
t001
1: Rem
= Rem- Div
0011
to000010
to000001
2a: Rem 20 = sll Q, Q0 = 1
3: Shift Div right
0011
to 000001
to000001
IGURE 3.10 Division example using the algorithm in Figure 3.9. The bit examined to determine
e next step is circled in color.
1.
2.
3.
Transcribed Image Text:F9 F10 F11 E12 PrtSca Chapter 3 Arithmetic for Computers Divisor Remainder Quotient 00000111 0110 0111 to 000111 Step 0010 0000 Iteration to 00 0010 0000 Initial values 0000 0. 0010 0000 1: Rem = Rem - Div %3D 0000 2b: Rem < 0 +Div, sll Q, QO = 0 3: Shift Div right to01 0000 t0000111 to00 111 0111 to 000111 0001 0000 to 00 1: Rem = Rem - Div t001 0000 %3D to 00 2b: Rem < 0 +Div, sll Q, Q0 = 0 3: Shift Div right to 00 1000 00000111 to 00 to 00 to 00 1000 0111 1111 1: Rem = Rem - Div to00 1000 to00 0111 to 00 2b: Rem < 0= +Div, sll Q, Q0 = 0 3: Shift Div right %3D to 00 to 000100 to 000111 to 00 to000100 O000 0011 1: Rem Rem - Div %3D t001 to00 0100 to000011 2a: Rem 20 = sll Q, Q0 = 1 3: Shift Div right 4 to 000010 to 000010 0o 000011 O000 0001 t001 t001 1: Rem = Rem- Div 0011 to000010 to000001 2a: Rem 20 = sll Q, Q0 = 1 3: Shift Div right 0011 to 000001 to000001 IGURE 3.10 Division example using the algorithm in Figure 3.9. The bit examined to determine e next step is circled in color. 1. 2. 3.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Asymptotic Analysis
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education