Hacker's Delight. hardcover xiv, 306 p.
Warren, Henry S., Jr. 著
内容
目次
Preface. 1. Introduction. Notation. Instruction Set and ExecutionTime Model. 2. Basis. Manipulating Rightmost Bits. Addition Combined withLogical Operations. Inequalities among Logical and Arithmetic Expressions.Absolute Value Function. Sign Extension. Shift Right Signed from Unsigned.Sign Function. Three-Valued Compare. Transfer of Sign. Decoding a "ZeroMeans 2**n" Field. Comparison Predicates. Overflow Detection. ConditionCode Result of Add, Subtract, and Multiply. Rotate Shifts. Double-LengthAdd/Subtract. Double-Length Shifts. Multibyte Add, Subtract, AbsoluteValue. Doz, Max, Min. Exchanging Registers. Alternating among Two or MoreValues. 3. Power-of-2 Boundaries. Rounding Up/Down to a Multiple of a KnownPower of 2. Rounding Up/Down to the Next Power of 2. Detecting a Power-of-2Boundary Crossing. 4. Arithmetic Bounds. Checking Bounds of Integers.Propagating Bounds through Adds and Subtracts. Propagating Bounds throughLogical Operations. Signed Bounds. 5. Counting Bits. Counting 1-bits.Parity. Counting Leading 0's. Counting Trailing 0's. 6. Searching Words.Find First 0-Byte. Find First String of 1-Bits of a Given Length. 7.Rearranging Bits and Bytes. Reversing Bits and Bytes. Shuffling Bits.Transposing a Bit Matrix. Compress, or Generalized Extract. GeneralPermutations, Sheep and Goats Operation. Rearrangements and IndexTransformations. 8. Multiplication. Multiword Multiplication. High-OrderHalf of 64-Bit Product. High-Order Product Signed from/to Unsigned.Multiplication by Constants. 9. Integer Division. Preliminaries. MultiwordDivision. Unsigned Short Division from Signed Division. Unsigned LongDivision. 10. Integer Division by Constants. Signed Division by a KnownPower of 2. Signed Remainder from Division by a Known Power of 2. SignedDivision and Remainder by Non-powers of 2. Signed Division by Divisors >= 2.Signed Division by Divisors #= -2. Incorporation into a Compiler.Miscellaneous Topics. Unsigned Division. Unsigned Division by Divisors >=1. Incorporation into a Compiler (Unsigned). Miscellaneous Topics(Unsigned). Applicability to Modulus and Floor Division. Similar Methods.Sample Magic Numbers. Exact Division by Constants. Test for Zero Remainderafter Division by a Constant. 11. Some Elementary Functions. Integer SquareRoot. Integer Cube Root. Integer Exponentiation. Integer Logarithm. 12.Unusual Bases for Number Systems. Base -2. Base -1 + i. Other Bases. Whatis the Most Efficient Base? 13. Gray Code. Gray Code. Incrementing a GrayCoded Integer. Negabinary Gray Code. Brief History and Applications. 14.Hilbert's Curve. A Recursive Algorithm for Generating the Hilbert Curve.Coordinates from Distance along the Hilbert Curve. Distance from Coordinateson the Hilbert Curve. Incrementing the Coordinates on the Hilbert Curve.Non-recursive Generating Algorithms. Other Space-Filling Curves.Applications. 15. Floating-Point. IEEE Format. Comparing Floating-PointNumbers Using Integer Operations. The Distribution of Leading Digits. Tableof Miscellaneous Values. 16. Formulas for Primes. Introduction. Willans'sFormulas. Wormell's Formula. Formulas for Other Difficult Functions.Appendix A. Arithmetic Tables for a 4-Bit Machine. Appendix B. Newton'sMethod. Bibliography. Index. 0201914654T08282002
カート
カートに商品は入っていません。