Booths Multe Du
Booths Multe Du
net/publication/262177138
CITATIONS READS
3 632
3 authors, including:
All content following this page was uploaded by Chris Jenkins on 04 May 2020.
MULTIPLICATION ALGORITHM*
ABSTRACT
We have developed a free online module for the self-study of Booth's
multiplication algorithm. This module includes an algorithm visualization tool
that displays both the pseudo-code and the contents of hardware registers
during execution. This tool accepts user-generated inputs, randomly generates
questions to foster active learning and comes with a user guide and a
standalone hyper-textbook chapter that explains the algorithm, justifies it
mathematically and includes exercises that are integrated with our
visualization tool. Student grades and feedback suggest that this module is an
effective platform for self-study.
1 INTRODUCTION
Since "[a] professional in any field of computing should not regard the computer as
just a black box that executes programs by magic[, a]ll students of computing should
acquire some understanding and appreciation of a computer system's functional
components" [1]. Therefore, virtually all computer science curricula include at least one
course on computer architecture, covering a wide range of topics from data representation
to multiprocessing. Given the increasing importance of recent architectural trends, such
as multiprocessing and distributed architectures, instructors end up having to make tough
decisions about topic coverage. To make room for these high-level architectural trends,
___________________________________________
*
Copyright © 2012 by the Consortium for Computing Sciences in Colleges. Permission to copy
without fee all or part of this material is granted provided that the copies are not made or
distributed for direct commercial advantage, the CCSC copyright notice and the title of the
publication and its date appear, and notice is given that copying is by permission of the
Consortium for Computing Sciences in Colleges. To copy otherwise, or to republish, requires a
fee and/or specific permission.
54
CCSC: South Central Conference
2 RELATED WORK
Booth's multiplication algorithm is still covered or at least mentioned in several
textbooks [e.g., 5,8,10]. The most common approach to teaching Booth's algorithm uses
pseudo-code or a flowchart as well as one or more traces of it on canned inputs. Some
presentations justify mathematically why the algorithm works for both positive and
negative numbers. Some include a description of "Booth recoding," which is a way to
rewrite the multiplier to reformulate the multiplication as a sequence of additions and
subtractions. While a discussion of Booth recoding is not strictly necessary to explain the
algorithm, our module not only discusses it, but also includes pseudo-code and a
mathematical justification for the algorithm's correctness and performance characteristics.
The next two sections provide more details on the algorithm.
The main shortcoming of standard textbooks is their static nature. Since they only
contain canned contents, they do not naturally support hands-on, interactive learning.
Once the student has read the pseudo-code and included example(s), textbooks do not
have any affordances for additional practice or active self-study. In contrast, our module
enables students to trace through an arbitrarily large number of examples with
randomized or user-selected input values and register sizes. The tracing of the algorithm
is step-by-step, interactive, with the possibility to move both forward and backward
through the trace. Randomized stop-and-think questions pop up to promote active
55
JCSC 27, 4 (April 2012)
learning. The use of algorithm visualization also aims to foster learning in visual thinkers.
The only other publicly available visualization of Booth's algorithm we found is a
JavaScript simulator that, like our module, allows the learner to pick the two numbers to
multiply, in either binary or decimal format [5]. However, this simulator is not interactive
after the data entry stage. In fact, it produces the whole trace in one shot (no animation).
Unlike our module, this simulator does not include pop-up questions or exercises. On the
other hand, the web site associated with the textbook (see [5]) includes simulations for
other arithmetic algorithms, which our module does not yet.
The Algorithm Visualization Portal [2] does not include any visualization of Booth's
algorithm. However, our literature search yielded two relevant papers. Garzón et al.
describe an approach to teaching computer architecture that includes "carefully designed
practical exercises […] supported by an auxiliary computer-based environment" [4],
which, to the best of our knowledge, are not publicly available. Finally, Thiebaut
describes an architecture course in which students must build animations of algorithms,
including Booth's [12]. His practice is the opposite of ours since class time is devoted to
GUI programming and teaching the API to Trolltech's Qt GUI software toolkit before
getting to the architecture topics proper. While the activity of building (as opposed to
using) algorithm visualizations promotes a higher level of student engagement [7], the
class time devoted to non-architectural topics makes it, in our opinion, less viable, given
the recent trends described earlier.
56
CCSC: South Central Conference
they can only do by tracing the algorithm. In contrast, the last kind of exercises ask
students to input two numbers whose multiplication will exhibit the worst run time of
Booth's algorithm. These exercises target a deeper level of understanding, beyond the
tracing of the algorithm. Indeed, students are responsible for inferring that replacing a
series of additions corresponding to a series of consecutive ones in the multiplier only
speeds up the algorithm when the series of ones is long enough. What is common to all
exercises is that the size of the registers is randomly generated, as are all of the initial
numbers provided to students. More importantly, the exercises are fully integrated with
our visualization tool: after students have entered their numerical answers, our
visualization tool traces the algorithm based on them and identifies any errors students
may have made at the time when these errors come up in the trace.
57
JCSC 27, 4 (April 2012)
58
CCSC: South Central Conference
59
JCSC 27, 4 (April 2012)
P B1 B2
Minimum score / #students 6/1 6/3 6/3
Maximum score / 10 / 4 10 / 8 10 / 6
#students
Average score 8.44 8.50 8.39
(Standard deviation) (1.21) (1.54) (1.64)
Table 1: Quiz results
taken right after B1, first asked students to compare the run time performance of both the
paper-and-pencil and Booth's algorithms in terms of the number of primitive operations
executed when run on three different input pairs. Then, the second half of quiz B2 asked
students to produce the only input numbers that would exhibit the best and worst
performances by Booth's algorithm. Table 1 reports the minimum, maximum and average
scores for all three quizzes (sample size of 18) out of a maximum possible score of 10.
The first observation is that the average quiz scores are rather close, even though quiz P
was taken after a lecture on the topic, while the preparation for quizzes B1 and B2 was
through self-study exclusively. However, both the variance and number of students who
received the minimum and maximum scores are larger for both quizzes on Booth's
algorithm. We conjecture that self-study, in this case, accentuated individual differences
in motivation, perseverance and time on task. We also observe that more students earned
a maximum score on B1 and B2 than on quiz P. This is surprising to us, since quiz B2
assessed a much deeper understanding of the algorithm, namely prediction of overall
performance without tracing, compared to quizzes P and B1, both of which required
mechanical tracing of the execution. We believe that a significant number of our students
60
CCSC: South Central Conference
7 REFERENCES
1. ACM/IEEE Interim Review Task Force, Computer Science Curriculum 2008: An
Interim Revision of CS 2001,
http://www.acm.org/education/curricula-recommendations, 2008
2. The algorithm visualization portal, http://algoviz.org/.
3. Booth, A., A signed binary multiplication technique, The Quarterly Journal of
Mechanics and Applied Mathematics, IV, (2), 236-240, 1951.
4. Garzón, E., García, I., Fernández, J., An approach to teaching computer
arithmetic, International Meeting on High Performance Computing for
Computational Science, 2002.
5. Koren, I, Computer Arithmetic Algorithms, 2nd Edition, A. K. Peters, 2002.
6. Naps, T., Rößling, G., JHAVE -- More visualizers (and visualizations) needed,
Electronic Notes in Theoretical Computer Science (ENTCS), 178, 33-41, 2007.
7. Naps, G., Rößling, G., Almstrum, V., Dann, W., Fleischer, R., Hundhausen, C.,
Korhonen, A., Malmi, L., McNally, M., Rodger, S., Velázquez-Iturbide, J.,
Exploring the role of visualization and engagement in computer science
education, ACM SIGCSE Bulletin, 35, (2), 2003.
8. Null, L., Lobur, J., The Essentials of Computer Organization and Architecture,
3rd Edition, Jones & Bartlett Learning, 2012.
9. Patterson, D., Hennessy, J., Computer Organization and Design, 2nd 3rd and 4th
Editions, Morgan Kaufmann, 1998, 2005, and 2009.
10. Stallings, W., Computer Organization and Architecture, 8th Edition, Prentice
Hall, 2010.
61
JCSC 27, 4 (April 2012)
8 ACKNOWLEDGEMENTS
This research was funded by an NSF REU grant (award #0851569).
62