<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www2.physics.siu.edu/qunet/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Akelle</id>
	<title>Qunet - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www2.physics.siu.edu/qunet/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Akelle"/>
	<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php/Special:Contributions/Akelle"/>
	<updated>2026-04-29T19:07:05Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.7</generator>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=3010</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=3010"/>
		<updated>2022-06-06T19:49:19Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* ASCII (American Standard Code for Information Interchange) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|12&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;12_{10} = 1100_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;21_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|21&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;21_{10} = 10101_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
To convert a binary number into the corresponding decimal number, recall that each digit in a binary number corresponds to to a power of 2. '''''(see above, put a link here?)'''''&lt;br /&gt;
&lt;br /&gt;
For example, consider the binary number &amp;lt;math&amp;gt;10111_2&amp;lt;/math&amp;gt;. Each digit corresponds to a power of 2 as shown in the following table:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary number&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|power of 2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^4&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^3&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^2&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^1&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^0&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\begin{align}10111_2 &amp;amp; = 1 \cdot 2^4 + 0 \cdot 2^3 + 1 \cdot 2^2 + 1 \cdot 2^1 + 1 \cdot 2^0 \\&lt;br /&gt;
  &amp;amp; = 1 \cdot 16 + 0 \cdot 8 + 1 \cdot 4 + 1\cdot 2 + 1 \cdot 1 \\&lt;br /&gt;
  &amp;amp; = 16 + 0 + 4 + 2 + 1 \\&lt;br /&gt;
  &amp;amp; = 23_{10}\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Binary Logic==&lt;br /&gt;
&lt;br /&gt;
When considering zero and one to be yes/no or true/false, there is an algebra (called Boolean algebra) that helps to designate how to combine these values.  The main combinations are ''AND'' &amp;lt;math&amp;gt;\wedge&amp;lt;/math&amp;gt;, ''OR'' &amp;lt;math&amp;gt;\vee&amp;lt;/math&amp;gt;, and ''NOT'' &amp;lt;math&amp;gt;\neg&amp;lt;/math&amp;gt;.  The ''NOT'' gives &amp;lt;math&amp;gt;\neg 0 =1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\neg 1 = 0&amp;lt;/math&amp;gt;.  The ''AND'' operation gives &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \wedge 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \wedge 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \wedge 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \wedge 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ''OR'' operation gives &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \vee 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \vee 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \vee 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \vee 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One operation that we will use often is the ''exclusive OR'', sometimes written as XOR.  The symbol for the combination is &amp;lt;math&amp;gt;\oplus&amp;lt;/math&amp;gt; and it gives the following values: &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we will see, these operations are performed very explicitly in quantum computing using matrices and vectors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Exercises==&lt;br /&gt;
&lt;br /&gt;
'''''(can we gamify this?? Ask the Arts team about non-traditional/creative assessments, and find real-world applications)'''''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal &amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Copyright====&lt;br /&gt;
&lt;br /&gt;
&amp;amp;copy; Copyright 2022 '''QuSTEAM'''&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=3007</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=3007"/>
		<updated>2022-06-06T18:36:49Z</updated>

		<summary type="html">&lt;p&gt;Akelle: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|12&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;12_{10} = 1100_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;21_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|21&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;21_{10} = 10101_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
To convert a binary number into the corresponding decimal number, recall that each digit in a binary number corresponds to to a power of 2. '''''(see above, put a link here?)'''''&lt;br /&gt;
&lt;br /&gt;
For example, consider the binary number &amp;lt;math&amp;gt;10111_2&amp;lt;/math&amp;gt;. Each digit corresponds to a power of 2 as shown in the following table:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary number&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|power of 2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^4&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^3&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^2&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^1&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^0&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\begin{align}10111_2 &amp;amp; = 1 \cdot 2^4 + 0 \cdot 2^3 + 1 \cdot 2^2 + 1 \cdot 2^1 + 1 \cdot 2^0 \\&lt;br /&gt;
  &amp;amp; = 1 \cdot 16 + 0 \cdot 8 + 1 \cdot 4 + 1\cdot 2 + 1 \cdot 1 \\&lt;br /&gt;
  &amp;amp; = 16 + 0 + 4 + 2 + 1 \\&lt;br /&gt;
  &amp;amp; = 23_{10}\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Binary Logic==&lt;br /&gt;
&lt;br /&gt;
When considering zero and one to be yes/no or true/false, there is an algebra (called Boolean algebra) that helps to designate how to combine these values.  The main combinations are ''AND'' &amp;lt;math&amp;gt;\wedge&amp;lt;/math&amp;gt;, ''OR'' &amp;lt;math&amp;gt;\vee&amp;lt;/math&amp;gt;, and ''NOT'' &amp;lt;math&amp;gt;\neg&amp;lt;/math&amp;gt;.  The ''NOT'' gives &amp;lt;math&amp;gt;\neg 0 =1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\neg 1 = 0&amp;lt;/math&amp;gt;.  The ''AND'' operation gives &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \wedge 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \wedge 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \wedge 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \wedge 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ''OR'' operation gives &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \vee 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \vee 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \vee 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \vee 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One operation that we will use often is the ''exclusive OR'', sometimes written as XOR.  The symbol for the combination is &amp;lt;math&amp;gt;\oplus&amp;lt;/math&amp;gt; and it gives the following values: &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we will see, these operations are performed very explicitly in quantum computing using matrices and vectors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Exercises==&lt;br /&gt;
&lt;br /&gt;
'''''(can we gamify this?? Ask the Arts team about non-traditional/creative assessments, and find real-world applications)'''''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal &amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Copyright====&lt;br /&gt;
&lt;br /&gt;
&amp;amp;copy; Copyright 2022 '''QuSTEAM'''&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2994</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2994"/>
		<updated>2022-05-23T20:07:09Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Exercises */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|12&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;12_{10} = 1100_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;21_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|21&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;21_{10} = 10101_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
To convert a binary number into the corresponding decimal number, recall that each digit in a binary number corresponds to to a power of 2. '''''(see above, put a link here?)'''''&lt;br /&gt;
&lt;br /&gt;
For example, consider the binary number &amp;lt;math&amp;gt;10111_2&amp;lt;/math&amp;gt;. Each digit corresponds to a power of 2 as shown in the following table:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary number&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|power of 2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^4&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^3&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^2&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^1&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^0&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\begin{align}10111_2 &amp;amp; = 1 \cdot 2^4 + 0 \cdot 2^3 + 1 \cdot 2^2 + 1 \cdot 2^1 + 1 \cdot 2^0 \\&lt;br /&gt;
  &amp;amp; = 1 \cdot 16 + 0 \cdot 8 + 1 \cdot 4 + 1\cdot 2 + 1 \cdot 1 \\&lt;br /&gt;
  &amp;amp; = 16 + 0 + 4 + 2 + 1 \\&lt;br /&gt;
  &amp;amp; = 23_{10}\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Binary Logic==&lt;br /&gt;
