x CONTENTS
CHAPTER 13. GRAY CODE ................................... 311
13–1 Gray Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
13–2 Incrementing a Gray-Coded Integer . . . . . . . . . . . . . . . . . . . . 313
13–3 Negabinary Gray Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
13–4 Brief History and Applications . . . . . . . . . . . . . . . . . . . . . . . . 315
CHAPTER 14. CYCLIC REDUNDANCY CHECK .................... 319
14–1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
14–2 Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
14–3 Practice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
CHAPTER 15. ERROR CORRECTING CODES ...................... 331
15–1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
15–2 The Hamming Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
15–3 Software for SEC-DED on 32 Information Bits . . . . . . . . . . . 337
15–4 Error Correction Considered More Generally . . . . . . . . . . . . . 342
CHAPTER 16. HILBERT’S CURVE .............................. 355
16–1 A Recursive Algorithm for Generating the Hilbert Curve . . . . 356
16–2 Coordinates from Distance along the Hilbert Curve . . . . . . . . 358
16–3 Distance from Coordinates on the Hilbert Curve . . . . . . . . . . . 366
16–4 Incrementing the Coordinates on the Hilbert Curve . . . . . . . . 368
16–5 Non-Recursive Generating Algorithms . . . . . . . . . . . . . . . . . . 371
16–6 Other Space-Filling Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
16–7 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
CHAPTER 17. FLOATING-POINT ............................... 375
17–1 IEEE Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
17–2 Floating-Point To/From Integer Conversions . . . . . . . . . . . . . 377
17–3 Comparing Floating-Point Numbers Using Integer Operations 381
17–4 An Approximate Reciprocal Square Root Routine . . . . . . . . . 383
17–5 The Distribution of Leading Digits . . . . . . . . . . . . . . . . . . . . . 385
17–6 Table of Miscellaneous Values . . . . . . . . . . . . . . . . . . . . . . . . . 387
CHAPTER 18. FORMULAS FOR PRIMES ......................... 391
18–1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
18–2 Willans’s Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
18–3 Wormell’s Formula ................................. 397
18–4 Formulas for Other Difficult Functions . . . . . . . . . . . . . . . . . . 398