-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
207 lines (191 loc) · 4.93 KB
/
index.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Logic gates</title>
<link href="styles/style.css" rel="stylesheet" />
<link
href="https://fonts.googleapis.com/css?family=Noto+Sans"
rel="stylesheet"
/>
</head>
<body>
<h1>Logic gates</h1>
<h2>What are logic gates?</h2>
<p id="greeting"></p>
<p>
Logic gates are devices that take in one or more binary values as inputs
and produces a single binary value as output.
</p>
<p>
They can be connected together to construct more complex devices such as:
</p>
<ul>
<li>Computers</li>
<li>Smartphones</li>
<li>Microprocessors</li>
<li>Microcontrollers</li>
</ul>
<h2>The different types of logic gates</h2>
<div>
<h3>The AND gate</h3>
<img
src="images/and-gate.svg"
alt="AND gate symbol with inputs A and B and output C"
/>
<table align="right">
<caption>
AND gate truth table
</caption>
<tr>
<th colspan="2">Inputs</th>
<th>Output</th>
</tr>
<tr>
<th>A</th>
<th>B</th>
<th>C</th>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
</table>
<p>
Now let's begin with the most popular gate, the AND gate. you've most
likely heard about it before, and maybe wondered, why is it called an
AND gate? well, you probably didn't wonder about that, but assuming you
did. it's called that because it outputs a 1 only when both its inputs
are a 1. in other words, C will be 1 if and only if both A
<strong>and</strong> B are 1.
</p>
<p>
For further information consider reading the
<a href="https://en.wikipedia.org/wiki/AND_gate">AND gate wikipage</a>
</p>
</div>
<div>
<h3>The OR gate</h3>
<img
src="images/or-gate.svg"
alt="OR gate symbol with inputs A and B and output C"
/>
<table align="right">
<caption>
OR gate truth table
</caption>
<tr>
<th colspan="2">Inputs</th>
<th>Output</th>
</tr>
<tr>
<th>A</th>
<th>B</th>
<th>C</th>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>1</td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
</table>
<p>
Now that we're done with the AND gate, it follows that there an OR gate.
Okay, so why is it called an OR gate? yep you've guessed it, because it
outputs a 1 when either its inputs are a 1. in other words, C will be 1
if either A <strong>or</strong> B are 1.
</p>
<p>
For further information consider reading the
<a href="https://en.wikipedia.org/wiki/OR_gate">OR gate wikipage</a>
</p>
</div>
<div>
<h3>The XOR gate</h3>
<img
src="images/xor-gate.svg"
alt="XOR gate symbol with inputs A and B and output C"
/>
<table align="right">
<caption>
XOR gate truth table
</caption>
<tr>
<th colspan="2">Inputs</th>
<th>Output</th>
</tr>
<tr>
<th>A</th>
<th>B</th>
<th>C</th>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>1</td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>0</td>
</tr>
</table>
<p>
Alright now we're upping the difficulty a bit, but don't get cold feet
yet. Now, let's talk about the XOR gate. which is like OR gate's cousin,
its truth table differs from OR gate's by a single row, it outputs a 1
when either its inputs are a 1. in other words, C will be 1 if and only
if either A
<strong>or</strong> B are 1 but <strong>not both</strong>.
</p>
<p>
For further information consider reading the
<a href="https://en.wikipedia.org/wiki/XOR_gate">XOR gate wikipage</a>
</p>
</div>
<button>Change Username</button>
<script src="scripts/main.js"></script>
</body>
</html>