[Home]Integer Numbers

Contents | (Visit Preferences to set your user name.) | Related To Integer Numbers | RecentChanges | Preferences | Index | Login | Logout

Featured: Featured Stories | Picture Gallery

Stretching FAQ C.6 - Hip | Health A Duty
Google
Chat11.com Web Bible11.com MyBibleCenter.com
Sponsored by
[Baking America]

Cover of ISBN 1931412065

500 Low-Carb Recipes
More About This Book (Search)

Cover of ISBN 159233041X

15 Minute Low-Carb Recipes
More About This Book (Search for About This)

Integer Numbers

Subjects > ... > [[]]


Integer numbers are whole numbers; they are always represented exactly (without a decimal point) in the computer word: -3, 0, 379, etc. For instance, 5 (decimal) is represented exactly by 101 (binary) in the computer. Since that's binary, the rightmost bit represents 2-to-the-zeroth power, or "one". Since it's "on" in this example, we have a value of "one". The next binary digit to the left represents 2 to the 1st power, or "two"; but it's off, so its value is zero. The leftmost bit represents 2 to the 2nd power, or "four". Since it's "on", we add four to the value. One plus four is five, which is why "101" in binary is "5" decimal... Exactly.

All positive, non-zero integer numbers are represented in this manner. There are differences in the way zero and negative numbers are represented, depending upon whether a ones complement , twos complement , or sign-magnitude system was implemented.



ONES COMPLEMENT

Negative X is obtained by inverting each bit of X; i.e.,

-X = not(X)

The leading bit of a number is the sign bit.  Positive numbers have a zero as the leading bit; negative numbers have a one as the leading bit.

One consequence of this is that there are two values for zero: +0 and -0.

For example, for a four-bit number (remember, the leading -- that is, leftmost -- bit is a sign bit):
 
Binary: 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
Decimal:  +0 +1 +2 +3 +4 +5 +6 +7 -7 -6 -5 -4 -3 -2 -1 -0



TWOS COMPLEMENT

Negative X is obtained by inverting each bit of X, and then adding one; i.e.,

-X = not(X)+1

The leading bit of a number is the sign bit.  Positive numbers have a zero as the leading bit; negative numbers have a one as the leading bit.

There is only one value for zero: all bits are zero (as opposed to the system used for One's Complement).

For example, for a four-bit number (remember, the leading -- that is, leftmost -- bit is a sign bit):
 
Binary: 0000 0001 0010 0011 0100 0101 0110 0111 1000
1001 1010 1011 1100 1101 1110 1111
Decimal:  0 +1 +2 +3 +4 +5 +6 +7 -8
-7 -6 -5 -4 -3 -2 -1

 Note that the range of negative numbers, and their values, are slightly different from one's complement.



SIGN-MAGNITUDE

This is the simplest way to represent negative numbers.  Numbers have the leading bit signify positive (0) or negative (1), while the following bits are the magnitude of the number.

Binary: 0000 0001 0010 0011 0100 0101 0110 0111 1000
1001 1010 1011 1100 1101 1110 1111
Decimal:  +0 +1 +2 +3 +4 +5 +6 +7 -0
-1 -2 -3 -4 -5 -6 -7




See also Recipes (Search for Recipes), Recipe Books (Search), Recipe Tips (Search)...

Used by permission of Direct Response Technologies, Inc.

Cover of ISBN 0471267570

The Low-Carb Comfort Food Cookbook
More About This Book (Search for About This)



Contents | (Visit Preferences to set your user name.) | Related To Integer Numbers | RecentChanges | Preferences | Index | Login | Logout
Edit this www.chat11.com page | View other versions
Last edited April 8, 2007 2:56 am (diff)
Search:
Sign up for PayPal and start accepting credit card payments
instantly.
Bobsgear - Get A Free Enterrpise Wiki Space!
Review: The Bobsgear Project was started to develop a variety of Confluence plugins. This installation of the Confluence Enterprise wiki includes flexible attachments, many Confluence plugins, personal blogs, interesting articles, and more. Bobsgear already has spaces related to politics, art and photography wiki, technical issues wiki, ediscovery wiki, health, Christian theology and Sabbath School wiki, the bible, book reviews, and quotations. Bobsgear allows free signup, and invites anyone to create a free hosted Confluence wiki space.


NEW USERS CLICK HERE! for a quick introduction to Wiki.

 

 Interested in Test/Test/Test2?
2588 total hits since 9/2007
Recently accessed pages: 30 Second Quick Wiki Tutorial Easter Recipes How To Set Fitness Goals NewUsersGuide Personal Website Starter Kit Problems Sink Sony Has Three Excuses To Avoid Sending Free Vaio Recovery Disks

Elapsed:0