-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.html
62 lines (55 loc) · 1.51 KB
/
test.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
<html>
<head>
<title>LFSR test</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="matrix.js"></script>
<script src="lf-lfsr.js"></script>
<script>
$(function() {
$("form#lfsr-gen").submit(function() {
var bits = $('input#bits').val();
var taps = $.map($('input#taps').val().split(','),
function(v) { return $.trim(v); });
var entropy_bits = $('input#entropy_bits').val();
var l = new LfLFSR(bits, taps, entropy_bits);
var h = l.toEqnHTMLArray();
$("ul#feedback-eqns").empty();
for (i in h) {
$("<li>"+h[i]+"</li>").appendTo("ul#feedback-eqns");
}
$("pre#verilog-code").text(l.toVerilog());
return false;
});
});
</script>
</head>
<body>
<h1>Leap-Forward LFSR generator</h1>
<form action="javascript:void" id="lfsr-gen">
<fieldset>
<legend>Parameters</legend>
<div>
<label for="bits">Bits (LFSR width):</label>
<input type="text" name="bits" id="bits" size="4"/>
</div>
<div>
<label for="taps">Taps of LFSR (e.g.: 0,2,7):</label>
<input type="text" name="taps" id="taps" size="20"/>
</div>
<div>
<label for="entropy_bits">Bits of entropy per cycle:</label>
<input type="text" name="entropy_bits" id="entropy_bits" size="4"/>
</div>
<div>
<input type="submit" value="Generate!"/>
</div>
</fieldset>
</form>
<h3>Feedback equations:</h3>
<ul id="feedback-eqns">
</ul>
<h3>Verilog code:</h3>
<pre id="verilog-code">
</pre>
</body>
</html>