&lt;br /&gt;
When considering zero and one to be yes/no or true/false, there is an algebra (called Boolean algebra) that helps to designate how to combine these values.  The main combinations are ''AND'' &amp;lt;math&amp;gt;\wedge&amp;lt;/math&amp;gt;, ''OR'' &amp;lt;math&amp;gt;\vee&amp;lt;/math&amp;gt;, and ''NOT'' &amp;lt;math&amp;gt;\neg&amp;lt;/math&amp;gt;.  The ''NOT'' gives &amp;lt;math&amp;gt;\neg 0 =1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\neg 1 = 0&amp;lt;/math&amp;gt;.  The ''AND'' operation gives &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \wedge 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \wedge 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \wedge 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \wedge 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ''OR'' operation gives &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \vee 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \vee 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \vee 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \vee 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One operation that we will use often is the ''exclusive OR'', sometimes written as XOR.  The symbol for the combination is &amp;lt;math&amp;gt;\oplus&amp;lt;/math&amp;gt; and it gives the following values: &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we will see, these operations are performed very explicitly in quantum computing using matrices and vectors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Exercises'''''(can we gamify this?? Ask the Arts team about non-traditional/creative assessments, and find real-world applications)'''''==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal &amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2993</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2993"/>
		<updated>2022-05-23T20:06:22Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Exercises */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|12&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;12_{10} = 1100_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;21_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|21&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;21_{10} = 10101_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
To convert a binary number into the corresponding decimal number, recall that each digit in a binary number corresponds to to a power of 2. '''''(see above, put a link here?)'''''&lt;br /&gt;
&lt;br /&gt;
For example, consider the binary number &amp;lt;math&amp;gt;10111_2&amp;lt;/math&amp;gt;. Each digit corresponds to a power of 2 as shown in the following table:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary number&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|power of 2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^4&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^3&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^2&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^1&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^0&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\begin{align}10111_2 &amp;amp; = 1 \cdot 2^4 + 0 \cdot 2^3 + 1 \cdot 2^2 + 1 \cdot 2^1 + 1 \cdot 2^0 \\&lt;br /&gt;
  &amp;amp; = 1 \cdot 16 + 0 \cdot 8 + 1 \cdot 4 + 1\cdot 2 + 1 \cdot 1 \\&lt;br /&gt;
  &amp;amp; = 16 + 0 + 4 + 2 + 1 \\&lt;br /&gt;
  &amp;amp; = 23_{10}\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Binary Logic==&lt;br /&gt;
&lt;br /&gt;
When considering zero and one to be yes/no or true/false, there is an algebra (called Boolean algebra) that helps to designate how to combine these values.  The main combinations are ''AND'' &amp;lt;math&amp;gt;\wedge&amp;lt;/math&amp;gt;, ''OR'' &amp;lt;math&amp;gt;\vee&amp;lt;/math&amp;gt;, and ''NOT'' &amp;lt;math&amp;gt;\neg&amp;lt;/math&amp;gt;.  The ''NOT'' gives &amp;lt;math&amp;gt;\neg 0 =1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\neg 1 = 0&amp;lt;/math&amp;gt;.  The ''AND'' operation gives &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \wedge 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \wedge 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \wedge 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \wedge 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ''OR'' operation gives &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \vee 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \vee 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \vee 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \vee 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One operation that we will use often is the ''exclusive OR'', sometimes written as XOR.  The symbol for the combination is &amp;lt;math&amp;gt;\oplus&amp;lt;/math&amp;gt; and it gives the following values: &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we will see, these operations are performed very explicitly in quantum computing using matrices and vectors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Exercises==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal '''''(can we gamify this?? Ask the Arts team about non-traditional/creative assessments)'''''&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2992</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2992"/>
		<updated>2022-05-23T20:05:29Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Exercises */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|12&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;12_{10} = 1100_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;21_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|21&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;21_{10} = 10101_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
To convert a binary number into the corresponding decimal number, recall that each digit in a binary number corresponds to to a power of 2. '''''(see above, put a link here?)'''''&lt;br /&gt;
&lt;br /&gt;
For example, consider the binary number &amp;lt;math&amp;gt;10111_2&amp;lt;/math&amp;gt;. Each digit corresponds to a power of 2 as shown in the following table:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary number&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|power of 2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^4&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^3&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^2&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^1&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^0&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\begin{align}10111_2 &amp;amp; = 1 \cdot 2^4 + 0 \cdot 2^3 + 1 \cdot 2^2 + 1 \cdot 2^1 + 1 \cdot 2^0 \\&lt;br /&gt;
  &amp;amp; = 1 \cdot 16 + 0 \cdot 8 + 1 \cdot 4 + 1\cdot 2 + 1 \cdot 1 \\&lt;br /&gt;
  &amp;amp; = 16 + 0 + 4 + 2 + 1 \\&lt;br /&gt;
  &amp;amp; = 23_{10}\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Binary Logic==&lt;br /&gt;
&lt;br /&gt;
When considering zero and one to be yes/no or true/false, there is an algebra (called Boolean algebra) that helps to designate how to combine these values.  The main combinations are ''AND'' &amp;lt;math&amp;gt;\wedge&amp;lt;/math&amp;gt;, ''OR'' &amp;lt;math&amp;gt;\vee&amp;lt;/math&amp;gt;, and ''NOT'' &amp;lt;math&amp;gt;\neg&amp;lt;/math&amp;gt;.  The ''NOT'' gives &amp;lt;math&amp;gt;\neg 0 =1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\neg 1 = 0&amp;lt;/math&amp;gt;.  The ''AND'' operation gives &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \wedge 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \wedge 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \wedge 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \wedge 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ''OR'' operation gives &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \vee 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \vee 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \vee 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \vee 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One operation that we will use often is the ''exclusive OR'', sometimes written as XOR.  The symbol for the combination is &amp;lt;math&amp;gt;\oplus&amp;lt;/math&amp;gt; and it gives the following values: &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we will see, these operations are performed very explicitly in quantum computing using matrices and vectors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Exercises==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal '''''(can we gamify this??)'''''&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2980</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2980"/>
		<updated>2022-05-23T17:59:47Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Binary to Decimal Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|12&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;12_{10} = 1100_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;21_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|21&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;21_{10} = 10101_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
To convert a binary number into the corresponding decimal number, recall that each digit in a binary number corresponds to to a power of 2. '''''(see above, put a link here?)'''''&lt;br /&gt;
&lt;br /&gt;
For example, consider the binary number &amp;lt;math&amp;gt;10111_2&amp;lt;/math&amp;gt;. Each digit corresponds to a power of 2 as shown in the following table:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary number&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|power of 2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^4&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^3&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^2&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^1&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^0&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;10111_2 = 1 \cdot 2^4 + 0 \cdot 2^3 + 1 \cdot 2^2 + 1 \cdot 2^1 + 1 \cdot 2^0&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = 1 \cdot 16 + 0 \cdot 8 + 1 \cdot 4 + 1\cdot 2 + 1 \cdot 1&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = 16 + 0 + 4 + 2 + 1&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = 23_{10}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
When considering zero and one to be yes/no or true/false, there is an algebra (called Boolean algebra) that helps to designate how to combine these values.  The main combinations are &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2978</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2978"/>
		<updated>2022-05-23T17:59:05Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Binary to Decimal Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|12&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;12_{10} = 1100_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;21_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|21&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;21_{10} = 10101_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
