forked from wavedrom/wavedrom.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tutorial2.html
198 lines (170 loc) · 4.38 KB
/
tutorial2.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
<html>
<head>
<meta charset="UTF-8">
<title>Hitchhiker's Guide to the WaveDrom (Part 2)</title>
<link rel="shortcut icon" href="images/favicon.ico"/>
<script type="text/javascript" src="skins/default.js"></script>
<!--script type="text/javascript" src="skins/narrow.js"></script-->
<script type="text/javascript" src="wavedrom.min.js"></script>
<link href='https://fonts.googleapis.com/css?family=Roboto|Droid+Sans+Mono|Varela+Round' rel='stylesheet'>
<script type="text/javascript" src="scripts/shCore.min.js"></script>
<script type="text/javascript" src="scripts/shBrushJScript.js"></script>
<link href="scripts/shCore.css" rel="stylesheet" type="text/css" />
<link href="scripts/shThemeDefault.css" rel="stylesheet" type="text/css" />
<link href="tutorial.css" media="screen" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="content">
<h1>Hitchhiker's Guide to the WaveDrom (Part 2)</h1>
<h2 id="logic-circuit-diagram">Logic Circuit Diagram</h2>
Element <span class="fixed">"assign"</span> is an array of logic circuit diagrams.
Each diagram by itself is an array, where first element is the name of circuit output,
and the second element is the tree of logical operators.
<pre class="brush: js">
{ assign:[
["o0", [Tree0]],
["o1", [Tree1]],
...
]}
</pre>
Tree of logical operators has operator string as first element
and operands for the each next element. Operand by itself can be a tree.
See some examples below.
<h3 id="xor-gate">XOR Gate</h3>
<pre class="brush: js">
{ assign:[
["out",
["|",
["&", ["~", "a"], "b"],
["&", ["~", "b"], "a"]
]
]
]}
</pre>
<script type="WaveDrom">
{ assign:[
["out",
["|",
["&", ["~", "a"], "b"],
["&", ["~", "b"], "a"]
]
]
]}
</script>
<h3 id="binary-to-gray">Binary to Gray</h3>
<pre class="brush: js">
{ assign:[
["g0", ["^", "b0", "b1"]],
["g1", ["^", "b1", "b2"]],
["g2", ["^", "b2", "b3"]],
["g3", ["=", "b3"]]
]}
</pre>
<script type="WaveDrom">
{ assign:[
["g0", ["^", "b0", "b1"]],
["g1", ["^", "b1", "b2"]],
["g2", ["^", "b2", "b3"]],
["g3", ["=", "b3"]]
]}
</script>
<h3 id="gray-to-binary">Gray to Binary</h3>
<pre class="brush: js">
{ assign:[
["b3", "g3"],
["b2", ["^", "b3", "g2"]],
["b1", ["^", "b2", "g1"]],
["b0", ["^", "b1", "g0"]]
]}
</pre>
<script type="WaveDrom">
{ assign:[
["b3", "g3"],
["b2", ["^", "b3", "g2"]],
["b1", ["^", "b2", "g1"]],
["b0", ["^", "b1", "g0"]]
]}
</script>
<h3 id="74ls688">74LS688</h3>
<div>
<div>
<pre class="brush: js">
{ assign:[
["z", ["~&",
["~^", ["~", "p0"], ["~", "q0"]],
["~^", ["~", "p1"], ["~", "q1"]],
["~^", ["~", "p2"], ["~", "q2"]],
"...",
["~^", ["~", "p7"], ["~", "q7"]],
["~","~en"]
]]
]}
</pre>
</div>
<div>
<script type="WaveDrom">
{ assign:[
["z", ["~&",
["~^", ["~", "p0"], ["~", "q0"]],
["~^", ["~", "p1"], ["~", "q1"]],
["~^", ["~", "p2"], ["~", "q2"]],
"...",
["~^", ["~", "p7"], ["~", "q7"]],
["~","~en"]
]]
]}
</script>
</div>
</div>
<h3 id="iec-60617-symbols">IEC 60617 Symbols</h3>
<div>
<div>
<pre class="brush: js">
{ assign:[
["out",
["XNOR",
["NAND",
["INV", "a"],
["NOR", "b", ["BUF","c"]]
],
["AND",
["XOR", "d", "e", ["OR","f","g"]],
"h"
]
]
]
]}
</pre>
</div>
<div>
<script type="WaveDrom">
{ assign:[
["out",
["XNOR",
["NAND",
["INV", "a"],
["NOR", "b", ["BUF","c"]]
],
["AND",
["XOR", "d", "e", ["OR","f","g"]],
"h"
]
]
]
]}
</script>
</div>
</div>
</div>
<a href="https://github.com/drom/wavedrom"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/a6677b08c955af8400f44c6298f40e7d19cc5b2d/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677261795f3664366436642e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png"></a>
<script>(function(){ window.addEventListener("load", WaveDrom.ProcessAll, false); })();</script>
<script>SyntaxHighlighter.all()</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-21660728-3"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-21660728-3');
</script>
</body>
</html>