Unformatted text preview: stores the binary representation of a negative number with the bits inverted. Two’s compliment is the same, except that a negative number has its bits inverted and then one is added (for reasons of ef f ciency in hardware implementation). This representation is the physical implementation of an ADT de f ned by the normal arithmetic operations, declarations, and other support given by the programming language for integers. 1.6 An ADT for twodimensional arrays might look as follows. Matrix add(Matrix M1, Matrix M2); Matrix multiply(Matrix M1, Matrix M2); Matrix transpose(Matrix M1); void setvalue(Matrix M1, int row, int col, int val); int getvalue(Matrix M1, int row, int col); List getrow(Matrix M1, int row);...
View
Full Document
 Fall '08
 BELL,D
 Negative and nonnegative numbers, Void type, Matrix m2

Click to edit the document details