forked from r0nk/simplecpu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadder.html
53 lines (51 loc) · 1.58 KB
/
adder.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<html>
<body>
<div class="wrap">
<ul>
<li><a href="Binary.html"><b>SimpleCPU.com</b></a> </li>
<li><a href="about.html">about</a></li>
</ul><br>
<div class="content">
But what can we <i>do</i> with the numbers we stored?<br>
<br>
We can do math with those numbers.<br>
<p>
This next device is called an 'adder'. It adds together two bits.<br>
</div>
<canvas id="gates" width="450" height="480"></canvas><br>
<div class="content">
In decimal, if you were to add 5 + 5, you would carry the 1 over to make <br>
a 10. The same thing happens in binary when we add 1 + 1, we carry over<br>
(or out) a binary 1.<br>
<br>
If we have multiple bits we want to add, we can combine these devices by<br>
connecting one's carry in to another's carry out.<br>
<br>
<div class="center">
<a href="moreGates.html">
<img src="Left.png" alt="<left" style="width:50px;height:80px;" align="middle">
</a>
5/8
<a href="code.html">
<img src="Right.png" alt="next>" style="width:50px;height:80px;" align="middle">
</a>
</div>
<br>
</div>
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-55886101-1', 'auto');
ga('send', 'pageview');
</script>
<script src="gateLib.js"></script>
<script src="adder.js"></script>
</body>
</html>