www.fgks.org   »   [go: up one dir, main page]

Binary number: Difference between revisions

Content deleted Content added
No edit summary
Tags: section blanking Visual edit Mobile edit Mobile web edit
m Reverted 1 edit by 182.1.186.133 (talk) to last revision by LizardJr8 (TW)
Tags: Undo nowiki added
Line 89:
 
The [[Z1 (computer)|Z1 computer]], which was designed and built by [[Konrad Zuse]] between 1935 and 1938, used [[Boolean logic]] and [[binary floating point number]]s.<ref name=zuse>{{cite journal |url=http://ed-thelen.org/comp-hist/Zuse_Z1_and_Z3.pdf |title=Konrad Zuse’s Legacy: The Architecture of the Z1 and Z3 |journal=IEEE Annals of the History of Computing |volume=19 |number=2 |year=1997 |pages=5–15 |doi=10.1109/85.586067}}</ref>
 
==Representation==
Any number can be represented by a sequence of [[bit]]s (binary digits), which in turn may be represented by any mechanism capable of being in two mutually exclusive states. Any of the following rows of symbols can be interpreted as the binary numeric value of 667:
 
{| style="text-align:center;"
| 1 || 0 || 1 || 0 || 0 || 1 || 1 || 0 || 1 || 1
|-
| <nowiki>|</nowiki> || ― || <nowiki>|</nowiki> || ― || ― || <nowiki>|</nowiki> || <nowiki>|</nowiki> || ― || <nowiki>|</nowiki> || <nowiki>|</nowiki>
|-
| ☒ || ☐ || ☒ || ☐ || ☐ || ☒ || ☒ || ☐ || ☒ || ☒
|-
| y || n || y || n || n || y || y || n || y || y
|}
 
[[Image:Binary clock.svg|250px|thumbnail|right|A [[binary clock]] might use [[Light-emitting diode|LEDs]] to express binary values. In this clock, each column of LEDs shows a [[binary-coded decimal]] numeral of the traditional [[sexagesimal]] time.]]
 
The numeric value represented in each case is dependent upon the value assigned to each symbol. In the earlier days of computing, switches, punched holes and punched paper tapes were used to represent binary values.<ref>{{Cite web|url=https://www.bbc.com/bitesize/guides/zwsbwmn/revision/1|title=Introducing binary - Revision 1 - GCSE Computer Science|website=BBC|access-date=2019-06-26}}</ref> In a modern computer, the numeric values may be represented by two different [[voltage]]s; on a [[Magnetic field|magnetic]] [[Disk storage|disk]], [[Magnetic polarity|magnetic polarities]] may be used. A "positive", "[[yes and no|yes]]", or "on" state is not necessarily equivalent to the numerical value of one; it depends on the architecture in use.
 
In keeping with customary representation of numerals using [[Arabic numerals]], binary numbers are commonly written using the symbols '''0''' and '''1'''. When written, binary numerals are often subscripted, prefixed or suffixed in order to indicate their base, or radix. The following notations are equivalent:
* 100101 binary (explicit statement of format)
* 100101b (a suffix indicating binary format; also known as [[Intel convention]]<ref name="Kueveler-Schwoch_1996">{{cite book|title=Arbeitsbuch Informatik - eine praxisorientierte Einführung in die Datenverarbeitung mit Projektaufgabe|language=German|first1=Gerd|last1=Küveler|first2=Dietrich|last2=Schwoch|date=2013|orig-year=1996|publisher=Vieweg-Verlag, reprint: Springer-Verlag|isbn=978-3-528-04952-2|id=9783322929075|doi=10.1007/978-3-322-92907-5|url=https://books.google.com/books?id=b8-dBgAAQBAJ|accessdate=2015-08-05}}</ref><ref name="Kueveler-Schwoch_2007">{{cite book|title=Informatik für Ingenieure und Naturwissenschaftler: PC- und Mikrocomputertechnik, Rechnernetze|language=German|first1=Gerd|last1=Küveler|first2=Dietrich|last2=Schwoch|date=2007-10-04|publisher=Vieweg, reprint: Springer-Verlag|edition=5|volume=2|isbn=3834891916|id=9783834891914|url=https://books.google.com/books?id=xQbvPYxceY0C|accessdate=2015-08-05}}</ref>)
* 100101B (a suffix indicating binary format)
* bin 100101 (a prefix indicating binary format)
* 100101<sub>2</sub> (a subscript indicating base-2 (binary) notation)
* %100101 (a prefix indicating binary format; also known as [[Motorola convention]]<ref name="Kueveler-Schwoch_1996"/><ref name="Kueveler-Schwoch_2007"/>)
* 0b100101 (a prefix indicating binary format, common in programming languages)
* 6b100101 (a prefix indicating number of bits in binary format, common in programming languages)
 
When spoken, binary numerals are usually read digit-by-digit, in order to distinguish them from decimal numerals. For example, the binary numeral 100 is pronounced ''one zero zero'', rather than ''one hundred'', to make its binary nature explicit, and for purposes of correctness. Since the binary numeral 100 represents the value four, it would be confusing to refer to the numeral as ''one hundred'' (a word that represents a completely different value, or amount). Alternatively, the binary numeral 100 can be read out as "four" (the correct ''value''), but this does not make its binary nature explicit.
 
==Counting in binary==