MMIX Supplement, The: Supplement to The Art of Computer Programming Volumes 1, 2, 3 by Donald E. Knuth, 1st edition

Published by Addison-Wesley Professional (February 5, 2015) © 2015

  • Martin Ruckert

eTextbook

$27.59

  • Available for purchase from all major ebook resellers, including InformIT.com.
  • To request a review copy, click on the "Request a Review Copy" button.
$23.99

  • A print text (hardcover or paperback) 
  • Free shipping
  • Also available for purchase as an ebook from all major ebook resellers, including InformIT.com
In the first edition of Volume 1 of The Art of Computer Programming, Donald E. Knuth introduced the MIX computer and its machine language: a teaching tool that powerfully illuminated the inner workings of the algorithms he documents. Later, with the publication of his Fascicle 1, Knuth introduced MMIX: a modern, 64-bit RISC replacement to the now-obsolete MIX. Now, with Knuth’s guidance and approval, Martin Ruckert has rewritten all MIX example programs from Knuth’s Volumes 1-3 for MMIX, thus completing this MMIX update to the original classic.
Building on contributions from the international MMIXmasters volunteer group, Ruckert fully addresses MMIX basic concepts, information structures, random numbers, arithmetic, sorting, and searching. In the preparation of this supplement, about 15,000 lines of MMIX code were written and checked for correctness; over a thousand test cases were written and executed to ensure the code is of the highest possible quality.
The MMIX Supplement should be read side by side with The Art of Computer Programming, Volumes 1-3, and Knuth’s Fascicle 1, which introduces the MMIX computer, its design, and its machine language. Throughout, this supplement contains convenient page references to corresponding coverage in the original volumes. To further simplify the transition to MMIX, Ruckert stayed as close as possible to the original–preserving programming style, analysis techniques, and even wording, while highlighting differences where appropriate.

Foreword iii

Preface v

Style Guide viii

Programming Techniques xii

 

Chapter 1: Basic Concepts 1

1.3.3. Applications to Permutations 1

1.4.4. Input and Output 8

 

Chapter 2: Information Structures 15

2.1. Introduction 15

2.2.2. Sequential Allocation 17

2.2.3. Linked Allocation 18

2.2.4. Circular Lists 25

2.2.5. Doubly Linked Lists 27

2.2.6. Arrays and Orthogonal Lists 36

2.3.1. Traversing Binary Trees 37

2.3.2. Binary Tree Representation of Trees 39

2.3.3. Other Representations of Trees 43

2.3.5. Lists and Garbage Collection 44

2.5. Dynamic Storage Allocation 45

 

Chapter 3: Random Numbers 48

3.2.1.1. Choice of modulus 48

3.2.1.3. Potency 49

3.2.2. Other Methods 50

3.4.1. Numerical Distributions 51

3.6. Summary 52

 

Chapter 4: Arithmetic 53

4.1. Positional Number Systems 53

4.2.1. Single-Precision Calculations 53

4.2.2. Accuracy of Floating Point Arithmetic 58

4.2.3. Double-Precision Calculations 58

4.3.1. The Classical Algorithms 62

4.4. Radix Conversion 68

4.5.2. The Greatest Common Divisor 70

4.5.3. Analysis of Euclid’s Algorithm 71

4.5.4. Factoring into Primes 72

4.6.3. Evaluation of Powers 72

4.6.4. Evaluation of Polynomials 73

 

Chapter 5: Sorting 74

5.2. Internal Sorting 74

5.2.1. Sorting by Insertion 76

5.2.2. Sorting by Exchanging 81

5.2.3. Sorting by Selection 87

5.2.4. Sorting by Merging 89

5.2.5. Sorting by Distribution 93

5.3.1. Minimum-Comparison Sorting 94

5.5. Summary, History, and Bibliography 95

 

Chapter 6: Searching 97

6.1. Sequential Searching 97

6.2.1. Searching an Ordered Table 99

6.2.2. Binary Tree Searching 102

6.2.3. Balanced Trees 103

6.3. Digital Searching 106

6.4. Hashing 108

 

Answers to Exercises 117

1.3.2. The MMIX Assembly Language 117

1.3.3. Applications to Permutations 120

1.4.4. Input and Output 120

2.1. Introduction 122

2.2.2. Sequential Allocation 123

2.2.3. Linked Allocation 124

2.2.4. Circular Lists 128

2.2.5. Doubly Linked Lists 130

2.2.6. Arrays and Orthogonal Lists 132

2.3.1. Traversing Binary Trees 134

2.3.2. Binary Tree Representation of Trees 136

2.3.5. Lists and Garbage Collection 139

2.5. Dynamic Storage Allocation 140

3.2.1.1. Choice of modulus 147

3.2.1.3. Potency 148

3.2.2. Other Methods 148

3.4.1. Numerical Distributions 149

3.6. Summary 150

4.1. Positional Number Systems 150

4.2.1. Single-Precision Calculations 151

4.2.2. Accuracy of Floating Point Arithmetic 152

4.2.3. Double-Precision Calculations 153

4.3.1. The Classical Algorithms 156

4.4. Radix Conversion 158

4.5.2. The Greatest Common Divisor 160

4.5.3. Analysis of Euclid’s Algorithm 160

4.6.3. Evaluation of Powers 161

4.6.4. Evaluation of Polynomials 161

5. Sorting 162

5.2. Internal Sorting 162

5.2.1. Sorting by Insertion 165

5.2.2. Sorting by Exchanging 169

5.2.3. Sorting by Selection 174

5.2.4. Sorting by Merging 175

5.2.5. Sorting by Distribution 179

5.3.1. Minimum-Comparison Sorting 180

5.5. Summary, History, and Bibliography 183

6.1. Sequential Searching 183

6.2.1. Searching an Ordered Table 184

6.2.2. Binary Tree Searching 185

6.2.3. Balanced Trees 185

6.3. Digital Searching 185

6.4. Hashing 186

 

Acknowledgments 188

Index 189

Dr. Martin Ruckert maintains the MMIX home page at mmix.cs.hm.edu. He is professor of mathematics and computer science at Munich University of Applied Sciences in Munich, Germany.

Need help? Get in touch

Video
Play
Privacy and cookies
By watching, you agree Pearson can share your viewership data for marketing and analytics for one year, revocable by deleting your cookies.

Pearson eTextbook: What’s on the inside just might surprise you

They say you can’t judge a book by its cover. It’s the same with your students. Meet each one right where they are with an engaging, interactive, personalized learning experience that goes beyond the textbook to fit any schedule, any budget, and any lifestyle.