To see what this number is a negative of, we reverse the sign of this number. That's just the way that things are in two's complement: a leading 1 means the number is negative, a leading 0 means the number is 0 or positive. What can we say about this number? It's first (leftmost) bit is 1, which means that this represents a number that is negative. That is how one would write -28 in 8 bit binary. Suppose we're working with 8 bit quantities (for simplicity's sake) and suppose we want to find how -28 would be expressed in two's complement notation. You then invert the digits, and add one to the result. To get the two's complement negative notation of an integer, you write out the number in binary. Two's complement is the way every computer I know of chooses to represent integers. Therefore, after this introduction, which explains what two's complement is and how to use it, there are mostly examples. Two's complement is not a complicated scheme and is not well served by anything lengthly. Thomas Finley, April 2000 Contents and Introduction
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |