ELEC60015-HLP-CW/docs/reference/global-numberhelpers.html

310 lines
12 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>NumberHelpers - issie</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content=""/>
<meta name="author" content="tomcl"/>
<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<link type="text/css" rel="stylesheet" href="https://tomcl.github.io/issie//content/style.css" />
<script type="text/javascript" src="https://tomcl.github.io/issie//content/tips.js"></script>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="http://fsharp.org">fsharp.org</a></li>
</ul>
<h3 class="muted"><a href="https://tomcl.github.io/issie//index.html">issie</a></h3>
</div>
<hr />
<div class="row">
<div class="span9" id="main">
<h1>NumberHelpers</h1>
<p>
<span>Namespace: global</span><br />
</p>
<div class="xmldoc">
</div>
<!-- Render nested types and modules, if there are any -->
<h3>Functions and values</h3>
<table class="table table-bordered member-list">
<thead>
<tr><td>Function or value</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '64', 64)" onmouseover="showTip(event, '64', 64)">
bin(num)
</code>
<div class="tip" id="64">
<strong>Signature:</strong> num:int -&gt; string<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/tomcl/ISSIE/tree/master/src/Simulator/NumberHelpers.fs#L45-45" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
</td>
</tr>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '65', 65)" onmouseover="showTip(event, '65', 65)">
bin64(num)
</code>
<div class="tip" id="65">
<strong>Signature:</strong> num:int64 -&gt; string<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/tomcl/ISSIE/tree/master/src/Simulator/NumberHelpers.fs#L41-41" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
</td>
</tr>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '66', 66)" onmouseover="showTip(event, '66', 66)">
bitToString(bit)
</code>
<div class="tip" id="66">
<strong>Signature:</strong> bit:Bit -&gt; string<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/tomcl/ISSIE/tree/master/src/Simulator/NumberHelpers.fs#L49-49" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
<p>Convert a bit to string.</p>
</td>
</tr>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '67', 67)" onmouseover="showTip(event, '67', 67)">
convertIntToWireData width num
</code>
<div class="tip" id="67">
<strong>Signature:</strong> width:int -&gt; num:int64 -&gt; WireData<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/tomcl/ISSIE/tree/master/src/Simulator/NumberHelpers.fs#L60-60" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
<p>Convert an int into a Bit list with the provided width. The Least
Significant Bits are the one with low index (e.g. LSB is at position 0, MSB
is at position N). Little Endian.
If the number has more bits than width, then more bits will be returned.</p>
</td>
</tr>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '68', 68)" onmouseover="showTip(event, '68', 68)">
convertWireDataToInt(bits)
</code>
<div class="tip" id="68">
<strong>Signature:</strong> bits:WireData -&gt; int64<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/tomcl/ISSIE/tree/master/src/Simulator/NumberHelpers.fs#L72-72" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
<p>Convert a list of Bits into an int. The Least Significant Bits are the one
with low index (e.g. LSB is at position 0, MSB is at position N).
Little Endian.</p>
</td>
</tr>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '69', 69)" onmouseover="showTip(event, '69', 69)">
dec(num)
</code>
<div class="tip" id="69">
<strong>Signature:</strong> num:int -&gt; string<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/tomcl/ISSIE/tree/master/src/Simulator/NumberHelpers.fs#L46-46" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
</td>
</tr>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '70', 70)" onmouseover="showTip(event, '70', 70)">
dec64(num)
</code>
<div class="tip" id="70">
<strong>Signature:</strong> num:int64 -&gt; string<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/tomcl/ISSIE/tree/master/src/Simulator/NumberHelpers.fs#L43-43" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
</td>
</tr>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '71', 71)" onmouseover="showTip(event, '71', 71)">
hex(num)
</code>
<div class="tip" id="71">
<strong>Signature:</strong> num:int -&gt; string<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/tomcl/ISSIE/tree/master/src/Simulator/NumberHelpers.fs#L44-44" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
</td>
</tr>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '72', 72)" onmouseover="showTip(event, '72', 72)">
hex64(num)
</code>
<div class="tip" id="72">
<strong>Signature:</strong> num:int64 -&gt; string<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/tomcl/ISSIE/tree/master/src/Simulator/NumberHelpers.fs#L40-40" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
</td>
</tr>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '73', 73)" onmouseover="showTip(event, '73', 73)">
sDec64(num)
</code>
<div class="tip" id="73">
<strong>Signature:</strong> num:int64 -&gt; string<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/tomcl/ISSIE/tree/master/src/Simulator/NumberHelpers.fs#L42-42" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
</td>
</tr>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '74', 74)" onmouseover="showTip(event, '74', 74)">
strToInt(str)
</code>
<div class="tip" id="74">
<strong>Signature:</strong> str:string -&gt; Result&lt;int64,string&gt;<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/tomcl/ISSIE/tree/master/src/Simulator/NumberHelpers.fs#L82-82" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
<p>Try to convert a string to an int, or return an error message if that was
not possible.</p>
</td>
</tr>
<tr>
<td class="member-name">
<code onmouseout="hideTip(event, '75', 75)" onmouseover="showTip(event, '75', 75)">
strToIntCheckWidth str width
</code>
<div class="tip" id="75">
<strong>Signature:</strong> str:string -&gt; width:int -&gt; Result&lt;int64,string&gt;<br />
</div>
</td>
<td class="xmldoc">
<a href="https://github.com/tomcl/ISSIE/tree/master/src/Simulator/NumberHelpers.fs#L100-100" class="github-link">
<img src="../content/img/github.png" class="normal" />
<img src="../content/img/github-blue.png" class="hover" />
</a>
<p>Convert a string to a number making sure that it has no more bits than
specified in width.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="span3">
<ul class="nav nav-list" id="menu" style="margin-top: 20px;">
<li class="nav-header">issie</li>
<li class="divider"></li>
<li><a href="https://github.com/tomcl/ISSIE">Source Code</a></li>
<li><a href="https://tomcl.github.io/issie//release-notes.html">Release Notes</a></li>
<li><a href="https://tomcl.github.io/issie//contributing.html">Contributing</a></li>
<li class="nav-header">Documentation</li>
<li><a href="https://tomcl.github.io/issie//index.html">Introduction</a></li>
<li class="divider"></li>
<li><a href="https://tomcl.github.io/issie//community.html">Community</a></li>
<li class="nav-header">Reference</li>
<li><a href="https://tomcl.github.io/issie//reference/index.html">API Reference</a></li>
</ul>
</div>
</div>
</div>
</body>
</html>