Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Two's complement
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Two's complement and {{nowrap|2-adic}} numbers== In a classic ''[[HAKMEM]]'' published by the [[MIT AI Lab]] in 1972, [[Bill Gosper]] noted that whether or not a machine's internal representation was two's-complement could be determined by summing the successive powers of two. In a flight of fancy, he noted that the result of doing this algebraically indicated that "algebra is run on a machine (the universe) which is two's-complement."<ref>{{cite web |url=http://www.inwap.com/pdp10/hbaker/hakmem/hacks.html#item154 |title=Programming Hacks |work=HAKMEM |at=ITEM 154 (Gosper) |archive-url=https://web.archive.org/web/20240224184437/http://www.inwap.com/pdp10/hbaker/hakmem/hacks.html#item154 |archive-date=2024-02-24 |url-status=dead}}</ref> Gosper's end conclusion is not necessarily meant to be taken seriously, and it is akin to a [[mathematical joke]]. The critical step is "...110 = ...111 β 1", i.e., "2''X'' = ''X'' β 1", and thus ''X'' = ...111 = β1. This presupposes a method by which an infinite string of 1s is considered a number, which requires an extension of the finite place-value concepts in elementary arithmetic.<!--Does this interpretation take into account a sign bit?--> It is meaningful either as part of a two's-complement notation for all integers, as a typical [[p-adic number|2-adic number]], or even as one of the generalized sums defined for the [[divergent series]] of real numbers [[1 + 2 + 4 + 8 + β―]].<ref>For the summation of 1 + 2 + 4 + 8 + β― without recourse to the 2-adic metric, see {{cite book |last=Hardy |first=G. H. |author-link=G. H. Hardy |title=Divergent Series |year=1949 |publisher=Clarendon Press |id={{LCC|QA295|.H29|1967}} |pages=7β10}}</ref> Digital arithmetic circuits, idealized to operate with infinite (extending to positive powers of 2) bit strings, produce 2-adic addition and multiplication compatible with two's complement representation.<ref>{{cite book |title=On circuits and numbers |last=Vuillemin |first=Jean |year=1993 |publisher=[[Digital Equipment Corporation]] |location=Paris |page=19 |url=https://hplabs.itcs.hp.com/techreports/Compaq-DEC/PRL-RR-25.pdf |access-date=2023-03-29 |chapter=Chapter 7}} See especially chapter 7.3 for multiplication.</ref> [[continuous function|Continuity]] of binary arithmetical and [[bitwise operation]]s in 2-adic [[metric space|metric]] also has some use in cryptography.<ref>{{cite web |url=http://crypto.rsuh.ru/ |title=ABC Stream Cipher |last1=Anashin|first1=Vladimir |last2=Bogdanov|first2=Andrey |last3=Kizhvatov|first3=Ilya |year=2007 |publisher=[[Russian State University for the Humanities]] |access-date=24 January 2012}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)