new file: Files/flashplayer_32_sa.exe new file: favicon.ico new file: globe.gif new file: imgs/download.png new file: imgs/zuck.jpg new file: index.html new file: other.ico new file: script.js new file: site.webmanifest new file: sitemap.html new file: styles/backround.css new file: styles/border.css new file: styles/fonts/Titillium_Web/OFL.txt new file: styles/fonts/Titillium_Web/TitilliumWeb-Black.ttf new file: styles/fonts/Titillium_Web/TitilliumWeb-Bold.ttf new file: styles/fonts/Titillium_Web/TitilliumWeb-BoldItalic.ttf new file: styles/fonts/Titillium_Web/TitilliumWeb-ExtraLight.ttf new file: styles/fonts/Titillium_Web/TitilliumWeb-ExtraLightItalic.ttf new file: styles/fonts/Titillium_Web/TitilliumWeb-Italic.ttf new file: styles/fonts/Titillium_Web/TitilliumWeb-Light.ttf new file: styles/fonts/Titillium_Web/TitilliumWeb-LightItalic.ttf new file: styles/fonts/Titillium_Web/TitilliumWeb-Regular.ttf new file: styles/fonts/Titillium_Web/TitilliumWeb-SemiBold.ttf new file: styles/fonts/Titillium_Web/TitilliumWeb-SemiBoldItalic.ttf new file: styles/fonts/webfontkit-20221027-163353/generator_config.txt new file: styles/fonts/webfontkit-20221027-163353/specimen_files/grid_12-825-55-15.css new file: styles/fonts/webfontkit-20221027-163353/specimen_files/specimen_stylesheet.css new file: styles/fonts/webfontkit-20221027-163353/stylesheet.css new file: styles/fonts/webfontkit-20221027-163353/titilliumweb-extralight-demo.html new file: styles/fonts/webfontkit-20221027-163353/titilliumweb-extralight-webfont.woff new file: styles/fonts/webfontkit-20221027-163353/titilliumweb-extralight-webfont.woff2 new file: styles/fonts/webfontkit-20221027-165950/generator_config.txt new file: styles/fonts/webfontkit-20221027-165950/specimen_files/grid_12-825-55-15.css new file: styles/fonts/webfontkit-20221027-165950/specimen_files/specimen_stylesheet.css new file: styles/fonts/webfontkit-20221027-165950/stylesheet.css new file: styles/fonts/webfontkit-20221027-165950/titilliumweb-bold-demo.html new file: styles/fonts/webfontkit-20221027-165950/titilliumweb-bold-webfont.woff new file: styles/fonts/webfontkit-20221027-165950/titilliumweb-bold-webfont.woff2 new file: styles/style.css new file: tools/2048/.gitignore new file: tools/2048/.jshintrc new file: tools/2048/CONTRIBUTING.md new file: tools/2048/LICENSE.txt new file: tools/2048/README.md new file: tools/2048/Rakefile new file: tools/2048/favicon.ico new file: tools/2048/index.html new file: tools/2048/js/animframe_polyfill.js new file: tools/2048/js/application.js new file: tools/2048/js/bind_polyfill.js new file: tools/2048/js/classlist_polyfill.js new file: tools/2048/js/game_manager.js new file: tools/2048/js/grid.js new file: tools/2048/js/html_actuator.js new file: tools/2048/js/keyboard_input_manager.js new file: tools/2048/js/local_storage_manager.js new file: tools/2048/js/tile.js new file: tools/2048/meta/apple-touch-icon.png new file: tools/webretro/cores/neocd_libretro.js new file: tools/webretro/cores/neocd_libretro.wasm new file: tools/webretro/cores/nestopia_libretro.js new file: tools/webretro/cores/nestopia_libretro.wasm new file: tools/webretro/cores/o2em_libretro.js new file: tools/webretro/cores/o2em_libretro.wasm new file: tools/webretro/cores/opera_libretro.js new file: tools/webretro/cores/opera_libretro.wasm
623 lines
24 KiB
HTML
623 lines
24 KiB
HTML
<!doctype html>
|
|
<html lang="en"><!-- #BeginTemplate "/Templates/Main.dwt" --><!-- DW6 -->
|
|
|
|
<!-- Mirrored from www.mathsisfun.com/binary-digits.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 29 Oct 2022 00:38:37 GMT -->
|
|
<head>
|
|
<!-- #BeginEditable "doctitle" -->
|
|
<title>Binary Digits</title>
|
|
<script type="text/javascript">
|
|
function swap(el) {
|
|
if (el.src.indexOf("switch-1.html")>0) {
|
|
el.src="numbers/images/switch-0.gif"
|
|
} else {
|
|
el.src="numbers/images/switch-1.gif"
|
|
}
|
|
}
|
|
</script>
|
|
<!-- #EndEditable -->
|
|
<meta name="keywords" content="math, maths, mathematics, school, homework, education">
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
|
<meta name="HandheldFriendly" content="true">
|
|
<meta http-equiv="pics-label" content='(PICS-1.1 "http://www.classify.org/safesurf/" L gen true for "http://www.mathsisfun.com" r (SS~~000 1))'>
|
|
<link rel="stylesheet" type="text/css" href="style3.css" />
|
|
<script src="main3.js" type="text/javascript"></script>
|
|
</head>
|
|
|
|
<body id="bodybg">
|
|
<div class="bg">
|
|
<div id="stt"></div>
|
|
<div id="hdr"></div>
|
|
<div id="logo"><a href="index.html"><img src="images/style/logo.svg" alt="Math is Fun" /></a></div>
|
|
<div id="gtran"><script type="text/javascript">document.write(getTrans());</script></div>
|
|
<div id="gplus"><script type="text/javascript">document.write(getGPlus());</script></div>
|
|
<div id="adTopOuter" class="centerfull noprint">
|
|
<div id="adTop">
|
|
<script type="text/javascript">document.write(getAdTop());</script>
|
|
</div>
|
|
</div>
|
|
<div id="adHide">
|
|
<div id="showAds1"><a href="javascript:showAds()">Show Ads</a></div>
|
|
<div id="hideAds1"><a href="javascript:hideAds()">Hide Ads</a><br>
|
|
<a href="about-ads.html">About Ads</a></div>
|
|
</div>
|
|
<div id="menuWide" class="menu">
|
|
<script type="text/javascript">document.write(getMenu(0));</script>
|
|
</div>
|
|
<div id="linkto">
|
|
<div id="linktort"><script type="text/javascript">document.write(getLinks());</script></div>
|
|
</div>
|
|
<div id="search" role="search"><script type="text/javascript">document.write(getSearch());</script></div>
|
|
<div id="menuSlim" class="menu">
|
|
<script type="text/javascript">document.write(getMenu(1));</script>
|
|
</div>
|
|
<div id="menuTiny" class="menu">
|
|
<script type="text/javascript">document.write(getMenu(2));</script>
|
|
</div>
|
|
<div id="extra"></div>
|
|
</div>
|
|
<div id="content" role="main"><!-- #BeginEditable "Body" -->
|
|
|
|
<h1 align="center">Binary Digits</h1>
|
|
<table border="0" align="center">
|
|
<tr>
|
|
<td><img src="images/art/sage-with-0-1.gif" width="121" height="224" alt="dog with 0 1" /></td>
|
|
<td class="larger">A Binary Digit can only be <b>0</b> or <b>1</b></td>
|
|
</tr>
|
|
</table>
|
|
<table border="0" align="center">
|
|
<tr>
|
|
<td><h2>Binary Number</h2>
|
|
<p>A <a href="binary-number-system.html">Binary Number</a> is made up Binary Digits. </p></td>
|
|
<td> </td>
|
|
<td><img src="numbers/images/binary-digits.svg" alt="binary 110" /></td>
|
|
</tr>
|
|
</table>
|
|
<div class="words">
|
|
<p> In the computer world "<b>b</b>inary dig<b>it</b>" is often shortened to the word "<b>bit</b>"</p>
|
|
</div>
|
|
<h2>More Than One Digit</h2>
|
|
<p>So, there are only two ways we can have a binary digit (<i><i>"0" and "1"</i></i>, or <i>"On" and "Off"</i>) ... but what about 2 or more binary digits? </p>
|
|
<p>Let's write them all down, starting with 1 digit (you can test it yourself using the switches):</p>
|
|
<table width="90%" border="0" align="center">
|
|
<tr>
|
|
<td width="49%" align="center">
|
|
2 ways to have one digit ...<br />
|
|
<img src="numbers/images/switch-0.gif" alt="switch" width="42" height="66" style="cursor: pointer; cursor: hand;" onclick="swap(this)">
|
|
</td>
|
|
<td width="51%" align="center">
|
|
<div class="simple">
|
|
<table>
|
|
<tr>
|
|
<td><b>0</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td><b>1</b></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="49%" align="center">
|
|
|
|
... 4 ways to have two digits ...<br />
|
|
<img src="numbers/images/switch-0.gif" alt="switch" width="42" height="66" style="cursor: pointer; cursor: hand;" onclick="swap(this)">
|
|
<img src="numbers/images/switch-0.gif" alt="switch" width="42" height="66" style="cursor: pointer; cursor: hand;" onclick="swap(this)">
|
|
</td>
|
|
<td width="51%" align="center">
|
|
<div class="simple">
|
|
<table>
|
|
<tr align="center">
|
|
<td rowspan="2" width="20"><b>0</b></td>
|
|
<td width="20">0</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>00</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="20">1</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>01</td>
|
|
</tr>
|
|
<tr align="center">
|
|
<td rowspan="2" width="20"><b>1</b></td>
|
|
<td width="20">0</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>10</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="20">1</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>11</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="49%" align="center">
|
|
... 8 ways to have three digits ...<br />
|
|
<img src="numbers/images/switch-0.gif" alt="switch" width="42" height="66" style="cursor: pointer; cursor: hand;" onclick="swap(this)">
|
|
<img src="numbers/images/switch-0.gif" alt="switch" width="42" height="66" style="cursor: pointer; cursor: hand;" onclick="swap(this)">
|
|
<img src="numbers/images/switch-0.gif" alt="switch" width="42" height="66" style="cursor: pointer; cursor: hand;" onclick="swap(this)">
|
|
</td>
|
|
<td width="51%" align="center">
|
|
<div class="simple">
|
|
<table>
|
|
<tr align="center">
|
|
<td rowspan="4" width="20"><b>0</b></td>
|
|
<td rowspan="2" width="20">0</td>
|
|
<td height="14" width="20">0</td>
|
|
<td width="30" height="14" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td height="14">000</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="20">1</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>001</td>
|
|
</tr>
|
|
<tr>
|
|
<td rowspan="2" width="20">1</td>
|
|
<td width="20">0</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>010</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="20">1</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>011</td>
|
|
</tr>
|
|
<tr align="center">
|
|
<td rowspan="4" width="20"><b>1</b></td>
|
|
<td rowspan="2" width="20">0</td>
|
|
<td width="20">0</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>100</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="20">1</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>101</td>
|
|
</tr>
|
|
<tr>
|
|
<td rowspan="2" width="20">1</td>
|
|
<td width="20">0</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>110</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="20">1</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>111</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="49%" align="center">
|
|
... and 16 ways to have four digits.<br />
|
|
<img src="numbers/images/switch-0.gif" alt="switch" width="42" height="66" style="cursor: pointer; cursor: hand;" onclick="swap(this)">
|
|
<img src="numbers/images/switch-0.gif" alt="switch" width="42" height="66" style="cursor: pointer; cursor: hand;" onclick="swap(this)">
|
|
<img src="numbers/images/switch-0.gif" alt="switch" width="42" height="66" style="cursor: pointer; cursor: hand;" onclick="swap(this)">
|
|
<img src="numbers/images/switch-0.gif" alt="switch" width="42" height="66" style="cursor: pointer; cursor: hand;" onclick="swap(this)">
|
|
</td>
|
|
<td width="51%" align="center">
|
|
<div class="simple">
|
|
<table>
|
|
<tr align="center">
|
|
<td rowspan="8" width="20"><b>0</b></td>
|
|
<td rowspan="4" width="20">0</td>
|
|
<td rowspan="2" width="20">0</td>
|
|
<td height="14" width="20">0</td>
|
|
<td width="30" height="14" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td height="14">0000</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="20">1</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>0001</td>
|
|
</tr>
|
|
<tr>
|
|
<td rowspan="2" width="20">1</td>
|
|
<td width="20">0</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>0010</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="20">1</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>0011</td>
|
|
</tr>
|
|
<tr align="center">
|
|
<td rowspan="4" width="20">1</td>
|
|
<td rowspan="2" width="20">0</td>
|
|
<td width="20">0</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>0100</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="20">1</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>0101</td>
|
|
</tr>
|
|
<tr>
|
|
<td rowspan="2" width="20">1</td>
|
|
<td width="20">0</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>0110</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="20">1</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>0111</td>
|
|
</tr>
|
|
<tr align="center">
|
|
<td rowspan="8" width="20"><b>1</b></td>
|
|
<td rowspan="4" width="20">0</td>
|
|
<td rowspan="2" width="20">0</td>
|
|
<td height="14" width="20">0</td>
|
|
<td width="30" height="14" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td height="14">1000</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="20">1</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>1001</td>
|
|
</tr>
|
|
<tr>
|
|
<td rowspan="2" width="20">1</td>
|
|
<td width="20">0</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>1010</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="20">1</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>1011</td>
|
|
</tr>
|
|
<tr align="center">
|
|
<td rowspan="4" width="20">1</td>
|
|
<td rowspan="2" width="20">0</td>
|
|
<td width="20">0</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>1100</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="20">1</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>1101</td>
|
|
</tr>
|
|
<tr>
|
|
<td rowspan="2" width="20">1</td>
|
|
<td width="20">0</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>1110</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="20">1</td>
|
|
<td width="30" align="center" bgcolor="#FFFFFF">→</td>
|
|
<td>1111</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<p>Here is that last list sideways:</p>
|
|
<table border="1" align="center" cellpadding="2" cellspacing="0">
|
|
<tr align="center">
|
|
<td width="21">0000</td>
|
|
<td width="21">0001</td>
|
|
<td width="21">0010</td>
|
|
<td width="21">0011</td>
|
|
<td width="21">0100</td>
|
|
<td width="21">0101</td>
|
|
<td width="21">0110</td>
|
|
<td width="21">0111</td>
|
|
<td width="21">1000</td>
|
|
<td width="21">1001</td>
|
|
<td width="21">1010</td>
|
|
<td width="21">1011</td>
|
|
<td width="21">1100</td>
|
|
<td width="21">1101</td>
|
|
<td width="21">1110</td>
|
|
<td width="21">1111</td>
|
|
</tr>
|
|
</table>
|
|
<p>And (without the leading 0s) we have the first 16 <a href="binary-number-system.html">binary numbers</a>:</p>
|
|
<table border="1" align="center" cellpadding="2" cellspacing="0">
|
|
<tr align="center">
|
|
<th width="100">Binary:</th>
|
|
<td width="21">0</td>
|
|
<td width="21">1</td>
|
|
<td width="21">10</td>
|
|
<td width="21">11</td>
|
|
<td width="21">100</td>
|
|
<td width="21">101</td>
|
|
<td width="21">110</td>
|
|
<td width="21">111</td>
|
|
<td width="21">1000</td>
|
|
<td width="21">1001</td>
|
|
<td width="21">1010</td>
|
|
<td width="21">1011</td>
|
|
<td width="21">1100</td>
|
|
<td width="21">1101</td>
|
|
<td width="21">1110</td>
|
|
<td width="21">1111</td>
|
|
</tr>
|
|
<tr align="center">
|
|
<th>Decimal:</th>
|
|
<td>0</td>
|
|
<td>1</td>
|
|
<td>2</td>
|
|
<td>3</td>
|
|
<td>4</td>
|
|
<td>5</td>
|
|
<td>6</td>
|
|
<td>7</td>
|
|
<td>8</td>
|
|
<td>9</td>
|
|
<td>10</td>
|
|
<td>11</td>
|
|
<td>12</td>
|
|
<td>13</td>
|
|
<td>14</td>
|
|
<td>15</td>
|
|
</tr>
|
|
</table>
|
|
<p>This is useful! To remember the sequence of binary numbers just think: </p>
|
|
<ul>
|
|
<li>"0" and "1" <b>{<span class="hilite">0,1</span>}</b></li>
|
|
<li>then repeat "0" and "1" again but with a "1" in front: <b>{0,1,<span class="hilite">10,11</span>}</b></li>
|
|
<li>then repeat <i>those</i> with a "1" in front: <b>{0,1,10,11,<span class="hilite">100,101,110,111</span>}</b></li>
|
|
<li>and so on!</li>
|
|
</ul>
|
|
<p>At each stage we repeat everything we have so far, but with a 1 in front.</p>
|
|
<p>Now find out how to use Binary to count past 1,000 on your fingers: </p>
|
|
<div class="activity"><a href="numbers/binary-count-fingers.html">Activity: Binary Fingers</a></div>
|
|
<table border="0" align="center">
|
|
<tr>
|
|
<td><img src="games/images/hex-drums.gif" width="100" height="88" alt="hex drums" /></td>
|
|
<td>Also have a Play with <a href="games/hex-drums.html">different drums</a>.</td>
|
|
</tr>
|
|
</table>
|
|
<h2>Binary Digits ... They Double!</h2>
|
|
<p>Also notice that each time we add another binary digit we <b>double</b> the possible values. </p>
|
|
<p>Why <i><b>double</b></i>? Because we take all the previous possible values and match them with a "0" and a "1" like above.</p>
|
|
<ul>
|
|
<li>So just one binary digit has 2 possible values (0 and 1)</li>
|
|
<li>Two binary digits have 4 possible values (0, 1, 10, 11)</li>
|
|
<li>Three have 8 possible values </li>
|
|
<li>Four have 16 possible values </li>
|
|
<li>Five have 32 possible values </li>
|
|
<li>Six have 64 possible values</li>
|
|
<li>etc.</li>
|
|
</ul>
|
|
<p>Using <a href="exponent.html">exponents</a>, this can be shown as:</p>
|
|
<table border="0" align="center">
|
|
<tr align="center">
|
|
<th width="110">Number<br>
|
|
of Digits</th>
|
|
<th width="110">Formula</th>
|
|
<th width="110">Settings</th>
|
|
</tr>
|
|
<tr align="center">
|
|
<td width="110">1</td>
|
|
<td width="110">2<sup>1</sup></td>
|
|
<td width="110">2</td>
|
|
</tr>
|
|
<tr align="center">
|
|
<td width="110">2</td>
|
|
<td width="110">2<sup>2</sup></td>
|
|
<td width="110">4</td>
|
|
</tr>
|
|
<tr align="center">
|
|
<td width="110">3</td>
|
|
<td width="110">2<sup>3</sup></td>
|
|
<td width="110">8</td>
|
|
</tr>
|
|
<tr align="center">
|
|
<td width="110">4</td>
|
|
<td width="110">2<sup>4</sup></td>
|
|
<td width="110">16</td>
|
|
</tr>
|
|
<tr align="center">
|
|
<td width="110">5</td>
|
|
<td width="110">2<sup>5</sup></td>
|
|
<td width="110">32</td>
|
|
</tr>
|
|
<tr align="center">
|
|
<td width="110">6</td>
|
|
<td width="110">2<sup>6</sup></td>
|
|
<td width="110">64</td>
|
|
</tr>
|
|
<tr align="center">
|
|
<td width="110">etc...</td>
|
|
<td width="110">etc.<sup>..</sup></td>
|
|
<td width="110">etc...</td>
|
|
</tr>
|
|
</table>
|
|
<div class="example">
|
|
<h3>Example: when we have 50 binary digits (or 50 things that can only have two positions each), how many different ways is that?</h3>
|
|
<p class="center">Answer: 2<sup>50</sup> = 2 × 2 × 2 × 2 × 2 ... (fifty of these) <br>
|
|
= <b>1,125,899,906,842,624</b></p>
|
|
</div>
|
|
<p>So, a binary number with 50 digits could have 1,125,899,906,842,624 different values.</p>
|
|
<p>Or to put it another way, it could show a number up to 1,125,899,906,842,623 (note: this is one less than the total number of values, because one of the values is 0).</p>
|
|
<div class="example">
|
|
<h3>Example: Start the month with $1 and double it every day, after 30 days you will be a <b>billionaire</b>!</h3>
|
|
<p class="center">2<sup>30</sup> = 2 × 2 × 2 × 2 ... (thirty of these) <br>
|
|
= <b>1,073,741,824</b></p>
|
|
</div>
|
|
|
|
<h2>Chess Board</h2>
|
|
<p><img src="images/chess-board.gif" alt="chess board" width="150" height="149" style="float:left; margin: 10px;" />
|
|
</p>
|
|
<p>There is an old Indian legend about a King who was challenged to a game of chess by a visiting Sage. The King asked "what is the prize if you win?". </p>
|
|
<p>The Sage said he would simply like some grains of rice: one on the first square, 2 on the second, 4 on the third and so on, doubling on each square. The King was surprised by this humble request.</p>
|
|
<p>Well, the Sage won, so how many grains of rice should he receive?</p>
|
|
<p> On the first square: 1 grain, on the second square: 2 grains (for a total of 3) and so on like this:</p>
|
|
<table border="0" align="center">
|
|
<tr align="center">
|
|
<th width="110">Square</th>
|
|
<th width="110">Grains</th>
|
|
<th width="110">Total</th>
|
|
</tr>
|
|
<tr align="center">
|
|
<td width="110">1</td>
|
|
<td width="110">1</td>
|
|
<td width="110">1</td>
|
|
</tr>
|
|
<tr align="center">
|
|
<td width="110">2</td>
|
|
<td width="110">2</td>
|
|
<td width="110">3</td>
|
|
</tr>
|
|
<tr align="center">
|
|
<td width="110">3</td>
|
|
<td width="110">4</td>
|
|
<td width="110">7</td>
|
|
</tr>
|
|
|
|
<tr align="center">
|
|
<td width="110">4</td>
|
|
<td width="110">8</td>
|
|
<td width="110">15</td>
|
|
</tr>
|
|
<tr align="center" bgcolor="#0000FF">
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
<tr align="center">
|
|
<td width="110">10</td>
|
|
<td width="110">512</td>
|
|
<td width="110">1,027</td>
|
|
</tr>
|
|
<tr align="center" bgcolor="#0000FF">
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
<tr align="center">
|
|
<td width="110">20</td>
|
|
<td width="110">524,288<br />
|
|
</td>
|
|
<td width="110">1,048,575</td>
|
|
</tr>
|
|
<tr align="center" bgcolor="#0000FF">
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
<tr align="center">
|
|
<td width="110">30</td>
|
|
<td width="110">53,6870,912<br />
|
|
</td>
|
|
<td width="110">1,073,741,823</td>
|
|
</tr>
|
|
|
|
<tr align="center" bgcolor="#0000FF">
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
<tr align="center">
|
|
<td width="110">64</td>
|
|
<td width="110">???<br />
|
|
</td>
|
|
<td width="110">???</td>
|
|
</tr>
|
|
|
|
|
|
</table>
|
|
<p>By the 30th square you can see it is already a lot of rice! A billion grains of rice is about 25 tonnes (1,000 grains is about 25g ... I weighed some!)</p>
|
|
<p>Notice that the <b>Total</b> of any square is 1 less than the <b>Grains</b> on the next square (Example: square 3's total is 7, and square 4 has 8 grains). So the total of all squares is a formula: <b>2<sup>n</sup>−1</b>, where <b>n</b> is the number of the square. For example, for square 3, the total is <b>2<sup>3</sup>−1</b> = 8<b>−</b>1 = 7</p>
|
|
<div class="example">
|
|
<p>So, to fill all 64 squares in a chess board would need:</p>
|
|
<p class="center"> <b>2<sup>64</sup>−1</b> = 18,446,744,073,709,551,615 grains (460 billion tonnes of rice), </p>
|
|
<p>many times more rice than in the whole kingdom. </p>
|
|
</div>
|
|
<p>So, the power of binary doubling is nothing to be taken lightly (460 billion tonnes is not light!)</p>
|
|
<p class="center"><img src="numbers/images/chess-board-double.svg"><br>
|
|
<b>Grains of rice on each square using <a href="numbers/scientific-notation.html">scientific notation</a></b><br>
|
|
<i>Values are rounded off, so
|
|
53,6870,912 is shown as just 5×10<sup>8</sup><br>
|
|
which means a 5 followed by 8 zeros</i> </p>
|
|
<p>(By the way, in the legend the Sage reveals himself to be <i>Lord Krishna</i> and tells the King that he doesn't have to pay the debt at once, but can pay him over time, just serve rice to pilgrims every day until the debt is paid off.)<br />
|
|
</p>
|
|
<h2>Hexadecimal</h2>
|
|
<p>Lastly, let us look at the special relationship between Binary and <a href="hexadecimals.html">Hexadecimal</a>.</p>
|
|
<p>There are 16 Hexadecimal digits, and we already know that 4 binary digits have 16 possible values. Well, this is exactly how they relate to each other:</p>
|
|
<div class="simple">
|
|
<table border="0" align="center">
|
|
|
|
<tr align="center">
|
|
<th>Binary:</th>
|
|
<td>0</td>
|
|
<td>1</td>
|
|
<td>10</td>
|
|
<td>11</td>
|
|
<td>100</td>
|
|
<td>101</td>
|
|
<td>110</td>
|
|
<td>111</td>
|
|
<td>1000</td>
|
|
<td>1001</td>
|
|
<td>1010</td>
|
|
<td>1011</td>
|
|
<td>1100</td>
|
|
<td>1101</td>
|
|
<td>1110</td>
|
|
<td>1111</td>
|
|
</tr>
|
|
<tr align="center">
|
|
<th>Hexadecimal:</th>
|
|
<td>0</td>
|
|
<td>1</td>
|
|
<td>2</td>
|
|
<td>3</td>
|
|
<td>4</td>
|
|
<td>5</td>
|
|
<td>6</td>
|
|
<td>7</td>
|
|
<td>8</td>
|
|
<td>9</td>
|
|
<td>A</td>
|
|
<td>B</td>
|
|
<td>C</td>
|
|
<td>D</td>
|
|
<td>E</td>
|
|
<td>F</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<p>So, when people use computers (which prefer binary numbers), it is a lot easier to use the single hexadecimal digit rather than 4 binary digits.</p>
|
|
<p>For example, the binary number "100110110100" is "9B4" in hexadecimal. I know which I would prefer to write!</p>
|
|
<p> </p>
|
|
<div class="related">
|
|
<a href="binary-number-system.html">Binary Number System</a>
|
|
<a href="binary-decimal-hexadecimal.html">Binary Decimal and Hexadecimal Numbers</a>
|
|
<a href="binary-decimal-hexadecimal-converter.html">Binary to Decimal to Hexadecimal Converter</a>
|
|
<a href="decimals.html">Decimal Numbers</a>
|
|
<a href="hexadecimals.html">Hexadecimal Number System</a>
|
|
<a href="exponent.html">Exponents</a>
|
|
</div>
|
|
<!-- #EndEditable --></div>
|
|
<div id="adend" class="centerfull noprint">
|
|
<script type="text/javascript">document.write(getAdEnd());</script>
|
|
</div>
|
|
<div id="footer" class="centerfull noprint">
|
|
<script type="text/javascript">document.write(getFooter());</script>
|
|
</div>
|
|
<div id="copyrt">
|
|
Copyright © 2017 MathsIsFun.com
|
|
</div>
|
|
|
|
<script type="text/javascript">document.write(getBodyEnd());</script>
|
|
</body>
|
|
<!-- #EndTemplate -->
|
|
<!-- Mirrored from www.mathsisfun.com/binary-digits.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 29 Oct 2022 00:38:39 GMT -->
|
|
</html>
|