Morgan - Numerical Methods (523161)
Текст из файла
Home NextNumerical MethodsReal-Time and Embedded Systems Programming.................................Featuring in-depthcoverage of:lFixed andfloating pointmathematicaltechniqueswithout acoprocessorlNumerical I/Ofor embeddedsystemslData conversionmethodsDon MorganNumerical MethodsReal-Time and Embedded Systems ProgrammingNumerical MethodsReal-Time and Embedded Systems ProgrammingFeaturing in-depthcoverage of:lFixed andfloating pointmathematicaltechniqueswithout acoprocessorlNumerical I/Ofor embeddedsystemslData conversionmethodsDon MorganM&T BooksA Division of M&T Publishing, Inc.411 BOREL AVE.SAN MATEO, CA 94402© 1992 by M&T Publishing, Inc.Printed in the United States of AmericaAll rights reserved. No part of this book or disk may be reproduced or transmitted in any form or by anymeans, electronic or mechanical, including photocopying, recording, or by any information storage andretrieval system, without prior written permission from the Publisher.
Contact the Publisher forinformation on foreign rights.Limits of Liability and Disclaimer of WarrantyThe Author and Publisher of this book have used their best efforts in preparing the book and theprograms contained in it and on the diskette. These efforts include the development, research, andtesting of the theories and programs to determine their effectiveness.The Author and Publisher make no warranty of any kind, expressed or implied, with regard to theseprograms or the documentation contained in this book.
The Author and Publisher shall not be liable inany event for incidental or consequential damages in connection with, or arising out of, the furnishing,performance, or use of these programs.Library of Congress Cataloging-in-Publication DataMorgan, Don 1948Numerical Methods/Real-Time and Embedded Systems Programmingby Don Morganp. cm.Includes IndexISBN l-5585l-232-2 Book and Disk set2. Real-time data processing.1. Electronic digital computers—Programming.I. Title3. Embedded computer systems—Programming.QA76.6.M669 1992513.2 ' 0285—dc2091-47911CIPProject Editor: Sherri Morningstar95 94 93 92Cover Design: Lauren Smith Design4 3 2 1Trademarks: The 80386, 80486 are registered trademarks and the 8051, 8048, 8086, 8088,8OC196 and 80286 are products of Intel Corporation, Santa Clara, CA.
The Z80 is a registeredtrademark of Zilog Inc., Campbell, CA. The TMS34010 is a product of Texas Instruments, Dallas,TX. Microsoft C is a product of Microsoft Corp. Redmond, WA.AcknowledgmentThank you Anita, Donald and Rachelfor your love and forbearance.ContentsWHY THIS BOOK IS FOR YOU . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3CHAPTER 1: NUMBERS . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Systems of Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Bases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9The Radix Point, Fixed and Floating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2Types of Arithmetic . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 5Fixed Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . 1 5Floating Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 7Positive and Negative Numbers . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . 1 8Fundamental Arithmetic Principles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1Microprocessors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1Buswidth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22Data type . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 4Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . 2 4Rounding and the Sticky Bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 5Branching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
26NUMERICAL METHODSInstructions ............................................................................................. 2 6Addition ............................................................................................ 26Subtraction ........................................................................................2727Multiplication ..................................................................................Division ............................................................................................ 28Negation and Signs ............................................................................. 28Shifts, Rotates and Normalization .......................................................
29Decimal and ASCII Instructions ......................................................... 30CHAPTER 2: INTEGERS ..........................................................Addition and Subtraction .............................................................................Unsigned Addition and Subtraction ....................................................Multiprecision Arithmetic ..................................................................add64: Algorithm ...............................................................................add64: Listing .....................................................................................sub64: Algorithm ................................................................................sub64: Listing .....................................................................................Signed Addition and Subtraction ........................................................Decimal Addition and Subtraction ......................................................Multiplication and Division .........................................................................Signed vs.
Unsigned .......................................................................signed-operation: Algorithm ...............................................................signed-operation: Listing ...................................................................Binary Multiplication ..................................................................................cmul: Algorithm ................................................................................cmul: Listing ....................................................................................3333333536363737384042434445464949CONTENTSA Faster Shift and Add ................................................................................. 50515253555557cmul2: Algorithm ..............................................................................cmul2: Listing ....................................................................................Skipping Ones and Zeros .............................................................................booth: Algorithm ................................................................................booth: Listing .....................................................................................bit-pair: Algorithm .............................................................................bit-pair: Listing .................................................................................Hardware Multiplication: Single and Multiprecision .....................................mu132: Algorithm ...............................................................................mu132: Listing ....................................................................................Binary Division ...........................................................................................Error Checking ..................................................................................Software Division ........................................................................................cdiv: Algorithm ..................................................................................cdiv: Listing.
.....................................................................................Hardware Division ......................................................................................div32: Algorithm ................................................................................div32: Listing ....................................................................................div64: Algorithm ...............................................................................div64: Listing .....................................................................................5861626364646567686974757980CHAPTER 3; REAL NUMBERS ..................................................Fixed Point .................................................................................................Significant Bits ............................................................................................The Radix Point .........................................................................................Rounding ....................................................................................................Basic Fixed-Point Operations ......................................................................858687898992NUMERICAL METHODSA Routine for Drawing Circles...................................................................circle: Algorithm ..........................................................................circle: Listing ................................................................................Bresenham’s Line-Drawing Algorithm ............................................line: Algorithm .............................................................................line: Listing .......................................................................................Division by Inversion .............................................................................divnewt: Algorithm..............................................................................divnewt: Listing................................................................................Division by Multiplication..............................................................................divmul: Algorithm..............................................................................divmul: Listing...................................................................................959898100101102105108109114116117CHAPTER 4: FLOATING-POINT ARITHMETIC ........................
Характеристики
Тип файла PDF
PDF-формат наиболее широко используется для просмотра любого типа файлов на любом устройстве. В него можно сохранить документ, таблицы, презентацию, текст, чертежи, вычисления, графики и всё остальное, что можно показать на экране любого устройства. Именно его лучше всего использовать для печати.
Например, если Вам нужно распечатать чертёж из автокада, Вы сохраните чертёж на флешку, но будет ли автокад в пункте печати? А если будет, то нужная версия с нужными библиотеками? Именно для этого и нужен формат PDF - в нём точно будет показано верно вне зависимости от того, в какой программе создали PDF-файл и есть ли нужная программа для его просмотра.