To convert a binary number into the corresponding decimal number, recall that each digit in a binary number corresponds to to a power of 2. '''''(see above, put a link here?)'''''&lt;br /&gt;
&lt;br /&gt;
For example, consider the binary number &amp;lt;math&amp;gt;10111_2&amp;lt;/math&amp;gt;. Each digit corresponds to a power of 2 as shown in the following table:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary number&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|power of 2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^4&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^3&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^2&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^1&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^0&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;10111_2 = 1 \cdot 2^4 + 0 \cdot 2^3 + 1 \cdot 2^2 + 1 \cdot 2^1 + 1 \cdot 2^0&amp;lt;br&amp;gt;&lt;br /&gt;
 = 1 \cdot 16 + 0 \cdot 8 + 1 \cdot 4 + 1\cdot 2 + 1 \cdot 1&amp;lt;br&amp;gt;&lt;br /&gt;
 = 16 + 0 + 4 + 2 + 1 &amp;lt;br&amp;gt;&lt;br /&gt;
 = 23_{10}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2977</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2977"/>
		<updated>2022-05-23T17:58:21Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Binary to Decimal Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|12&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;12_{10} = 1100_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;21_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|21&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;21_{10} = 10101_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
To convert a binary number into the corresponding decimal number, recall that each digit in a binary number corresponds to to a power of 2. '''''(see above, put a link here?)'''''&lt;br /&gt;
&lt;br /&gt;
For example, consider the binary number &amp;lt;math&amp;gt;10111_2&amp;lt;/math&amp;gt;. Each digit corresponds to a power of 2 as shown in the following table:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary number&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|power of 2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^4&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^3&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^2&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^1&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^0&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;10111_2 = 1 \cdot 2^4 + 0 \cdot 2^3 + 1 \cdot 2^2 + 1 \cdot 2^1 + 1 \cdot 2^0 &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = 1 \cdot 16 + 0 \cdot 8 + 1 \cdot 4 + 1\cdot 2 + 1 \cdot 1&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = 16 + 0 + 4 + 2 + 1 &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = 23_{10}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2976</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2976"/>
		<updated>2022-05-23T17:57:32Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Binary to Decimal Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|12&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;12_{10} = 1100_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;21_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|21&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;21_{10} = 10101_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
To convert a binary number into the corresponding decimal number, recall that each digit in a binary number corresponds to to a power of 2. '''''(see above, put a link here?)'''''&lt;br /&gt;
&lt;br /&gt;
For example, consider the binary number &amp;lt;math&amp;gt;10111_2&amp;lt;/math&amp;gt;. Each digit corresponds to a power of 2 as shown in the following table:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary number&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|power of 2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^4&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^3&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^2&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^1&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^0&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;10111_2 = 1 \cdot 2^4 + 0 \cdot 2^3 + 1 \cdot 2^2 + 1 \cdot 2^1 + 1 \cdot 2^0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = 1 \cdot 16 + 0 \cdot 8 + 1 \cdot 4 + 1\cdot 2 + 1 \cdot 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = 16 + 0 + 4 + 2 + 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = 23_{10}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2975</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2975"/>
		<updated>2022-05-23T17:57:07Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Binary to Decimal Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|12&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;12_{10} = 1100_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;21_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|21&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;21_{10} = 10101_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
To convert a binary number into the corresponding decimal number, recall that each digit in a binary number corresponds to to a power of 2. '''''(see above, put a link here?)'''''&lt;br /&gt;
&lt;br /&gt;
For example, consider the binary number &amp;lt;math&amp;gt;10111_2&amp;lt;/math&amp;gt;. Each digit corresponds to a power of 2 as shown in the following table:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary number&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|power of 2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^4&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^3&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^2&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^1&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^0&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;10111_2 = 1 \cdot 2^4 + 0 \cdot 2^3 + 1 \cdot 2^2 + 1 \cdot 2^1 + 1 \cdot 2^0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = 1 \cdot 16 + 0 \cdot 8 + 1 \cdot 4 + 1\cdot 2 + 1 \cdot 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = 16 + 0 + 4 + 2 + 1 &amp;lt;/math&lt;br /&gt;
&amp;lt;math&amp;gt; = 23_{10}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2974</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2974"/>
		<updated>2022-05-23T17:54:52Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Binary to Decimal Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|12&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;12_{10} = 1100_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;21_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|21&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;21_{10} = 10101_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
To convert a binary number into the corresponding decimal number, recall that each digit in a binary number corresponds to to a power of 2. '''''(see above, put a link here?)'''''&lt;br /&gt;
&lt;br /&gt;
For example, consider the binary number &amp;lt;math&amp;gt;10111_2&amp;lt;/math&amp;gt;. Each digit corresponds to a power of 2 as shown in the following table:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary number&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|power of 2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^4&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^3&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^2&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^1&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^0&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;10111_2 = 1 \cdot 2^4 + 0 \cdot 2^3 + 1 \cdot 2^2 + 1 \cdot 2^1 + 1 \cdot 2^0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2973</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2973"/>
		<updated>2022-05-23T17:54:41Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Binary to Decimal Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|12&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;12_{10} = 1100_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;21_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|21&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;21_{10} = 10101_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
To convert a binary number into the corresponding decimal number, recall that each digit in a binary number corresponds to to a power of 2. '''''(see above, put a link here?)'''''&lt;br /&gt;
&lt;br /&gt;
For example, consider the binary number &amp;lt;math&amp;gt;10111_2&amp;lt;/math&amp;gt;. Each digit corresponds to a power of 2 as shown in the following table:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary number&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|power of 2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^4&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^3&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^2&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^1&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^0&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;10111_2 = 1 \cdot 2^4 + 0 \cdot 2^3 + 1 \cdot 2^2 + 1 \cdot 2^1 + 1 \cdot 2^0&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2972</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2972"/>
		<updated>2022-05-23T17:52:34Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Binary to Decimal Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|12&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;12_{10} = 1100_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;21_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|21&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;21_{10} = 10101_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
To convert a binary number into the corresponding decimal number, recall that each digit in a binary number corresponds to to a power of 2. '''''(see above, put a link here?)'''''&lt;br /&gt;
&lt;br /&gt;
For example, consider the binary number &amp;lt;math&amp;gt;10111_2&amp;lt;/math&amp;gt;. Each digit corresponds to a power of 2 as shown in the following table:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary number&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|power of 2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^4&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^3&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^2&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^1&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^0&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2971</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2971"/>
		<updated>2022-05-23T17:51:23Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Binary to Decimal Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|12&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;12_{10} = 1100_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;21_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|21&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;21_{10} = 10101_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
