-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
215 lines (210 loc) · 14.1 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
208
209
210
211
212
213
214
215
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="Digital Design Tools made by Chris Lawson">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Digital Design Tools - dd.chrislawson.dev</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.teal-pink.min.css">
<link rel="stylesheet" href="src/css/style.css">
</head>
<body class="mdl-demo mdl-base">
<div class="mdl-layout mdl-js-layout">
<header class="mdl-layout__header mdl-layout__header--waterfall">
<div class="header">
<span class="mdl-layout-title">Digital Design Tools</span>
</div>
<div class="mdl-layout__tab-bar mdl-js-ripple-effect">
<a href="#home" class="mdl-layout__tab is-active">Home</a>
<a href="#about" class="mdl-layout__tab">About</a>
</div>
</header>
<main class="mdl-layout__content">
<section class="mdl-layout__tab-panel is-active" id="home">
<div class="mdl-grid">
<!-- Resources -->
<div
class="mdl-card mdl-cell mdl-cell--3-col mdl-cell--4-col-tablet mdl-cell--12-col-phone mdl-shadow--2dp">
<div class="mdl-card__title">
<h2 class="mdl-card__title-text">Resources</h2>
</div>
<div class="mdl-card__supporting-text">
<ul>
<li>Lab Manual: <a
href="https://docs.google.com/document/d/1KOF_W2SgGmaQrXw2hT4tScvi5KIcZDZVKOu4QV8AkGE/edit?usp=sharing"
target="_blank" rel="noopener noreferrer">On Google Docs</a></li>
<li>OTTER RISCV Assembler Manual: <a
href="https://canvas.calpoly.edu/courses/66357/files/6381903" target="_blank"
rel="noopener noreferrer">On Canvas</a></li>
<li>RARS Download: <a href="https://canvas.calpoly.edu/courses/66357/files/6061641"
target="_blank" rel="noopener noreferrer">On Canvas</a></li>
<li>Textbook: <a href="https://canvas.calpoly.edu/courses/66357/files/6061638"
target="_blank" rel="noopener noreferrer">On Canvas</a></li>
<li><a href="https://www.cl.cam.ac.uk/teaching/1112/ECAD+Arch/files/SystemVerilogCheatSheet.pdf"
target="_blank" rel="noopener noreferrer">SystemVerilog Cheat Sheet</a></li>
</ul>
</div>
</div>
<!-- Conversions -->
<div
class="mdl-card mdl-cell mdl-cell--3-col mdl-cell--4-col-tablet mdl-cell--12-col-phone mdl-shadow--2dp">
<div class="mdl-card__title">
<h2 class="mdl-card__title-text">Base Conversion</h2>
</div>
<div class="mdl-card__supporting-text">
Convert between decimal, hexadecimal, and binary on the fly. No more hitting submit buttons!
<form action="#">
<div class="mdl-textfield mdl-js-textfield">
<input class="mdl-textfield__input" type="text"
pattern="^(\d|[1-9]\d{1,14}|[1-8]\d{15}|900[0-6]\d{12}|90070\d{11}|90071[0-8]\d{10}|900719[0-8]\d{9}|9007199[01]\d{8}|90071992[0-4]\d{7}|900719925[0-3]\d{6}|9007199254[0-6]\d{5}|90071992547[0-3]\d{4}|9007199254740[0-8]\d{2}|90071992547409[0-8]\d|900719925474099[01])$"
id="convDecimal">
<label class="mdl-textfield__label" id="convDecimalLabel"
for="convDecimal">Decimal...</label>
<span class="mdl-textfield__error">Input is not a valid integer!</span>
</div>
<div class="mdl-textfield mdl-js-textfield">
<input class="mdl-textfield__input" type="text" pattern="^[0-9a-fA-F]+$"
id="convHexadecimal">
<label class="mdl-textfield__label" id="convHexadecimalLabel"
for="convHexadecimal">Hexadecimal...</label>
<span class="mdl-textfield__error">Input is not a valid hexadecimal number
(don't
include 0x)!</span>
</div>
<div class="mdl-textfield mdl-js-textfield">
<input class="mdl-textfield__input" type="text" pattern="^[01]{0,53}$"
id="convBinary">
<label class="mdl-textfield__label" id="convBinaryLabel"
for="convBinary">Binary...</label>
<span class="mdl-textfield__error">Input is not a valid binary number!</span>
</div>
</form>
</div>
</div>
<!-- Minimum Bits -->
<div
class="mdl-card mdl-cell mdl-cell--3-col mdl-cell--4-col-tablet mdl-cell--12-col-phone mdl-shadow--2dp">
<div class="mdl-card__title">
<h2 class="mdl-card__title-text">Minimum Bit/Byte Calculation</h2>
</div>
<div class="mdl-card__supporting-text">
Calculate the minimum number of bits and bytes to represent an unsigned number.
<form action="#">
<div class="mdl-textfield mdl-js-textfield">
<input class="mdl-textfield__input" type="text"
pattern="^(\d|[1-9]\d{1,14}|[1-8]\d{15}|900[0-6]\d{12}|90070\d{11}|90071[0-8]\d{10}|900719[0-8]\d{9}|9007199[01]\d{8}|90071992[0-4]\d{7}|900719925[0-3]\d{6}|9007199254[0-6]\d{5}|90071992547[0-3]\d{4}|9007199254740[0-8]\d{2}|90071992547409[0-8]\d|900719925474099[01])$"
id="minDecimal">
<label class="mdl-textfield__label" id="minDecimalLabel"
for="minDecimal">Decimal...</label>
<span class="mdl-textfield__error">Input is not a valid integer!</span>
</div>
<div class="mdl-textfield mdl-js-textfield">
<input class="mdl-textfield__input" type="text" pattern="^[0-9a-fA-F]+$"
id="minHexadecimal">
<label class="mdl-textfield__label" id="minHexadecimalLabel"
for="minHexadecimal">Hexadecimal...</label>
<span class="mdl-textfield__error">Input is not a valid hexadecimal number
(don't
include 0x)!</span>
</div>
<div class="mdl-textfield mdl-js-textfield">
<input class="mdl-textfield__input" type="text" pattern="^[01]{0,53}$"
id="minBinary">
<label class="mdl-textfield__label" id="minBinaryLabel"
for="minBinary">Binary...</label>
<span class="mdl-textfield__error">Input is not a valid binary number!</span>
</div>
</form>
<h3 id="minBits"></h3>
</div>
</div>
<!-- Two's Complement -->
<div
class="mdl-card mdl-cell mdl-cell--3-col mdl-cell--4-col-tablet mdl-cell--12-col-phone mdl-shadow--2dp">
<div class="mdl-card__title">
<h2 class="mdl-card__title-text">Two's Comp Calculation</h2>
</div>
<div class="mdl-card__supporting-text">
Convert decimal to signed binary and vice-versa. 32-bit limit.
<form action="#">
<div class="mdl-textfield mdl-js-textfield">
<input class="mdl-textfield__input" type="text"
pattern="^[1-9]$|^[1-2][0-9]$|^3[0-2]$" id="twosBits">
<label class="mdl-textfield__label" id="twosBitsLabel" for="twosBits"># of
Bits...</label>
<span class="mdl-textfield__error">Input is not a valid number of bits!</span>
</div>
<div class="mdl-textfield mdl-js-textfield">
<input class="mdl-textfield__input" type="text"
pattern="^-?([0-9]{1,9}|[0-1][0-9]{9}|20[0-9]{8}|21[0-3][0-9]{7}|214[0-6][0-9]{6}|2147[0-3][0-9]{5}|21474[0-7][0-9]{4}|214748[0-2][0-9]{3}|2147483[0-5][0-9]{2}|21474836[0-3][0-9]|214748364[0-7])$|^(-2147483648)$"
id="twosDecimal">
<label class="mdl-textfield__label" id="twosDecimalLabel"
for="twosDecimal">Decimal...</label>
<span class="mdl-textfield__error">Input is not a valid integer!</span>
</div>
<!-- <div class="mdl-textfield mdl-js-textfield">
<input class="mdl-textfield__input" type="text" pattern="^[0-9a-fA-F]+$"
id="twosHexadecimal">
<label class="mdl-textfield__label" id="twosHexadecimalLabel"
for="twosHexadecimal">Hexadecimal...</label>
<span class="mdl-textfield__error">Input is not a valid hexadecimal number
(don't include 0x)!</span>
</div> -->
<div class="mdl-textfield mdl-js-textfield">
<input class="mdl-textfield__input" type="text" pattern="^[01]{0,32}$"
id="twosBinary">
<label class="mdl-textfield__label" id="twosBinaryLabel"
for="twosBinary">Binary...</label>
<span class="mdl-textfield__error">Input is not a valid signed 32-bit binary
number!</span>
</div>
</form>
</div>
</div>
</div>
</section>
<section class="mdl-layout__tab-panel" id="about">
<div class="mdl-grid">
<div class="mdl-card mdl-cell mdl-cell--12-col mdl-shadow--2dp">
<div class="mdl-card__title">
<h2 class="mdl-card__title-text">About</h2>
</div>
<div class="mdl-card__supporting-text">
Created by Chris Lawson for CPE 233. Idea inspired by Patrick Jackson.
<br><br>
The goal of Digital Design Tools is to provide quick access to commonly used resources and
valuable tools for SW and HW projects in Winter 2022 CPE 233-09. If there is a tool you'd
like to be implemented, feel free to do one of the following:
<ul>
<li>Make a PR on the GitHub (preferred)</li>
<li>Slack me in the CPE 233 workspace</li>
<li>Create an issue on GitHub (least preferred)</li>
</ul>
<h6>Source Code</h6>
All source code is available at
<a href="https://github.com/Chris2fourlaw/digital-design-tools" target="_blank"
rel="noopener noreferrer">my GitHub</a>.
Please feel free to fork and contribute!
</div>
</div>
</div>
</section>
</main>
<footer class="mdl-mini-footer">
<div class="mdl-mini-footer--left-section">
© Chris Lawson 2022 | <a href="https://chrislawson.dev" target="_blank"
rel="noopener noreferrer">chrislawson.dev</a>
</div>
<div class="mdl-mini-footer--right-section">Source Code: <a
href="https://github.com/Chris2fourlaw/digital-design-tools" target="_blank"
rel="noopener noreferrer">GitHub</a></div>
</footer>
</div>
<script defer src="https://code.getmdl.io/1.3.0/material.min.js"></script>
<script src="src/js/conversions.js"></script>
<script src="src/js/minbit.js"></script>
<script src="src/js/twoscomp.js"></script>
</body>
</html>