To convert a binary number into the corresponding decimal number, recall that each digit in a binary number corresponds to to a power of 2. '''''(see above, put a link here?)'''''&lt;br /&gt;
&lt;br /&gt;
For example, consider the binary number &amp;lt;math&amp;gt;10111_2&amp;lt;/math&amp;gt;. Each digit corresponds to a power of 2 as shown in the following table:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary number&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|power of 2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^4&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^3&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^2&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^1&amp;lt;/math&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;math&amp;gt;2^0&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2970</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2970"/>
		<updated>2022-05-23T17:46:12Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Binary to Decimal Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|12&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;12_{10} = 1100_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;21_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|21&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;21_{10} = 10101_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
To convert a binary number into the corresponding decimal number, recall that each digit in a binary number corresponds to to a power of 2. '''''(see above, put a link here?)'''''&lt;br /&gt;
&lt;br /&gt;
For example, consider the binary number &amp;lt;math&amp;gt;10111_2&amp;lt;/math&amp;gt;. Each digit corresponds to a power of 2 as shown in the following table:&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2969</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2969"/>
		<updated>2022-05-23T17:40:11Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Decimal to Binary Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|12&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;12_{10} = 1100_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;21_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|21&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;21_{10} = 10101_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2968</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2968"/>
		<updated>2022-05-23T17:39:49Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Decimal to Binary Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|12&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;12_{10} = 1100_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;21_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|21&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;21_{10} = 10101_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2967</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2967"/>
		<updated>2022-05-23T17:39:29Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Decimal to Binary Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|12&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;12_{10} = 1100_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;21_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|21&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|10&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;21_{10} = 10101_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2966</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2966"/>
		<updated>2022-05-23T17:37:23Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Decimal to Binary Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|12&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;12_{10} = 1100_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2965</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2965"/>
		<updated>2022-05-23T17:36:54Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Decimal to Binary Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|12&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; so &amp;lt;math&amp;gt;12_{10} = 1100_2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2964</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2964"/>
		<updated>2022-05-23T17:35:32Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Decimal to Binary Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|12&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
 so &amp;lt;math&amp;gt;12_{10} = 1100_2&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2963</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2963"/>
		<updated>2022-05-23T17:34:03Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Decimal to Binary Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|12&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
 so &amp;lt;math&amp;gt;12_{10} = 1100_2&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2962</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2962"/>
		<updated>2022-05-23T17:33:22Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Decimal to Binary Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|12&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
 so &amp;lt;math&amp;gt;12_{10} = 1101_2&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2961</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2961"/>
		<updated>2022-05-23T17:32:46Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Decimal to Binary Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; convert &amp;lt;math&amp;gt;12_{10}&amp;lt;/math&amp;gt; to binary:&amp;lt;/div&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|13&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
 so &amp;lt;math&amp;gt;13_{10} = 1101_2&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2960</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2960"/>
		<updated>2022-05-23T17:26:01Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Decimal to Binary Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''To convert a decimal number into a binary number, one can follow these steps:'''&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;!--&amp;lt;div id=&amp;quot;TableB.2&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.2'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|13&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
 so &amp;lt;math&amp;gt;13_{10} = 1101_2&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2959</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2959"/>
		<updated>2022-05-23T17:25:19Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Decimal to Binary Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To convert a decimal number into a binary number, one can follow these steps:&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. '''''The remainder is the resulting binary digit.'''''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;!--&amp;lt;div id=&amp;quot;TableB.2&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.2'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|13&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
 so &amp;lt;math&amp;gt;13_{10} = 1101_2&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2958</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2958"/>
		<updated>2022-05-23T17:23:23Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Decimal to Binary Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To convert a decimal number into a binary number, one can follow these steps:&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. '''''The remainder is the resulting binary digit.'''''&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Take the quotient from step 1 and repeat.&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Keep doing this until you get to a quotient of 0.&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. '''''The remainder is the resulting binary digit.'''''&lt;br /&gt;
&lt;br /&gt;
2. Take the quotient from step 1 and repeat.&lt;br /&gt;
&lt;br /&gt;
3. Keep doing this until you get to a quotient of 0.&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;!--&amp;lt;div id=&amp;quot;TableB.2&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.2'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|13&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
 so &amp;lt;math&amp;gt;13_{10} = 1101_2&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2957</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2957"/>
		<updated>2022-05-23T17:20:46Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Decimal to Binary Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To convert a decimal number into a binary number, one can follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. '''''The remainder is the resulting binary digit.'''''&lt;br /&gt;
&lt;br /&gt;
2. Take the quotient from step 1 and repeat.&lt;br /&gt;
&lt;br /&gt;
3. Keep doing this until you get to a quotient of 0.&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;!--&amp;lt;div id=&amp;quot;TableB.2&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.2'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|13&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
 so &amp;lt;math&amp;gt;13_{10} = 1101_2&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2956</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2956"/>
		<updated>2022-05-23T17:20:12Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Decimal to Binary Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To convert a decimal number into a binary number, one can follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. '''''The remainder is the resulting binary digit.'''''&lt;br /&gt;
&lt;br /&gt;
2. Take the quotient from step 1 and repeat.&lt;br /&gt;
&lt;br /&gt;
3. Keep doing this until you get to a quotient of 0.&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;!--&amp;lt;div id=&amp;quot;TableB.2&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.2'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|13&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
 so &amp;lt;math&amp;gt;13_1_0 = 1101_2&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2955</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2955"/>
		<updated>2022-05-23T17:19:39Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Decimal to Binary Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To convert a decimal number into a binary number, one can follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. '''''The remainder is the resulting binary digit.'''''&lt;br /&gt;
&lt;br /&gt;
2. Take the quotient from step 1 and repeat.&lt;br /&gt;
&lt;br /&gt;
3. Keep doing this until you get to a quotient of 0.&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;!--&amp;lt;div id=&amp;quot;TableB.2&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.2'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|13&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
 so &amp;lt;math&amp;gt;13_10 = 1101_2&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2954</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2954"/>
		<updated>2022-05-23T17:16:28Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Decimal to Binary Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To convert a decimal number into a binary number, one can follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. '''''The remainder is the resulting binary digit.'''''&lt;br /&gt;
&lt;br /&gt;
2. Take the quotient from step 1 and repeat.&lt;br /&gt;
&lt;br /&gt;
3. Keep doing this until you get to a quotient of 0.&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;!--&amp;lt;div id=&amp;quot;TableB.2&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.2'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|13&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;!--Table B2: ''Examples of Decimal-to-Binary Conversion.''--&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2953</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2953"/>
		<updated>2022-05-23T17:15:09Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Decimal to Binary Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To convert a decimal number into a binary number, one can follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. '''''The remainder is the resulting binary digit.'''''&lt;br /&gt;
&lt;br /&gt;
2. Take the quotient from step 1 and repeat.&lt;br /&gt;
&lt;br /&gt;
3. Keep doing this until you get to a quotient of 0.&lt;br /&gt;
&lt;br /&gt;
This procedure is shown in the following examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.2&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.2'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Division by 2&lt;br /&gt;
|Quotient&lt;br /&gt;
|Remainder&lt;br /&gt;
|Binary digit&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|13&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1st&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2nd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3rd&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4th&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Decimal-to-Binary Conversion.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2952</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2952"/>
		<updated>2022-05-23T17:09:19Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Decimal to Binary Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To convert a decimal number into a binary number, one can follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. '''''The remainder is the resulting binary digit.'''''&lt;br /&gt;
&lt;br /&gt;
2.&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2951</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2951"/>
		<updated>2022-05-23T17:09:01Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Decimal to Binary Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To convert a decimal number into a binary number, one can follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''The remainder is the resulting binary digit.''&lt;br /&gt;
&lt;br /&gt;
2.&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2950</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2950"/>
		<updated>2022-05-23T17:08:31Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Decimal to Binary Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To convert a decimal number into a binary number, one can follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. divide the decimal number by 2 to get the WHOLE number quotient. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. ''''The remainder is the resulting binary digit.''''&lt;br /&gt;
&lt;br /&gt;
2.&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2949</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2949"/>
		<updated>2022-05-23T17:06:43Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Decimal to Binary Conversion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To convert a decimal number into a binary number, one can follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. divide the decimal number by 2 to get a WHOLE number. If the number is odd, you will be left with a remainder of 1; If the decimal number is even, then you will have a remainder of 0. &amp;lt;i&amp;gt;The remainder is the resulting binary digit&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2948</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2948"/>
		<updated>2022-05-23T17:01:57Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Further Reading */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Put example here of dividing by 2, over and over, and keeping track of remainders, etc...&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book [49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2947</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2947"/>
		<updated>2022-05-23T17:01:46Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Further Reading */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Put example here of dividing by 2, over and over, and keeping track of remainders, etc...&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book[49]]] is an excellent introductory resource for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2946</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2946"/>
		<updated>2022-05-23T17:01:16Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Further Reading */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Put example here of dividing by 2, over and over, and keeping track of remainders, etc...&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book[49]]] is an excellent resource for introductory material for both classical and quantum computing.&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2945</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2945"/>
		<updated>2022-05-23T17:01:02Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Conclusion (gearing up for logic gates) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Put example here of dividing by 2, over and over, and keeping track of remainders, etc...&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[[Bibliography#Wong|Thomas Wong's book[49]]] is an excellent resource for introductory material for boith classical and quantum computing&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Bibliography&amp;diff=2944</id>
		<title>Bibliography</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Bibliography&amp;diff=2944"/>
		<updated>2022-05-23T16:54:29Z</updated>

		<summary type="html">&lt;p&gt;Akelle: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;# &amp;lt;div id=&amp;quot;Mermin:qcbook&amp;quot;&amp;gt; N. David Mermin. ''Quantum Computer Science: An Introduction''. Cambridge University Press, (2007).&amp;lt;/div&amp;gt;&lt;br /&gt;
# &amp;lt;div id=&amp;quot;NielsenChuang:book&amp;quot;&amp;gt; M.A. Nielsen and I.L. Chuang. ''Quantum Computation and Quantum Information.'' Cambridge University Press, Cambridge, UK, (2000).&amp;lt;/div&amp;gt;&lt;br /&gt;
# &amp;lt;div id=&amp;quot;Gaitan:book&amp;quot;&amp;gt; Frank Gaitan. ''Quantum Error Correction and Fault Tolerant Quantum Computing.'' CRC Press, Boca Raton, FL, (2008). &amp;lt;/div&amp;gt;&lt;br /&gt;
# &amp;lt;div id=&amp;quot;Griffiths:qmbook&amp;quot;&amp;gt; David J. Griffiths. ''Introduction to Quantum Mechanics'', Second Edition. Pearson Prentice Hall, (2005).&amp;lt;/div&amp;gt;&lt;br /&gt;
# &amp;lt;div id=&amp;quot;Preskill:notes&amp;quot;&amp;gt; J. Preskill. Lecture Notes for Course on Quantum Computation. Caltech, Pasadena, CA, (2005). http://www.theory.caltech.edu/people/preskill/ph229/#lecture &amp;lt;/div&amp;gt;&lt;br /&gt;
# &amp;lt;div id=&amp;quot;Cecile:book&amp;quot;&amp;gt; Y. Choquet.-Bruhat, C. Dewitt-Morette. ''Analysis, Manifolds and Physics''. North-Holland, The Netherlands, (1991).&amp;lt;/div&amp;gt;&lt;br /&gt;
# &amp;lt;div id=&amp;quot;qcrequirements&amp;quot;&amp;gt; D.P. DiVincenzo. &amp;lt;nowiki&amp;gt;''The Physical Implementation of Quantum Computation''&amp;lt;/nowiki&amp;gt;. ''Fortschritte der Physik'', '''48''':771, (2000). quant-ph/0002077.&amp;lt;/div&amp;gt;&lt;br /&gt;
# &amp;lt;div id=&amp;quot;nocloning&amp;quot;&amp;gt; W.K. Wootters and W.H. Zurek. &amp;lt;nowiki&amp;gt;''A single quantum cannot be cloned''&amp;lt;/nowiki&amp;gt;. ''Nature'', '''299''', 802 (1982).&amp;lt;/div&amp;gt;&lt;br /&gt;
# &amp;lt;div id=&amp;quot;HornNJohnsonI&amp;quot;&amp;gt; Roger A Horn and Charles R. Johnson. ''Matrix Analysis''. Cambridge University Press, (1990).&amp;lt;/div&amp;gt;&lt;br /&gt;
# &amp;lt;div id=&amp;quot;HornNJohnsonII&amp;quot;&amp;gt; Roger A Horn and Charles R. Johnson. ''Topics in Matrix Analysis''. Cambridge University Press, (1991).&amp;lt;/div&amp;gt;&lt;br /&gt;
# &amp;lt;div id=&amp;quot;SMR&amp;quot;&amp;gt; E. C. G. Sudarshan, P. M. Mathews and J. Rau. &amp;lt;nowiki&amp;gt;&amp;quot;Stocashtic Dynamics of Quantum-Mechanical Systems&amp;quot;,&amp;lt;/nowiki&amp;gt; ''Phys. Rev.'', '''121''', 920, (1961).&amp;lt;/div&amp;gt;&lt;br /&gt;
# &amp;lt;div id=&amp;quot;Kraus:83&amp;quot;&amp;gt; K. Kraus. ''States, Effects and Operations''. Fundamental Notions of Quantum Theory. Academic, Berlin, (1983).,&amp;lt;/div&amp;gt;&lt;br /&gt;
# &amp;lt;div id=&amp;quot;Schumacher:96a&amp;quot;&amp;gt; B. Schumacher. &amp;lt;nowiki&amp;gt;&amp;quot;Sending entanglement through noisy quantum channels&amp;quot;&amp;lt;/nowiki&amp;gt;. ''Phys. Rev. A'', '''54''':2614, (1996).&amp;lt;/div&amp;gt;&lt;br /&gt;
# &amp;lt;div id=&amp;quot;Lidar:CP01&amp;quot;&amp;gt; D.A. Lidar, Z. Bihary, and K.B. Whaley. &amp;lt;nowiki&amp;gt;&amp;quot;From Completely Positive Maps to the Quantum Markovian Semigroup Master Equation&amp;quot;.&amp;lt;/nowiki&amp;gt; ''Chem. Phys.'', '''68''':35, (2001).&amp;lt;/div&amp;gt;&lt;br /&gt;
# &amp;lt;div id=&amp;quot;cryptorev&amp;quot;&amp;gt; N. Gisin, G. Ribordy, W. Tittle, and H. Zbinden. &amp;lt;nowiki&amp;gt;&amp;quot;Quantum Cryptography&amp;quot;.&amp;lt;/nowiki&amp;gt; ''Rev. Mod. Phys.'', '''74''':145, (2002).&amp;lt;/div&amp;gt;&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Moore'sLaw:article&amp;quot;&amp;gt; Gordon E. Moore.  &amp;lt;nowiki&amp;gt;&amp;quot;Cramming more components onto integrated circuits.&amp;quot;&amp;lt;/nowiki&amp;gt; ''Electronics'', '''Volume 38''', Number 8, (1965).&amp;lt;/div&amp;gt;&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Shor:QECC&amp;quot;&amp;gt; Peter W. Shor.  &amp;lt;nowiki&amp;gt;&amp;quot;A method for reducing decoherence in quantum memory.&amp;quot;&amp;lt;/nowiki&amp;gt; ''Physical Review A'',  '''52''', R2493 (1995).&amp;lt;/div&amp;gt;&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Caves:QECC&amp;quot;&amp;gt; Carlton M. Caves. &amp;lt;nowiki&amp;gt; &amp;quot;Quantum Error Correction and Reversible Operations.&amp;quot;&amp;lt;/nowiki&amp;gt; ''Superconductivity'', '''12''', Number 6, 707 (1999).&amp;lt;/div&amp;gt;&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Lidar/Whaley:03&amp;quot;&amp;gt;D.A. Lidar and K.B. Whaley,&amp;lt;nowiki&amp;gt;&amp;quot;Decoherence-Free Subspaces and Subsystems&amp;quot;&amp;lt;/nowiki&amp;gt;, ''Irreversible Quantum Dynamics'', Springer-Verlag, Berlin (2003).&amp;lt;/div&amp;gt;&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Byrd/Wu/Lidar:04&amp;quot;&amp;gt;M.S. Byrd, L.-A. Wu, and D.A. Lidar, &amp;lt;nowiki&amp;gt;&amp;quot;Overview of Quantum Error Prevention and Leakage Elimination&amp;quot;&amp;lt;/nowiki&amp;gt;, ''Journal of Modern Optics'', Vol. '''51''', page 2449, (2004).&amp;lt;/div&amp;gt;&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Bohmqm&amp;quot;&amp;gt;Arno Bohm, ''Quantum Mechanics: Foundations and Applications'', 3rd Ed., Springer, New York, New York (1993).&amp;lt;/div&amp;gt;&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Tinkham:gpthbook&amp;quot;&amp;gt; Michael Tinkham. ''Group Theory and Quantum Mechanics''. McGraw-Hill, New York, New York, (1964).&amp;lt;/div&amp;gt;&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Kempeetal:01&amp;quot;&amp;gt; Kempe, J., Bacon, D., Lidar, D.A. and Whaley, K.B.,&amp;lt;nowiki&amp;gt;&amp;quot;Theory of Decoherence-Free, Fault-Tolerant, Universal Quantum Computation&amp;quot;&amp;lt;/nowiki&amp;gt; ''Physical Review A'', '''63''', 042307 (2001).&amp;lt;/div&amp;gt;&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Blanes/etal:08&amp;quot;&amp;gt;S. Blanes, F. Casas, J.A. Oteo, J. Ros, &amp;lt;nowiki&amp;gt;&amp;quot;The Magnus expansion and some of its applications&amp;quot;&amp;lt;/nowiki&amp;gt;, ''Physics Reports'', '''470''', 151 (2009).&lt;br /&gt;
#&amp;lt;div id=&amp;quot;LoeppNWootters&amp;quot;&amp;gt; Susan Loepp and William K. Wootters. ''Protecting Information: From Classical Error Correction to Quantum Cryptography''. Cambridge University Press, (2006).&amp;lt;/div&amp;gt;&lt;br /&gt;
#&amp;lt;div id=&amp;quot;LoPopescuSpiller&amp;quot;&amp;gt; Hoi-Kwong Lo, Sandu Popescu, Tim Spillier. ''Introduction to Quantum Computation and Information''. World Scientific, Singapore (1998).&amp;lt;/div&amp;gt;&lt;br /&gt;
#&amp;lt;div id=&amp;quot;GottDiss&amp;quot;&amp;gt; Daniel Gottesman ''Stabilizer Codes and Quantum Error Correction'', http://arxiv.org/abs/quant-ph/9705052.&amp;lt;/div&amp;gt;&lt;br /&gt;
#&amp;lt;div id=&amp;quot;quantiki&amp;quot;&amp;gt; Encyclopedia of quantum information: http://www.quantiki.org/wiki/Category:Handbook_of_Quantum_Information.&amp;lt;/div&amp;gt;&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Nielsen/etal&amp;quot;&amp;gt; M. A. Nielsen, Carlton M. Caves, Benjamine Schumacher, and Howard Barnum, ''Information-theoretic approach to quantum error correction and reversible measurement.'' http://arxiv.org/abs/quant-ph/9706064 &amp;lt;/div&amp;gt;&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Gottesman:rev09&amp;quot;&amp;gt; D. Gottesman, &amp;quot;An Introduction to Quantum Error Correction and Fault-Tolerant Quantum Computation,&amp;quot; in ''Quantum Information Science and Its Contributions to Mathematics, Proceedings of Symposia in Applied Mathematics'' '''68''', pp. 13-58 (Amer. Math. Soc., Providence, Rhode Island, 2010), http://arxiv.org/abs/0904.2557&amp;lt;/div&amp;gt;&lt;br /&gt;
#&amp;lt;div id=&amp;quot;CalderbankNShor&amp;quot;&amp;gt; A.R. Calderbank and P.W. Shor, &amp;quot;Good quantum error-correcting codes exist,&amp;quot; ''Phys. Rev. A'' '''54''', 1098 (1996).&amp;lt;/div&amp;gt;&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Steane:prl&amp;quot;&amp;gt; A.M. Steane, &amp;quot;Error correcting codes in quantum theory,&amp;quot; ''Phys. Rev. Lett.'' '''77''', 793 (1996).&amp;lt;/div&amp;gt;&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Steane:prsl&amp;quot;&amp;gt; A.M. Steane, &amp;quot;Multiple particle interference, &amp;quot; ''Proc. Roy. Soc. London A'' '''452''', 2551 (1996).&amp;lt;/div&amp;gt;&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Preskill:prsl&amp;quot;&amp;gt; J. Preskill, &amp;quot;Reliable Quantum Computers,&amp;quot; ''Proc. Roy. Soc. London A'' '''454''', 385-410 (1998).&amp;lt;/div&amp;gt;&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Lidar/et al:99&amp;quot;&amp;gt; D.A. Lidar, D. Bacon, K.B. Whaley, ''Phys. Rev. Lett.'' '''82''' (1999) 4556-4559.&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Bishop/etal:11&amp;quot;&amp;gt; C. Allen Bishop, Mark S. Byrd, Lian-Ao Wu, &amp;quot;Casimir Invariants for Systems Undergoing Collective Motion&amp;quot;, ''Phys. Rev. A'' '''83''', 062327 (2011).&amp;lt;/div&amp;gt;&lt;br /&gt;
#&amp;lt;div id=&amp;quot;GruberNO&amp;quot;&amp;gt; B. Gruber and L. O'Raifeartaigh, ''J. Math. Phys.'' '''5''', 1796, (1964).&amp;lt;/div&amp;gt;&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Macfarlane/etal&amp;quot;&amp;gt; A.J. Macfarlane, A. Sudbery and P.H. Weisz, ''Commun. Math. Phys.'' '''11''', 77 (1968).&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Byrd/Lidar:02&amp;quot;&amp;gt; Mark S. Byrd and D. A. Lidar, ''Phys. Rev. Lett.'' '''89''', 047901 (2002).&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Byrd/Lidar:ebb&amp;quot;&amp;gt; Mark S. Byrd and D. A. Lidar, ''Phys. Rev. A.'' '''67''', 012324 (2003).&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Zanardi:99a&amp;quot;&amp;gt; Paolo Zanardi, ''Phys.Lett. A'' '''258''' 77 (1999).&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Fowler/et al:12&amp;quot;&amp;gt; Austin  Fowler, Matteo Mariantoni, John  Martinis, Andrew  Cleland, &amp;quot;Surface codes: Towards practical large-scale quantum computation,&amp;quot; &amp;quot;http://arxiv.org/abs/1208.0928&amp;quot;, Submitted on 4 Aug 2012&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Fowler/et al:09&amp;quot;&amp;gt; Austin Fowler, Ashley Stephens, and Peter Groszkowski, ''Phy. Rev. A.'' '''80''', 052312 (2009)&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Wang/et al:10&amp;quot;&amp;gt; David Wang, Austin Fowler, and Lloyd Hollenberg, ''Phy. Rev. A.'' '''83''', 020302 (2010)&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Fowler/et al:11&amp;quot;&amp;gt; Austin  Fowler, David  Wang, and Lloyd Hollenberg, &amp;quot;Quantum Information &amp;amp; Computation&amp;quot;, '''11''', 8-18 (2011)&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Groszkowski:09&amp;quot;&amp;gt; Peter Groszkowski, ''Master thesis'', Waterloo, Ontario, Canada, 2009&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Ballentine:qmbook&amp;quot;&amp;gt; Leslie E. Ballentine. ''Quantum Mechanics: A Modern Development''. World Scientific, (1998).&amp;lt;/div&amp;gt;&lt;br /&gt;
#&amp;lt;div id=&amp;quot;EPR&amp;quot;&amp;gt; A. Einstein, B. Podolsky, and N. Rosen, ''Phys. Rev.'' '''47''', 777 (1935).&amp;lt;/div&amp;gt;&lt;br /&gt;
#&amp;lt;div id=&amp;quot;Wong&amp;quot;&amp;gt; Thomas G. Wong. ''Introduction to Classical and Quantum Computing''. Rooted Grove, Omaha, NE (2022).&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2943</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2943"/>
		<updated>2022-05-23T16:50:36Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* ASCII (American Standard Code for Information Interchange) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Put example here of dividing by 2, over and over, and keeping track of remainders, etc...&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 33 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2942</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2942"/>
		<updated>2022-05-23T16:48:35Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* ASCII (American Standard Code for Information Interchange) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Put example here of dividing by 2, over and over, and keeping track of remainders, etc...&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (i.e. binary numbers with 7 digits) to describe all the buttons on the keyboard: 32 of them are non-printable, such as the Ctrl key, the Shift key, etc., and the other 95 printable characters can be found here: [[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2941</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2941"/>
		<updated>2022-05-23T16:44:52Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* ASCII (American Standard Code for Information Interchange) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Put example here of dividing by 2, over and over, and keeping track of remainders, etc...&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (binary numbers So get yourself this table:&lt;br /&gt;
&lt;br /&gt;
[[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2940</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2940"/>
		<updated>2022-05-23T16:44:36Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Exercises */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Put example here of dividing by 2, over and over, and keeping track of remainders, etc...&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (binary numbers So get yourself this table:&lt;br /&gt;
&lt;br /&gt;
(Mark will make a table :)&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2939</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2939"/>
		<updated>2022-05-23T16:44:23Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* Exercises */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Put example here of dividing by 2, over and over, and keeping track of remainders, etc...&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (binary numbers So get yourself this table:&lt;br /&gt;
&lt;br /&gt;
(Mark will make a table :)&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Media:ASCII.Symbols.jpg|ASCII Binary Codes]]&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2938</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2938"/>
		<updated>2022-05-23T16:41:06Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* TESTING SECTION */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Put example here of dividing by 2, over and over, and keeping track of remainders, etc...&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (binary numbers So get yourself this table:&lt;br /&gt;
&lt;br /&gt;
(Mark will make a table :)&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Media:ASCII.Symbols.jpg]]&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=File:ASCII.Symbols.jpg&amp;diff=2937</id>
		<title>File:ASCII.Symbols.jpg</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=File:ASCII.Symbols.jpg&amp;diff=2937"/>
		<updated>2022-05-23T16:39:53Z</updated>

		<summary type="html">&lt;p&gt;Akelle: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2936</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2936"/>
		<updated>2022-05-23T16:33:06Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* ASCII (American Standard Code for Information Interchange) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Put example here of dividing by 2, over and over, and keeping track of remainders, etc...&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). This system uses 7 bits (binary numbers So get yourself this table:&lt;br /&gt;
&lt;br /&gt;
(Mark will make a table :)&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
	<entry>
		<id>https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2935</id>
		<title>Binary</title>
		<link rel="alternate" type="text/html" href="https://www2.physics.siu.edu/qunet/wiki/index.php?title=Binary&amp;diff=2935"/>
		<updated>2022-05-23T15:57:07Z</updated>

		<summary type="html">&lt;p&gt;Akelle: /* ASCII */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
==Why We Need (why we use) Binary==&lt;br /&gt;
&lt;br /&gt;
Classical computers only have 2 states, or output options, and therefore can only use two symbols to represent those two states. More complicated questions are the combination of multiple yes and no questions in a series. Computers often use binary code, using just 0 and 1 to store the data.  These are referred to as bits.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question.  A string of binary numbers such as &amp;quot;101&amp;quot; can thus be perceived as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Binary expressions can also be used to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five. This section will address how to convert binary numbers and the more common decimal numbers back and forth.&lt;br /&gt;
&lt;br /&gt;
The binary number system is thus useful in computing and it is the way how computers represent and store a series of values or a numbers.&lt;br /&gt;
&lt;br /&gt;
==Numbering Systems==&lt;br /&gt;
&lt;br /&gt;
While numbers seem like absolutes, there are actually several different ways to write these values.  One main difference in numbering systems is what we use as the base of the number.  The decimal system uses a base 10, meaning that there are 10 symbols (0-9) that are used.  Once you get past 9, you round up to a 1 in the tens position and start over at 0 in the ones position. A symbol in this instance is any single letter, number, or other symbol. &lt;br /&gt;
There are many other base systems, including Base 16 (hexabase), Base 8 (octobase), and Base 2 (binary).  Base 8 only uses 8 symbols (0-7) and binary only uses 2 symbols (0-1).  Base 16 is a bit more complex as the 16 symbols that are used include the number 0-9 as well as the letters A-F.&lt;br /&gt;
These base systems can still be used to represent the same numbers, and can be converted back and forth.  Specifically converting between base 10 and base 2 (decimal to binary) is helpful.&lt;br /&gt;
&lt;br /&gt;
The system you already understand very well is the decimal system, i.e. base 10, where we use 10 symbols (0,1,2,3,4,5,6,7,8,9). When keeping track of values larger than 9, multiple digits are necessary, where each digit represents a power of 10.  For example, the value &amp;lt;math&amp;gt;1067&amp;lt;/math&amp;gt; can be expanded to make this explicit: &lt;br /&gt;
­&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Dec.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now consider the binary system, i.e. base 2, where we only use 2 symbols to describe any value (0 and 1). When keeping track of values larger than 1, multiple digits are necessary, where each digit represents a power of 2. For example, the value &amp;lt;math&amp;gt;10110_2&amp;lt;/math&amp;gt; can be expanded to make this explicit (Note: the subscript &amp;quot;2&amp;quot; following the number means it is in base 2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:Bin.jpg|325px]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Decimal to Binary Conversion===&lt;br /&gt;
&lt;br /&gt;
Since we (as humans) have been trained to count and keep track of stuff using decimal symbols, and the computer needs to use binary symbols, it is useful to know how to convert between the two.  For example, consider the decimal numerals 0 through 7, and the corresponding binary representation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Put example here of dividing by 2, over and over, and keeping track of remainders, etc...&lt;br /&gt;
&lt;br /&gt;
===Binary to Decimal Conversion===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===ASCII (American Standard Code for Information Interchange)===&lt;br /&gt;
&lt;br /&gt;
The computer needs to use binary strings to represent any characters, not just numerical values. How to rpresent the letter &amp;quot;w&amp;quot;? or the uppercase &amp;quot;W&amp;quot;? and so on... this was originally handled by using the American Staqndard for Information Interchange (ASCII, pronounced &amp;quot;ass-key, lol). So get yourself this table:&lt;br /&gt;
&lt;br /&gt;
(Mark will make a table :)&lt;br /&gt;
&lt;br /&gt;
===Binary Addition===&lt;br /&gt;
&lt;br /&gt;
Adding binary numbers, by hand, is identical to the process one learns in gradeschool when adding decimal numbers. In decimal addition, if you add 5 + 5 then you get 10. When computing this sum, you get a digit of 0 and a carry digit of 1. If adding 6 + 6, then you get a digit of 2 with a carry digit of 1, and thus an answer of 12.&lt;br /&gt;
&lt;br /&gt;
In binary, if you add 1 + 1, the sum is written as 10, because after summing 1 + 1 you get a digit of 0 and a carry of 1:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 + 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 + 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \;\; 1 + 1 = 10 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When adding binary numbers with multiple digits, the same approach is applied, as demonstrated in the following examples:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Figure B.1&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:BinaryAdd.jpg|470px]]&lt;br /&gt;
&amp;lt;!-- How to add binary numbers when carrying is necessary.--&amp;gt;  &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Binary Logic===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 0 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 0 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 0 \oplus 1 = 1 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1 \oplus 1 = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conclusion (gearing up for logic gates)==&lt;br /&gt;
&lt;br /&gt;
We have just studied how to use binary expressions to represent numbers:  e.g., 101 stands for the number five.  So, when the computer stores &amp;quot;101&amp;quot; in its bit registers, you can think of the computer as storing the number five.&lt;br /&gt;
&lt;br /&gt;
But here is an interesting shift of perspective:  because &amp;quot;1&amp;quot; and &amp;quot;0&amp;quot; are just symbols and &amp;quot;101&amp;quot; is just a bunch of symbols, you can read them as representing a different kind of thing.  One important reading of the symbols is to read &amp;quot;1&amp;quot; as &amp;quot;Yes&amp;quot; and &amp;quot;0&amp;quot; as &amp;quot;No&amp;quot; to a given Yes/No question, and &amp;quot;101&amp;quot; as &amp;quot;Yes, No, Yes&amp;quot; to three Yes/No questions:  e.g., &amp;quot;101&amp;quot; may stand for &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Computers are good at manipulating binary numbers.  This, combined with the &amp;quot;Yes/No&amp;quot; perspective, means that computers are also good at calculating answers to Yes/No questions:  e.g., given &amp;quot;Yes, it is Sunday; No, it is not raining; Yes, it is hot&amp;quot;, the computer can now calculate what the answer is to the question &amp;quot;Is it hot Sunday?&amp;quot; (the answer is Yes).  This sort of &amp;quot;Yes/No&amp;quot; calculation is called &amp;quot;logic&amp;quot;, and computers execute it by applying &amp;quot;logic gates&amp;quot; to bit registers.  Indeed, that is how computers manipulate numbers --- computers execute operations such as addition of two numbers by actually applying logic gates and executing very complicated logic calculations!&lt;br /&gt;
&lt;br /&gt;
=TESTING SECTION=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;div id=&amp;quot;TableB.1&amp;quot;&amp;gt;&amp;lt;big&amp;gt;'''TABLE B.1'''&amp;lt;/big&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;bottom&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|Binary&lt;br /&gt;
|Decimal&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|000&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|0&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|001&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|1&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|010&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|2&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|011&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|3&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|100&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|4&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|101&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|5&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|110&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|6&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|111&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|7&lt;br /&gt;
|}&lt;br /&gt;
Table B1: ''Examples of Binary/Decimal Correspondence.''&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exercises===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:upper-roman&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following decimal numbers to binary:&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;5&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;108&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;3047&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Convert the following binary numbers to decimal&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1011001_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Add these binary numbers&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;1001_2+10110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110_2+101_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;&amp;lt;math&amp;gt;110011_2+1110_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Challenge Questions&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Convert the following binary number into base 3: &amp;lt;math&amp;gt;11011_2&amp;lt;/math&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Eigenvalues and Eigenvectors&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Tensor Products&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;ol style=&amp;quot;list-style-type:decimal&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;About the author&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the first edition&amp;lt;/li&amp;gt;&lt;br /&gt;
       &amp;lt;li&amp;gt;Foreword to the second edition&amp;lt;/li&amp;gt;&lt;br /&gt;
     &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Akelle</name></author>
		
	</entry>
</feed>