mirror of
https://github.com/ehw-fit/ariths-gen.git
synced 2025-04-23 07:11:23 +01:00
Deploying to gh-pages from @ ehw-fit/ariths-gen@fd4f55da11 🚀
This commit is contained in:
parent
b34143f61f
commit
d46082728c
3133
ariths_gen/core/arithmetic_circuits/arithmetic_circuit.html
Normal file
3133
ariths_gen/core/arithmetic_circuits/arithmetic_circuit.html
Normal file
File diff suppressed because it is too large
Load Diff
82
ariths_gen/core/arithmetic_circuits/index.html
Normal file
82
ariths_gen/core/arithmetic_circuits/index.html
Normal file
@ -0,0 +1,82 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen.core.arithmetic_circuits API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>ariths_gen.core.arithmetic_circuits</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">from .arithmetic_circuit import (
|
||||
ArithmeticCircuit
|
||||
)
|
||||
|
||||
from .multiplier_circuit import (
|
||||
MultiplierCircuit
|
||||
)</code></pre>
|
||||
</details>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
|
||||
<dl>
|
||||
<dt><code class="name"><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit" href="arithmetic_circuit.html">ariths_gen.core.arithmetic_circuits.arithmetic_circuit</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit" href="multiplier_circuit.html">ariths_gen.core.arithmetic_circuits.multiplier_circuit</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.core" href="../index.html">ariths_gen.core</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit" href="arithmetic_circuit.html">ariths_gen.core.arithmetic_circuits.arithmetic_circuit</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit" href="multiplier_circuit.html">ariths_gen.core.arithmetic_circuits.multiplier_circuit</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
1000
ariths_gen/core/arithmetic_circuits/multiplier_circuit.html
Normal file
1000
ariths_gen/core/arithmetic_circuits/multiplier_circuit.html
Normal file
File diff suppressed because it is too large
Load Diff
75
ariths_gen/core/index.html
Normal file
75
ariths_gen/core/index.html
Normal file
@ -0,0 +1,75 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen.core API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>ariths_gen.core</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
|
||||
<dl>
|
||||
<dt><code class="name"><a title="ariths_gen.core.arithmetic_circuits" href="arithmetic_circuits/index.html">ariths_gen.core.arithmetic_circuits</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="ariths_gen.core.logic_gate_circuits" href="logic_gate_circuits/index.html">ariths_gen.core.logic_gate_circuits</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="ariths_gen.core.one_bit_circuits" href="one_bit_circuits/index.html">ariths_gen.core.one_bit_circuits</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen" href="../index.html">ariths_gen</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits" href="arithmetic_circuits/index.html">ariths_gen.core.arithmetic_circuits</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.logic_gate_circuits" href="logic_gate_circuits/index.html">ariths_gen.core.logic_gate_circuits</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits" href="one_bit_circuits/index.html">ariths_gen.core.one_bit_circuits</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
76
ariths_gen/core/logic_gate_circuits/index.html
Normal file
76
ariths_gen/core/logic_gate_circuits/index.html
Normal file
@ -0,0 +1,76 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen.core.logic_gate_circuits API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>ariths_gen.core.logic_gate_circuits</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">from .logic_gate_circuit import (
|
||||
MultipleInputLogicGate,
|
||||
TwoInputLogicGate,
|
||||
TwoInputInvertedLogicGate,
|
||||
OneInputLogicGate
|
||||
)</code></pre>
|
||||
</details>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
|
||||
<dl>
|
||||
<dt><code class="name"><a title="ariths_gen.core.logic_gate_circuits.logic_gate_circuit" href="logic_gate_circuit.html">ariths_gen.core.logic_gate_circuits.logic_gate_circuit</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.core" href="../index.html">ariths_gen.core</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.core.logic_gate_circuits.logic_gate_circuit" href="logic_gate_circuit.html">ariths_gen.core.logic_gate_circuits.logic_gate_circuit</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
3158
ariths_gen/core/logic_gate_circuits/logic_gate_circuit.html
Normal file
3158
ariths_gen/core/logic_gate_circuits/logic_gate_circuit.html
Normal file
File diff suppressed because it is too large
Load Diff
82
ariths_gen/core/one_bit_circuits/index.html
Normal file
82
ariths_gen/core/one_bit_circuits/index.html
Normal file
@ -0,0 +1,82 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen.core.one_bit_circuits API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>ariths_gen.core.one_bit_circuits</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">from .two_input_one_bit_circuit import (
|
||||
TwoInputOneBitCircuit
|
||||
)
|
||||
|
||||
from .three_input_one_bit_circuit import (
|
||||
ThreeInputOneBitCircuit
|
||||
)</code></pre>
|
||||
</details>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
|
||||
<dl>
|
||||
<dt><code class="name"><a title="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit" href="three_input_one_bit_circuit.html">ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit" href="two_input_one_bit_circuit.html">ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.core" href="../index.html">ariths_gen.core</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit" href="three_input_one_bit_circuit.html">ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit" href="two_input_one_bit_circuit.html">ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,970 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">from .two_input_one_bit_circuit import (
|
||||
TwoInputOneBitCircuit
|
||||
)
|
||||
|
||||
from ariths_gen.wire_components.wires import Wire
|
||||
|
||||
|
||||
class ThreeInputOneBitCircuit(TwoInputOneBitCircuit):
|
||||
"""Class represents a general three input one bit circuit and implements their generation to various representations. It is derived from `TwoInputOneBitCircuit` class.
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Wire): First input wire.
|
||||
b (Wire): Second input wire.
|
||||
c (Wire): Third input wire.
|
||||
prefix (str, optional): Prefix name of circuit. Defaults to "three_input_one_bit_circuit".
|
||||
"""
|
||||
def __init__(self, a: Wire = Wire(name="a"), b: Wire = Wire(name="b"), c: Wire = Wire(name="cin"), prefix: str = "three_input_one_bit_circuit"):
|
||||
super().__init__()
|
||||
self.c_data_type = "uint8_t"
|
||||
self.prefix = prefix
|
||||
self.a = a
|
||||
self.b = b
|
||||
self.c = c
|
||||
|
||||
""" C CODE GENERATION """
|
||||
# FLAT C #
|
||||
# Function prototype with three inputs
|
||||
def get_prototype_c(self):
|
||||
"""Generates C code function header to describe corresponding three input one bit circuit's interface in C code.
|
||||
|
||||
Returns:
|
||||
str: Function's name and parameters in C code.
|
||||
"""
|
||||
return f"{self.c_data_type} {self.prefix}({self.c_data_type} {self.a.prefix}, {self.c_data_type} {self.b.prefix}, {self.c_data_type} {self.c.prefix})" + "{" + "\n"
|
||||
|
||||
# HIERARCHICAL C #
|
||||
# Subcomponent generation (three inputs)
|
||||
def get_out_invocation_c(self, *args, **kwargs):
|
||||
"""Generates hierarchical C code invocation of corresponding three input one bit circuit's generated function block.
|
||||
|
||||
Assigns output values from invocation of the corresponding function block into inner wires present inside the upper
|
||||
component from which function block has been invoked.
|
||||
|
||||
Returns:
|
||||
str: Hierarchical C code subcomponent's C function invocation and output assignment.
|
||||
"""
|
||||
# Used to retrieve proper component's output wire offset position within the output bus
|
||||
output_bus_wire_names = []
|
||||
[output_bus_wire_names.append(w.prefix) for w in self.out.bus]
|
||||
circuit_block = self.__class__()
|
||||
return "".join([f" {c.out.prefix} = ({circuit_block.prefix}({self.a.get_wire_value_c_hier()}, {self.b.get_wire_value_c_hier()}, {self.c.get_wire_value_c_hier()}) >> {output_bus_wire_names.index(c.out.prefix)}) & 0x01;\n" for c in self.components if c.disable_generation is False and c.out.prefix in output_bus_wire_names])
|
||||
|
||||
""" VERILOG CODE GENERATION """
|
||||
# FLAT VERILOG #
|
||||
# Module prototype with three inputs
|
||||
def get_prototype_v(self):
|
||||
"""Generates Verilog for flat module header to describe corresponding three input one bit circuit's interface in Verilog.
|
||||
|
||||
It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner module logic is also modified accordingly. It is used for self three input one bit circuit flat generation.
|
||||
|
||||
Returns:
|
||||
str: Flat module's name and parameters in Verilog.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(o.name+"_outid"+str(self.out.bus.index(o))) if o.is_const() or o.name in [self.a.name, self.b.name, self.c.name] else unique_out_wires.append(o.name) for o in self.out.bus]
|
||||
return f"module {self.prefix}(input {self.a.name}, input {self.b.name}, input {self.c.name}" + \
|
||||
"".join([f", output {o}" for o in unique_out_wires]) + ");\n"
|
||||
|
||||
def get_self_init_v_flat(self):
|
||||
"""Generates Verilog for self flat module initialization and assignment of corresponding three input one bit circuit's input/output wires.
|
||||
|
||||
It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner module prototype is also modified accordingly. It is used for self three input one bit circuit flat generation.
|
||||
|
||||
Returns:
|
||||
str: Verilog flat module's inner circuit wires initialization and assignment.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(o.name+"_outid"+str(self.out.bus.index(o))) if o.is_const() or o.name in [self.a.name, self.b.name, self.c.name] else unique_out_wires.append(o.name) for o in self.out.bus]
|
||||
return "".join([c.get_assign_v_flat() if c.disable_generation is False else
|
||||
f" assign {unique_out_wires.pop(unique_out_wires.index(c.out.name+'_outid'+str(c.outid)))} = {c.out.v_const};\n" if f"{c.out.name+'_outid'+str(c.outid)}" in unique_out_wires and c.out.is_const() else
|
||||
f" assign {unique_out_wires.pop(unique_out_wires.index(c.out.name+'_outid'+str(c.outid)))} = {c.out.name};\n" if f"{c.out.name+'_outid'+str(c.outid)}" in unique_out_wires else
|
||||
f"" for c in self.components])
|
||||
|
||||
# HIERARCHICAL VERILOG #
|
||||
# Self circuit hierarchical generation
|
||||
def get_prototype_v_hier(self):
|
||||
"""Generates Verilog for hierarchical module header to describe corresponding three input one bit circuit's interface in Verilog.
|
||||
|
||||
It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner module logic is also modified accordingly. It is used for self three input one bit circuit hierarchical generation.
|
||||
|
||||
Returns:
|
||||
str: Hierarchical module's name and parameters in Verilog.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(o.name+"_outid"+str(self.out.bus.index(o))) if o.is_const() or o.name in [self.a.name, self.b.name, self.c.name] else unique_out_wires.append(o.name) for o in self.out.bus]
|
||||
return f"module {self.prefix}(input [0:0] {self.a.name}, input [0:0] {self.b.name}, input [0:0] {self.c.name}" + \
|
||||
"".join([f", output [0:0] {o}" for o in unique_out_wires]) + ");\n"
|
||||
|
||||
def get_self_init_v_hier(self):
|
||||
"""Generates Verilog for hierarchical module's inner initialization and assignment of corresponding arithmetic circuit's input/output wires.
|
||||
|
||||
It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner module prototype is also modified accordingly. It is used for self three input one bit circuit hierarchical generation.
|
||||
|
||||
Returns:
|
||||
str: Verilog hierarchical module's inner circuit wires initialization and assignment.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(o.name+"_outid"+str(self.out.bus.index(o))) if o.is_const() or o.name in [self.a.name, self.b.name, self.c.name] else unique_out_wires.append(o.name) for o in self.out.bus]
|
||||
return "".join([c.get_gate_invocation_v() if c.disable_generation is False else
|
||||
f" assign {unique_out_wires.pop(unique_out_wires.index(c.out.name+'_outid'+str(c.outid)))}[0] = {c.out.v_const};\n" if f"{c.out.name+'_outid'+str(c.outid)}" in unique_out_wires and c.out.is_const() else
|
||||
f" assign {unique_out_wires.pop(unique_out_wires.index(c.out.name+'_outid'+str(c.outid)))}[0] = {c.out.name}[0];\n" if f"{c.out.name+'_outid'+str(c.outid)}" in unique_out_wires else
|
||||
f"" for c in self.components])
|
||||
|
||||
# Subcomponent generation
|
||||
def get_out_invocation_v(self, *args, **kwargs):
|
||||
"""Generates hierarchical Verilog code invocation of corresponding three input one bit circuit's generated function block.
|
||||
|
||||
Assigns output values from invocation of the corresponding function block into inner wires present inside the upper
|
||||
component from which function block has been invoked.
|
||||
|
||||
Returns:
|
||||
str: Hierarchical Verilog code subcomponent's module invocation and output assignment.
|
||||
"""
|
||||
circuit_block = self.__class__()
|
||||
return f" {circuit_block.prefix} {circuit_block.prefix}_{self.out.prefix}(.{circuit_block.a.prefix}({self.a.get_wire_value_v_hier()}), .{circuit_block.b.prefix}({self.b.get_wire_value_v_hier()}), .{circuit_block.c.prefix}({self.c.get_wire_value_v_hier()}){self.out.get_unique_assign_out_wires_v(circuit_block)});\n"
|
||||
|
||||
""" BLIF CODE GENERATION """
|
||||
# FLAT BLIF #
|
||||
# Model prototype with three inputs
|
||||
def get_declaration_blif(self):
|
||||
"""Generates Blif code declaration of three input one bit circuit's input/output wires.
|
||||
|
||||
It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner modul logic is also modified accordingly. It is used for self three input one bit circuit flat/hierarchical generation.
|
||||
|
||||
Returns:
|
||||
str: Blif code containing declaration of circuit's input/output wires.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(o.name+"_outid"+str(self.out.bus.index(o))) if o.is_const() or o.name in [self.a.name, self.b.name, self.c.name] else unique_out_wires.append(o.name) for o in self.out.bus]
|
||||
return f".inputs {self.a.get_declaration_blif()} {self.b.get_declaration_blif()} {self.c.get_declaration_blif()}\n" + \
|
||||
f".outputs" + \
|
||||
"".join([f" {o}" for o in unique_out_wires]) + "\n" + \
|
||||
f".names vdd\n1\n" + \
|
||||
f".names gnd\n0\n"
|
||||
|
||||
def get_function_blif_flat(self, top_modul: bool = False):
|
||||
"""Generates flat Blif code with invocation of subcomponents logic gates Boolean functions via their corresponding truth tables.
|
||||
|
||||
It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner modul prototype is also modified accordingly. It is used for self three input one bit circuit flat generation.
|
||||
|
||||
Args:
|
||||
top_modul (bool, optional): Specifies whether the described circuit represents top modul component (self one bit circuit generation). Defaults to False.
|
||||
|
||||
Returns:
|
||||
str: Flat Blif code containing invocation of inner subcomponents logic gates Boolean functions.
|
||||
"""
|
||||
if top_modul:
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(o.name+"_outid"+str(self.out.bus.index(o))) if o.is_const() or o.name in [self.a.name, self.b.name, self.c.name] else unique_out_wires.append(o.name) for o in self.out.bus]
|
||||
return "".join([c.get_function_blif_flat() if c.disable_generation is False else
|
||||
c.out.get_assign_blif(prefix=f"{unique_out_wires.pop(unique_out_wires.index(c.out.name+'_outid'+str(c.outid)))}", output=True) if f"{c.out.name+'_outid'+str(c.outid)}" in unique_out_wires else
|
||||
"" for c in self.components])
|
||||
else:
|
||||
return "".join([c.get_function_blif_flat() for c in self.components])
|
||||
|
||||
# HIERARCHICAL BLIF #
|
||||
# Subcomponent generation (3 inputs)
|
||||
def get_invocations_blif_hier(self):
|
||||
"""Generates hierarchical Blif code with invocation of subcomponents function blocks.
|
||||
|
||||
It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner modul prototype is also modified accordingly. It is used for self three input one bit circuit hierarchical generation.
|
||||
|
||||
Returns:
|
||||
str: Hierarchical Blif code containing invocation of inner subcomponents function blocks.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(o.name+"_outid"+str(self.out.bus.index(o))) if o.is_const() or o.name in [self.a.name, self.b.name, self.c.name] else unique_out_wires.append(o.name) for o in self.out.bus]
|
||||
return "".join([c.get_invocation_blif_hier() if c.disable_generation is False else
|
||||
c.out.get_assign_blif(prefix=f"{unique_out_wires.pop(unique_out_wires.index(c.out.name+'_outid'+str(c.outid)))}", output=True) if f"{c.out.name+'_outid'+str(c.outid)}" in unique_out_wires else
|
||||
"" for c in self.components])
|
||||
|
||||
def get_invocation_blif_hier(self, *args, **kwargs):
|
||||
"""Generates hierarchical Blif code invocation of corresponding three input one bit circuit's generated function block.
|
||||
|
||||
Returns:
|
||||
str: Hierarchical Blif code subcomponent's model invocation.
|
||||
"""
|
||||
circuit_block = self.__class__()
|
||||
return f".subckt {circuit_block.prefix} {circuit_block.a.prefix}={self.a.get_wire_value_blif()} {circuit_block.b.prefix}={self.b.get_wire_value_blif()} {circuit_block.c.prefix}={self.c.get_wire_value_blif()}{self.out.get_unique_assign_out_wires_blif(function_block_out_bus=circuit_block.out)}\n"
|
||||
|
||||
""" CGP CODE GENERATION """
|
||||
# FLAT CGP #
|
||||
# Chromosome prototype with three inputs
|
||||
def get_parameters_cgp(self):
|
||||
"""Generates CGP chromosome parameters of corresponding three input one bit circuit.
|
||||
|
||||
In total seven parameters represent: total inputs, total outputs, number of rows, number of columns (gates),
|
||||
number of each gate's inputs, number of each gate's outputs, quality constant value.
|
||||
|
||||
Returns:
|
||||
str: CGP chromosome parameters of described circuit.
|
||||
"""
|
||||
self.circuit_gates = self.get_circuit_gates()
|
||||
return f"{{3,{self.out.N},1,{len(self.circuit_gates)},2,1,0}}"</code></pre>
|
||||
</details>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit"><code class="flex name class">
|
||||
<span>class <span class="ident">ThreeInputOneBitCircuit</span></span>
|
||||
<span>(</span><span>a: <a title="ariths_gen.wire_components.wires.Wire" href="../../wire_components/wires.html#ariths_gen.wire_components.wires.Wire">Wire</a> = <ariths_gen.wire_components.wires.Wire object>, b: <a title="ariths_gen.wire_components.wires.Wire" href="../../wire_components/wires.html#ariths_gen.wire_components.wires.Wire">Wire</a> = <ariths_gen.wire_components.wires.Wire object>, c: <a title="ariths_gen.wire_components.wires.Wire" href="../../wire_components/wires.html#ariths_gen.wire_components.wires.Wire">Wire</a> = <ariths_gen.wire_components.wires.Wire object>, prefix: str = 'three_input_one_bit_circuit')</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Class represents a general three input one bit circuit and implements their generation to various representations. It is derived from <code>TwoInputOneBitCircuit</code> class.</p>
|
||||
<p>Description of the <strong>init</strong> method.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>a</code></strong> : <code>Wire</code></dt>
|
||||
<dd>First input wire.</dd>
|
||||
<dt><strong><code>b</code></strong> : <code>Wire</code></dt>
|
||||
<dd>Second input wire.</dd>
|
||||
<dt><strong><code>c</code></strong> : <code>Wire</code></dt>
|
||||
<dd>Third input wire.</dd>
|
||||
<dt><strong><code>prefix</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Prefix name of circuit. Defaults to "three_input_one_bit_circuit".</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class ThreeInputOneBitCircuit(TwoInputOneBitCircuit):
|
||||
"""Class represents a general three input one bit circuit and implements their generation to various representations. It is derived from `TwoInputOneBitCircuit` class.
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Wire): First input wire.
|
||||
b (Wire): Second input wire.
|
||||
c (Wire): Third input wire.
|
||||
prefix (str, optional): Prefix name of circuit. Defaults to "three_input_one_bit_circuit".
|
||||
"""
|
||||
def __init__(self, a: Wire = Wire(name="a"), b: Wire = Wire(name="b"), c: Wire = Wire(name="cin"), prefix: str = "three_input_one_bit_circuit"):
|
||||
super().__init__()
|
||||
self.c_data_type = "uint8_t"
|
||||
self.prefix = prefix
|
||||
self.a = a
|
||||
self.b = b
|
||||
self.c = c
|
||||
|
||||
""" C CODE GENERATION """
|
||||
# FLAT C #
|
||||
# Function prototype with three inputs
|
||||
def get_prototype_c(self):
|
||||
"""Generates C code function header to describe corresponding three input one bit circuit's interface in C code.
|
||||
|
||||
Returns:
|
||||
str: Function's name and parameters in C code.
|
||||
"""
|
||||
return f"{self.c_data_type} {self.prefix}({self.c_data_type} {self.a.prefix}, {self.c_data_type} {self.b.prefix}, {self.c_data_type} {self.c.prefix})" + "{" + "\n"
|
||||
|
||||
# HIERARCHICAL C #
|
||||
# Subcomponent generation (three inputs)
|
||||
def get_out_invocation_c(self, *args, **kwargs):
|
||||
"""Generates hierarchical C code invocation of corresponding three input one bit circuit's generated function block.
|
||||
|
||||
Assigns output values from invocation of the corresponding function block into inner wires present inside the upper
|
||||
component from which function block has been invoked.
|
||||
|
||||
Returns:
|
||||
str: Hierarchical C code subcomponent's C function invocation and output assignment.
|
||||
"""
|
||||
# Used to retrieve proper component's output wire offset position within the output bus
|
||||
output_bus_wire_names = []
|
||||
[output_bus_wire_names.append(w.prefix) for w in self.out.bus]
|
||||
circuit_block = self.__class__()
|
||||
return "".join([f" {c.out.prefix} = ({circuit_block.prefix}({self.a.get_wire_value_c_hier()}, {self.b.get_wire_value_c_hier()}, {self.c.get_wire_value_c_hier()}) >> {output_bus_wire_names.index(c.out.prefix)}) & 0x01;\n" for c in self.components if c.disable_generation is False and c.out.prefix in output_bus_wire_names])
|
||||
|
||||
""" VERILOG CODE GENERATION """
|
||||
# FLAT VERILOG #
|
||||
# Module prototype with three inputs
|
||||
def get_prototype_v(self):
|
||||
"""Generates Verilog for flat module header to describe corresponding three input one bit circuit's interface in Verilog.
|
||||
|
||||
It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner module logic is also modified accordingly. It is used for self three input one bit circuit flat generation.
|
||||
|
||||
Returns:
|
||||
str: Flat module's name and parameters in Verilog.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(o.name+"_outid"+str(self.out.bus.index(o))) if o.is_const() or o.name in [self.a.name, self.b.name, self.c.name] else unique_out_wires.append(o.name) for o in self.out.bus]
|
||||
return f"module {self.prefix}(input {self.a.name}, input {self.b.name}, input {self.c.name}" + \
|
||||
"".join([f", output {o}" for o in unique_out_wires]) + ");\n"
|
||||
|
||||
def get_self_init_v_flat(self):
|
||||
"""Generates Verilog for self flat module initialization and assignment of corresponding three input one bit circuit's input/output wires.
|
||||
|
||||
It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner module prototype is also modified accordingly. It is used for self three input one bit circuit flat generation.
|
||||
|
||||
Returns:
|
||||
str: Verilog flat module's inner circuit wires initialization and assignment.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(o.name+"_outid"+str(self.out.bus.index(o))) if o.is_const() or o.name in [self.a.name, self.b.name, self.c.name] else unique_out_wires.append(o.name) for o in self.out.bus]
|
||||
return "".join([c.get_assign_v_flat() if c.disable_generation is False else
|
||||
f" assign {unique_out_wires.pop(unique_out_wires.index(c.out.name+'_outid'+str(c.outid)))} = {c.out.v_const};\n" if f"{c.out.name+'_outid'+str(c.outid)}" in unique_out_wires and c.out.is_const() else
|
||||
f" assign {unique_out_wires.pop(unique_out_wires.index(c.out.name+'_outid'+str(c.outid)))} = {c.out.name};\n" if f"{c.out.name+'_outid'+str(c.outid)}" in unique_out_wires else
|
||||
f"" for c in self.components])
|
||||
|
||||
# HIERARCHICAL VERILOG #
|
||||
# Self circuit hierarchical generation
|
||||
def get_prototype_v_hier(self):
|
||||
"""Generates Verilog for hierarchical module header to describe corresponding three input one bit circuit's interface in Verilog.
|
||||
|
||||
It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner module logic is also modified accordingly. It is used for self three input one bit circuit hierarchical generation.
|
||||
|
||||
Returns:
|
||||
str: Hierarchical module's name and parameters in Verilog.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(o.name+"_outid"+str(self.out.bus.index(o))) if o.is_const() or o.name in [self.a.name, self.b.name, self.c.name] else unique_out_wires.append(o.name) for o in self.out.bus]
|
||||
return f"module {self.prefix}(input [0:0] {self.a.name}, input [0:0] {self.b.name}, input [0:0] {self.c.name}" + \
|
||||
"".join([f", output [0:0] {o}" for o in unique_out_wires]) + ");\n"
|
||||
|
||||
def get_self_init_v_hier(self):
|
||||
"""Generates Verilog for hierarchical module's inner initialization and assignment of corresponding arithmetic circuit's input/output wires.
|
||||
|
||||
It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner module prototype is also modified accordingly. It is used for self three input one bit circuit hierarchical generation.
|
||||
|
||||
Returns:
|
||||
str: Verilog hierarchical module's inner circuit wires initialization and assignment.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(o.name+"_outid"+str(self.out.bus.index(o))) if o.is_const() or o.name in [self.a.name, self.b.name, self.c.name] else unique_out_wires.append(o.name) for o in self.out.bus]
|
||||
return "".join([c.get_gate_invocation_v() if c.disable_generation is False else
|
||||
f" assign {unique_out_wires.pop(unique_out_wires.index(c.out.name+'_outid'+str(c.outid)))}[0] = {c.out.v_const};\n" if f"{c.out.name+'_outid'+str(c.outid)}" in unique_out_wires and c.out.is_const() else
|
||||
f" assign {unique_out_wires.pop(unique_out_wires.index(c.out.name+'_outid'+str(c.outid)))}[0] = {c.out.name}[0];\n" if f"{c.out.name+'_outid'+str(c.outid)}" in unique_out_wires else
|
||||
f"" for c in self.components])
|
||||
|
||||
# Subcomponent generation
|
||||
def get_out_invocation_v(self, *args, **kwargs):
|
||||
"""Generates hierarchical Verilog code invocation of corresponding three input one bit circuit's generated function block.
|
||||
|
||||
Assigns output values from invocation of the corresponding function block into inner wires present inside the upper
|
||||
component from which function block has been invoked.
|
||||
|
||||
Returns:
|
||||
str: Hierarchical Verilog code subcomponent's module invocation and output assignment.
|
||||
"""
|
||||
circuit_block = self.__class__()
|
||||
return f" {circuit_block.prefix} {circuit_block.prefix}_{self.out.prefix}(.{circuit_block.a.prefix}({self.a.get_wire_value_v_hier()}), .{circuit_block.b.prefix}({self.b.get_wire_value_v_hier()}), .{circuit_block.c.prefix}({self.c.get_wire_value_v_hier()}){self.out.get_unique_assign_out_wires_v(circuit_block)});\n"
|
||||
|
||||
""" BLIF CODE GENERATION """
|
||||
# FLAT BLIF #
|
||||
# Model prototype with three inputs
|
||||
def get_declaration_blif(self):
|
||||
"""Generates Blif code declaration of three input one bit circuit's input/output wires.
|
||||
|
||||
It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner modul logic is also modified accordingly. It is used for self three input one bit circuit flat/hierarchical generation.
|
||||
|
||||
Returns:
|
||||
str: Blif code containing declaration of circuit's input/output wires.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(o.name+"_outid"+str(self.out.bus.index(o))) if o.is_const() or o.name in [self.a.name, self.b.name, self.c.name] else unique_out_wires.append(o.name) for o in self.out.bus]
|
||||
return f".inputs {self.a.get_declaration_blif()} {self.b.get_declaration_blif()} {self.c.get_declaration_blif()}\n" + \
|
||||
f".outputs" + \
|
||||
"".join([f" {o}" for o in unique_out_wires]) + "\n" + \
|
||||
f".names vdd\n1\n" + \
|
||||
f".names gnd\n0\n"
|
||||
|
||||
def get_function_blif_flat(self, top_modul: bool = False):
|
||||
"""Generates flat Blif code with invocation of subcomponents logic gates Boolean functions via their corresponding truth tables.
|
||||
|
||||
It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner modul prototype is also modified accordingly. It is used for self three input one bit circuit flat generation.
|
||||
|
||||
Args:
|
||||
top_modul (bool, optional): Specifies whether the described circuit represents top modul component (self one bit circuit generation). Defaults to False.
|
||||
|
||||
Returns:
|
||||
str: Flat Blif code containing invocation of inner subcomponents logic gates Boolean functions.
|
||||
"""
|
||||
if top_modul:
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(o.name+"_outid"+str(self.out.bus.index(o))) if o.is_const() or o.name in [self.a.name, self.b.name, self.c.name] else unique_out_wires.append(o.name) for o in self.out.bus]
|
||||
return "".join([c.get_function_blif_flat() if c.disable_generation is False else
|
||||
c.out.get_assign_blif(prefix=f"{unique_out_wires.pop(unique_out_wires.index(c.out.name+'_outid'+str(c.outid)))}", output=True) if f"{c.out.name+'_outid'+str(c.outid)}" in unique_out_wires else
|
||||
"" for c in self.components])
|
||||
else:
|
||||
return "".join([c.get_function_blif_flat() for c in self.components])
|
||||
|
||||
# HIERARCHICAL BLIF #
|
||||
# Subcomponent generation (3 inputs)
|
||||
def get_invocations_blif_hier(self):
|
||||
"""Generates hierarchical Blif code with invocation of subcomponents function blocks.
|
||||
|
||||
It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner modul prototype is also modified accordingly. It is used for self three input one bit circuit hierarchical generation.
|
||||
|
||||
Returns:
|
||||
str: Hierarchical Blif code containing invocation of inner subcomponents function blocks.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(o.name+"_outid"+str(self.out.bus.index(o))) if o.is_const() or o.name in [self.a.name, self.b.name, self.c.name] else unique_out_wires.append(o.name) for o in self.out.bus]
|
||||
return "".join([c.get_invocation_blif_hier() if c.disable_generation is False else
|
||||
c.out.get_assign_blif(prefix=f"{unique_out_wires.pop(unique_out_wires.index(c.out.name+'_outid'+str(c.outid)))}", output=True) if f"{c.out.name+'_outid'+str(c.outid)}" in unique_out_wires else
|
||||
"" for c in self.components])
|
||||
|
||||
def get_invocation_blif_hier(self, *args, **kwargs):
|
||||
"""Generates hierarchical Blif code invocation of corresponding three input one bit circuit's generated function block.
|
||||
|
||||
Returns:
|
||||
str: Hierarchical Blif code subcomponent's model invocation.
|
||||
"""
|
||||
circuit_block = self.__class__()
|
||||
return f".subckt {circuit_block.prefix} {circuit_block.a.prefix}={self.a.get_wire_value_blif()} {circuit_block.b.prefix}={self.b.get_wire_value_blif()} {circuit_block.c.prefix}={self.c.get_wire_value_blif()}{self.out.get_unique_assign_out_wires_blif(function_block_out_bus=circuit_block.out)}\n"
|
||||
|
||||
""" CGP CODE GENERATION """
|
||||
# FLAT CGP #
|
||||
# Chromosome prototype with three inputs
|
||||
def get_parameters_cgp(self):
|
||||
"""Generates CGP chromosome parameters of corresponding three input one bit circuit.
|
||||
|
||||
In total seven parameters represent: total inputs, total outputs, number of rows, number of columns (gates),
|
||||
number of each gate's inputs, number of each gate's outputs, quality constant value.
|
||||
|
||||
Returns:
|
||||
str: CGP chromosome parameters of described circuit.
|
||||
"""
|
||||
self.circuit_gates = self.get_circuit_gates()
|
||||
return f"{{3,{self.out.N},1,{len(self.circuit_gates)},2,1,0}}"</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit" href="two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit">TwoInputOneBitCircuit</a></li>
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></li>
|
||||
</ul>
|
||||
<h3>Subclasses</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.one_bit_circuits.one_bit_components.three_input_one_bit_components.FullAdder" href="../../one_bit_circuits/one_bit_components/three_input_one_bit_components.html#ariths_gen.one_bit_circuits.one_bit_components.three_input_one_bit_components.FullAdder">FullAdder</a></li>
|
||||
<li><a title="ariths_gen.one_bit_circuits.one_bit_components.three_input_one_bit_components.FullAdderPG" href="../../one_bit_circuits/one_bit_components/three_input_one_bit_components.html#ariths_gen.one_bit_circuits.one_bit_components.three_input_one_bit_components.FullAdderPG">FullAdderPG</a></li>
|
||||
<li><a title="ariths_gen.one_bit_circuits.one_bit_components.three_input_one_bit_components.FullSubtractor" href="../../one_bit_circuits/one_bit_components/three_input_one_bit_components.html#ariths_gen.one_bit_circuits.one_bit_components.three_input_one_bit_components.FullSubtractor">FullSubtractor</a></li>
|
||||
<li><a title="ariths_gen.one_bit_circuits.one_bit_components.three_input_one_bit_components.TwoOneMultiplexer" href="../../one_bit_circuits/one_bit_components/three_input_one_bit_components.html#ariths_gen.one_bit_circuits.one_bit_components.three_input_one_bit_components.TwoOneMultiplexer">TwoOneMultiplexer</a></li>
|
||||
</ul>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_declaration_blif"><code class="name flex">
|
||||
<span>def <span class="ident">get_declaration_blif</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Generates Blif code declaration of three input one bit circuit's input/output wires.</p>
|
||||
<p>It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner modul logic is also modified accordingly. It is used for self three input one bit circuit flat/hierarchical generation.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>Blif code containing declaration of circuit's input/output wires.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def get_declaration_blif(self):
|
||||
"""Generates Blif code declaration of three input one bit circuit's input/output wires.
|
||||
|
||||
It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner modul logic is also modified accordingly. It is used for self three input one bit circuit flat/hierarchical generation.
|
||||
|
||||
Returns:
|
||||
str: Blif code containing declaration of circuit's input/output wires.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(o.name+"_outid"+str(self.out.bus.index(o))) if o.is_const() or o.name in [self.a.name, self.b.name, self.c.name] else unique_out_wires.append(o.name) for o in self.out.bus]
|
||||
return f".inputs {self.a.get_declaration_blif()} {self.b.get_declaration_blif()} {self.c.get_declaration_blif()}\n" + \
|
||||
f".outputs" + \
|
||||
"".join([f" {o}" for o in unique_out_wires]) + "\n" + \
|
||||
f".names vdd\n1\n" + \
|
||||
f".names gnd\n0\n"</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_function_blif_flat"><code class="name flex">
|
||||
<span>def <span class="ident">get_function_blif_flat</span></span>(<span>self, top_modul: bool = False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Generates flat Blif code with invocation of subcomponents logic gates Boolean functions via their corresponding truth tables.</p>
|
||||
<p>It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner modul prototype is also modified accordingly. It is used for self three input one bit circuit flat generation.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>top_modul</code></strong> : <code>bool</code>, optional</dt>
|
||||
<dd>Specifies whether the described circuit represents top modul component (self one bit circuit generation). Defaults to False.</dd>
|
||||
</dl>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>Flat Blif code containing invocation of inner subcomponents logic gates Boolean functions.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def get_function_blif_flat(self, top_modul: bool = False):
|
||||
"""Generates flat Blif code with invocation of subcomponents logic gates Boolean functions via their corresponding truth tables.
|
||||
|
||||
It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner modul prototype is also modified accordingly. It is used for self three input one bit circuit flat generation.
|
||||
|
||||
Args:
|
||||
top_modul (bool, optional): Specifies whether the described circuit represents top modul component (self one bit circuit generation). Defaults to False.
|
||||
|
||||
Returns:
|
||||
str: Flat Blif code containing invocation of inner subcomponents logic gates Boolean functions.
|
||||
"""
|
||||
if top_modul:
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(o.name+"_outid"+str(self.out.bus.index(o))) if o.is_const() or o.name in [self.a.name, self.b.name, self.c.name] else unique_out_wires.append(o.name) for o in self.out.bus]
|
||||
return "".join([c.get_function_blif_flat() if c.disable_generation is False else
|
||||
c.out.get_assign_blif(prefix=f"{unique_out_wires.pop(unique_out_wires.index(c.out.name+'_outid'+str(c.outid)))}", output=True) if f"{c.out.name+'_outid'+str(c.outid)}" in unique_out_wires else
|
||||
"" for c in self.components])
|
||||
else:
|
||||
return "".join([c.get_function_blif_flat() for c in self.components])</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_invocation_blif_hier"><code class="name flex">
|
||||
<span>def <span class="ident">get_invocation_blif_hier</span></span>(<span>self, *args, **kwargs)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Generates hierarchical Blif code invocation of corresponding three input one bit circuit's generated function block.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>Hierarchical Blif code subcomponent's model invocation.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def get_invocation_blif_hier(self, *args, **kwargs):
|
||||
"""Generates hierarchical Blif code invocation of corresponding three input one bit circuit's generated function block.
|
||||
|
||||
Returns:
|
||||
str: Hierarchical Blif code subcomponent's model invocation.
|
||||
"""
|
||||
circuit_block = self.__class__()
|
||||
return f".subckt {circuit_block.prefix} {circuit_block.a.prefix}={self.a.get_wire_value_blif()} {circuit_block.b.prefix}={self.b.get_wire_value_blif()} {circuit_block.c.prefix}={self.c.get_wire_value_blif()}{self.out.get_unique_assign_out_wires_blif(function_block_out_bus=circuit_block.out)}\n"</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_invocations_blif_hier"><code class="name flex">
|
||||
<span>def <span class="ident">get_invocations_blif_hier</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Generates hierarchical Blif code with invocation of subcomponents function blocks.</p>
|
||||
<p>It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner modul prototype is also modified accordingly. It is used for self three input one bit circuit hierarchical generation.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>Hierarchical Blif code containing invocation of inner subcomponents function blocks.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def get_invocations_blif_hier(self):
|
||||
"""Generates hierarchical Blif code with invocation of subcomponents function blocks.
|
||||
|
||||
It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner modul prototype is also modified accordingly. It is used for self three input one bit circuit hierarchical generation.
|
||||
|
||||
Returns:
|
||||
str: Hierarchical Blif code containing invocation of inner subcomponents function blocks.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(o.name+"_outid"+str(self.out.bus.index(o))) if o.is_const() or o.name in [self.a.name, self.b.name, self.c.name] else unique_out_wires.append(o.name) for o in self.out.bus]
|
||||
return "".join([c.get_invocation_blif_hier() if c.disable_generation is False else
|
||||
c.out.get_assign_blif(prefix=f"{unique_out_wires.pop(unique_out_wires.index(c.out.name+'_outid'+str(c.outid)))}", output=True) if f"{c.out.name+'_outid'+str(c.outid)}" in unique_out_wires else
|
||||
"" for c in self.components])</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_out_invocation_c"><code class="name flex">
|
||||
<span>def <span class="ident">get_out_invocation_c</span></span>(<span>self, *args, **kwargs)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Generates hierarchical C code invocation of corresponding three input one bit circuit's generated function block.</p>
|
||||
<p>Assigns output values from invocation of the corresponding function block into inner wires present inside the upper
|
||||
component from which function block has been invoked.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>Hierarchical C code subcomponent's C function invocation and output assignment.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def get_out_invocation_c(self, *args, **kwargs):
|
||||
"""Generates hierarchical C code invocation of corresponding three input one bit circuit's generated function block.
|
||||
|
||||
Assigns output values from invocation of the corresponding function block into inner wires present inside the upper
|
||||
component from which function block has been invoked.
|
||||
|
||||
Returns:
|
||||
str: Hierarchical C code subcomponent's C function invocation and output assignment.
|
||||
"""
|
||||
# Used to retrieve proper component's output wire offset position within the output bus
|
||||
output_bus_wire_names = []
|
||||
[output_bus_wire_names.append(w.prefix) for w in self.out.bus]
|
||||
circuit_block = self.__class__()
|
||||
return "".join([f" {c.out.prefix} = ({circuit_block.prefix}({self.a.get_wire_value_c_hier()}, {self.b.get_wire_value_c_hier()}, {self.c.get_wire_value_c_hier()}) >> {output_bus_wire_names.index(c.out.prefix)}) & 0x01;\n" for c in self.components if c.disable_generation is False and c.out.prefix in output_bus_wire_names])</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_out_invocation_v"><code class="name flex">
|
||||
<span>def <span class="ident">get_out_invocation_v</span></span>(<span>self, *args, **kwargs)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Generates hierarchical Verilog code invocation of corresponding three input one bit circuit's generated function block.</p>
|
||||
<p>Assigns output values from invocation of the corresponding function block into inner wires present inside the upper
|
||||
component from which function block has been invoked.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>Hierarchical Verilog code subcomponent's module invocation and output assignment.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def get_out_invocation_v(self, *args, **kwargs):
|
||||
"""Generates hierarchical Verilog code invocation of corresponding three input one bit circuit's generated function block.
|
||||
|
||||
Assigns output values from invocation of the corresponding function block into inner wires present inside the upper
|
||||
component from which function block has been invoked.
|
||||
|
||||
Returns:
|
||||
str: Hierarchical Verilog code subcomponent's module invocation and output assignment.
|
||||
"""
|
||||
circuit_block = self.__class__()
|
||||
return f" {circuit_block.prefix} {circuit_block.prefix}_{self.out.prefix}(.{circuit_block.a.prefix}({self.a.get_wire_value_v_hier()}), .{circuit_block.b.prefix}({self.b.get_wire_value_v_hier()}), .{circuit_block.c.prefix}({self.c.get_wire_value_v_hier()}){self.out.get_unique_assign_out_wires_v(circuit_block)});\n"</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_parameters_cgp"><code class="name flex">
|
||||
<span>def <span class="ident">get_parameters_cgp</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Generates CGP chromosome parameters of corresponding three input one bit circuit.</p>
|
||||
<p>In total seven parameters represent: total inputs, total outputs, number of rows, number of columns (gates),
|
||||
number of each gate's inputs, number of each gate's outputs, quality constant value.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>CGP chromosome parameters of described circuit.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def get_parameters_cgp(self):
|
||||
"""Generates CGP chromosome parameters of corresponding three input one bit circuit.
|
||||
|
||||
In total seven parameters represent: total inputs, total outputs, number of rows, number of columns (gates),
|
||||
number of each gate's inputs, number of each gate's outputs, quality constant value.
|
||||
|
||||
Returns:
|
||||
str: CGP chromosome parameters of described circuit.
|
||||
"""
|
||||
self.circuit_gates = self.get_circuit_gates()
|
||||
return f"{{3,{self.out.N},1,{len(self.circuit_gates)},2,1,0}}"</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_prototype_c"><code class="name flex">
|
||||
<span>def <span class="ident">get_prototype_c</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Generates C code function header to describe corresponding three input one bit circuit's interface in C code.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>Function's name and parameters in C code.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def get_prototype_c(self):
|
||||
"""Generates C code function header to describe corresponding three input one bit circuit's interface in C code.
|
||||
|
||||
Returns:
|
||||
str: Function's name and parameters in C code.
|
||||
"""
|
||||
return f"{self.c_data_type} {self.prefix}({self.c_data_type} {self.a.prefix}, {self.c_data_type} {self.b.prefix}, {self.c_data_type} {self.c.prefix})" + "{" + "\n"</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_prototype_v"><code class="name flex">
|
||||
<span>def <span class="ident">get_prototype_v</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Generates Verilog for flat module header to describe corresponding three input one bit circuit's interface in Verilog.</p>
|
||||
<p>It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner module logic is also modified accordingly. It is used for self three input one bit circuit flat generation.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>Flat module's name and parameters in Verilog.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def get_prototype_v(self):
|
||||
"""Generates Verilog for flat module header to describe corresponding three input one bit circuit's interface in Verilog.
|
||||
|
||||
It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner module logic is also modified accordingly. It is used for self three input one bit circuit flat generation.
|
||||
|
||||
Returns:
|
||||
str: Flat module's name and parameters in Verilog.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(o.name+"_outid"+str(self.out.bus.index(o))) if o.is_const() or o.name in [self.a.name, self.b.name, self.c.name] else unique_out_wires.append(o.name) for o in self.out.bus]
|
||||
return f"module {self.prefix}(input {self.a.name}, input {self.b.name}, input {self.c.name}" + \
|
||||
"".join([f", output {o}" for o in unique_out_wires]) + ");\n"</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_prototype_v_hier"><code class="name flex">
|
||||
<span>def <span class="ident">get_prototype_v_hier</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Generates Verilog for hierarchical module header to describe corresponding three input one bit circuit's interface in Verilog.</p>
|
||||
<p>It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner module logic is also modified accordingly. It is used for self three input one bit circuit hierarchical generation.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>Hierarchical module's name and parameters in Verilog.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def get_prototype_v_hier(self):
|
||||
"""Generates Verilog for hierarchical module header to describe corresponding three input one bit circuit's interface in Verilog.
|
||||
|
||||
It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner module logic is also modified accordingly. It is used for self three input one bit circuit hierarchical generation.
|
||||
|
||||
Returns:
|
||||
str: Hierarchical module's name and parameters in Verilog.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(o.name+"_outid"+str(self.out.bus.index(o))) if o.is_const() or o.name in [self.a.name, self.b.name, self.c.name] else unique_out_wires.append(o.name) for o in self.out.bus]
|
||||
return f"module {self.prefix}(input [0:0] {self.a.name}, input [0:0] {self.b.name}, input [0:0] {self.c.name}" + \
|
||||
"".join([f", output [0:0] {o}" for o in unique_out_wires]) + ");\n"</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_self_init_v_flat"><code class="name flex">
|
||||
<span>def <span class="ident">get_self_init_v_flat</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Generates Verilog for self flat module initialization and assignment of corresponding three input one bit circuit's input/output wires.</p>
|
||||
<p>It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner module prototype is also modified accordingly. It is used for self three input one bit circuit flat generation.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>Verilog flat module's inner circuit wires initialization and assignment.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def get_self_init_v_flat(self):
|
||||
"""Generates Verilog for self flat module initialization and assignment of corresponding three input one bit circuit's input/output wires.
|
||||
|
||||
It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner module prototype is also modified accordingly. It is used for self three input one bit circuit flat generation.
|
||||
|
||||
Returns:
|
||||
str: Verilog flat module's inner circuit wires initialization and assignment.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(o.name+"_outid"+str(self.out.bus.index(o))) if o.is_const() or o.name in [self.a.name, self.b.name, self.c.name] else unique_out_wires.append(o.name) for o in self.out.bus]
|
||||
return "".join([c.get_assign_v_flat() if c.disable_generation is False else
|
||||
f" assign {unique_out_wires.pop(unique_out_wires.index(c.out.name+'_outid'+str(c.outid)))} = {c.out.v_const};\n" if f"{c.out.name+'_outid'+str(c.outid)}" in unique_out_wires and c.out.is_const() else
|
||||
f" assign {unique_out_wires.pop(unique_out_wires.index(c.out.name+'_outid'+str(c.outid)))} = {c.out.name};\n" if f"{c.out.name+'_outid'+str(c.outid)}" in unique_out_wires else
|
||||
f"" for c in self.components])</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_self_init_v_hier"><code class="name flex">
|
||||
<span>def <span class="ident">get_self_init_v_hier</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Generates Verilog for hierarchical module's inner initialization and assignment of corresponding arithmetic circuit's input/output wires.</p>
|
||||
<p>It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner module prototype is also modified accordingly. It is used for self three input one bit circuit hierarchical generation.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>Verilog hierarchical module's inner circuit wires initialization and assignment.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def get_self_init_v_hier(self):
|
||||
"""Generates Verilog for hierarchical module's inner initialization and assignment of corresponding arithmetic circuit's input/output wires.
|
||||
|
||||
It is adapted for generation of general description of three input one bit circuits as well as their modified versions when some inputs are desired as constant values.
|
||||
In such cases the inner module prototype is also modified accordingly. It is used for self three input one bit circuit hierarchical generation.
|
||||
|
||||
Returns:
|
||||
str: Verilog hierarchical module's inner circuit wires initialization and assignment.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(o.name+"_outid"+str(self.out.bus.index(o))) if o.is_const() or o.name in [self.a.name, self.b.name, self.c.name] else unique_out_wires.append(o.name) for o in self.out.bus]
|
||||
return "".join([c.get_gate_invocation_v() if c.disable_generation is False else
|
||||
f" assign {unique_out_wires.pop(unique_out_wires.index(c.out.name+'_outid'+str(c.outid)))}[0] = {c.out.v_const};\n" if f"{c.out.name+'_outid'+str(c.outid)}" in unique_out_wires and c.out.is_const() else
|
||||
f" assign {unique_out_wires.pop(unique_out_wires.index(c.out.name+'_outid'+str(c.outid)))}[0] = {c.out.name}[0];\n" if f"{c.out.name+'_outid'+str(c.outid)}" in unique_out_wires else
|
||||
f"" for c in self.components])</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Inherited members</h3>
|
||||
<ul class="hlist">
|
||||
<li><code><b><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit" href="two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit">TwoInputOneBitCircuit</a></b></code>:
|
||||
<ul class="hlist">
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.add_component" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component">add_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_blif_code_flat" href="two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_blif_code_flat">get_blif_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_blif_code_hier" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier">get_blif_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_c_code_flat" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat">get_c_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_c_code_hier" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier">get_c_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_carry_wire" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire">get_carry_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_cgp_code_flat" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat">get_cgp_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_cgp_wires" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires">get_cgp_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_circuit_blif" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif">get_circuit_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_circuit_c" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c">get_circuit_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_circuit_gates" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates">get_circuit_gates</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_circuit_v" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v">get_circuit_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_circuit_wire_index" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index">get_circuit_wire_index</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_component_types" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types">get_component_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_c_flat" href="two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_c_flat">get_declaration_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_c_hier" href="two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_c_hier">get_declaration_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_v_flat" href="two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_v_flat">get_declaration_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_v_hier" href="two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_v_hier">get_declaration_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declarations_c_hier" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier">get_declarations_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declarations_v_flat" href="two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declarations_v_flat">get_declarations_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declarations_v_hier" href="two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declarations_v_hier">get_declarations_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_blif" href="two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_blif">get_function_block_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_c" href="two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_c">get_function_block_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_v" href="two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_v">get_function_block_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_blocks_blif" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif">get_function_blocks_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_blocks_c" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c">get_function_blocks_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_blocks_v" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v">get_function_blocks_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_blif" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif">get_function_out_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_c_flat" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat">get_function_out_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_c_hier" href="two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_c_hier">get_function_out_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_v_flat" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat">get_function_out_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_v_hier" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier">get_function_out_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_includes_c" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c">get_includes_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_c_flat" href="two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_c_flat">get_init_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_c_hier" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier">get_init_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_v_flat" href="two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_v_flat">get_init_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_v_hier" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier">get_init_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_instance_num" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num">get_instance_num</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_multi_bit_components" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components">get_multi_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_one_bit_components" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components">get_one_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_outputs_cgp" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp">get_outputs_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_previous_component" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component">get_previous_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_prototype_blif" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif">get_prototype_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_sum_wire" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire">get_sum_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_triplets_cgp" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp">get_triplets_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_unique_types" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types">get_unique_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_v_code_flat" href="two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_v_code_flat">get_v_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_v_code_hier" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier">get_v_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.save_wire_id" href="../arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id">save_wire_id</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits" href="index.html">ariths_gen.core.one_bit_circuits</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit" href="#ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit">ThreeInputOneBitCircuit</a></code></h4>
|
||||
<ul class="">
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_declaration_blif" href="#ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_declaration_blif">get_declaration_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_function_blif_flat" href="#ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_function_blif_flat">get_function_blif_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_invocation_blif_hier" href="#ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_invocation_blif_hier">get_invocation_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_invocations_blif_hier" href="#ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_invocations_blif_hier">get_invocations_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_out_invocation_c" href="#ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_out_invocation_c">get_out_invocation_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_out_invocation_v" href="#ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_out_invocation_v">get_out_invocation_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_parameters_cgp" href="#ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_parameters_cgp">get_parameters_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_prototype_c" href="#ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_prototype_c">get_prototype_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_prototype_v" href="#ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_prototype_v">get_prototype_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_prototype_v_hier" href="#ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_prototype_v_hier">get_prototype_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_self_init_v_flat" href="#ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_self_init_v_flat">get_self_init_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_self_init_v_hier" href="#ariths_gen.core.one_bit_circuits.three_input_one_bit_circuit.ThreeInputOneBitCircuit.get_self_init_v_hier">get_self_init_v_hier</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
1567
ariths_gen/core/one_bit_circuits/two_input_one_bit_circuit.html
Normal file
1567
ariths_gen/core/one_bit_circuits/two_input_one_bit_circuit.html
Normal file
File diff suppressed because it is too large
Load Diff
95
ariths_gen/index.html
Normal file
95
ariths_gen/index.html
Normal file
@ -0,0 +1,95 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Package <code>ariths_gen</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">from ariths_gen.wire_components import (
|
||||
wires,
|
||||
buses
|
||||
)
|
||||
|
||||
from ariths_gen.one_bit_circuits import (
|
||||
logic_gates,
|
||||
one_bit_components
|
||||
)
|
||||
|
||||
from ariths_gen.multi_bit_circuits import (
|
||||
adders,
|
||||
multipliers,
|
||||
dividers
|
||||
)</code></pre>
|
||||
</details>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
|
||||
<dl>
|
||||
<dt><code class="name"><a title="ariths_gen.core" href="core/index.html">ariths_gen.core</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="ariths_gen.multi_bit_circuits" href="multi_bit_circuits/index.html">ariths_gen.multi_bit_circuits</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="ariths_gen.one_bit_circuits" href="one_bit_circuits/index.html">ariths_gen.one_bit_circuits</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="ariths_gen.wire_components" href="wire_components/index.html">ariths_gen.wire_components</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.core" href="core/index.html">ariths_gen.core</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits" href="multi_bit_circuits/index.html">ariths_gen.multi_bit_circuits</a></code></li>
|
||||
<li><code><a title="ariths_gen.one_bit_circuits" href="one_bit_circuits/index.html">ariths_gen.one_bit_circuits</a></code></li>
|
||||
<li><code><a title="ariths_gen.wire_components" href="wire_components/index.html">ariths_gen.wire_components</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
669
ariths_gen/multi_bit_circuits/adders/carry_lookahead_adder.html
Normal file
669
ariths_gen/multi_bit_circuits/adders/carry_lookahead_adder.html
Normal file
@ -0,0 +1,669 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">from ariths_gen.wire_components import (
|
||||
Wire,
|
||||
ConstantWireValue0,
|
||||
ConstantWireValue1,
|
||||
Bus
|
||||
)
|
||||
from ariths_gen.core.arithmetic_circuits import (
|
||||
ArithmeticCircuit,
|
||||
MultiplierCircuit
|
||||
)
|
||||
from ariths_gen.core.logic_gate_circuits import (
|
||||
MultipleInputLogicGate
|
||||
)
|
||||
from ariths_gen.one_bit_circuits.one_bit_components import (
|
||||
HalfAdder,
|
||||
PGLogicBlock,
|
||||
FullAdder,
|
||||
FullAdderPG
|
||||
)
|
||||
from ariths_gen.one_bit_circuits.logic_gates import (
|
||||
AndGate,
|
||||
NandGate,
|
||||
OrGate,
|
||||
NorGate,
|
||||
XorGate,
|
||||
XnorGate,
|
||||
NotGate
|
||||
)
|
||||
|
||||
|
||||
class UnsignedCarryLookaheadAdder(ArithmeticCircuit):
|
||||
"""Class representing unsigned carry-lookahead adder.
|
||||
|
||||
Unsigned carry-lookahead adder represents faster adder circuit which is composed
|
||||
of more complex circuitry but provides much less propagation delay as opposed to rca.
|
||||
It is mainly composed of propagate/generate blocks and many AND/OR gates to calculate carries individually.
|
||||
|
||||
Class enables to choose the size of composite inner cla blocks (default is 4). These cla blocks are then cascaded
|
||||
to form the final N bit adder.
|
||||
|
||||
```
|
||||
B3 A3 B2 A2 B1 A1 B0 A0
|
||||
│ │ │ │ │ │ │ │
|
||||
┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ PG │ │ PG │ │ PG │ │ PG │
|
||||
│ block│ │ block│ │ block│ │ block│
|
||||
│ │ │ │ │ │ │ │
|
||||
└─┬┬┬──┘ └─┬┬┬──┘ └─┬┬┬──┘ └─┬┬┬──┘
|
||||
│││G3P3S3 │││G2P2S2 │││G1P1S1 │││G0P0S0
|
||||
┌─▼▼▼────────▼▼▼────────▼▼▼────────▼▼▼──┐
|
||||
│ Carry Lookahead logic │
|
||||
│ │
|
||||
└┬────┬───────┬──────────┬──────────┬───┘
|
||||
│ │ │ │ │
|
||||
▼ ▼ ▼ ▼ ▼
|
||||
Cout S3 S1 S0 S0
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
cla_block_size (int, optional): Size of each composite cla adder block size. Defaults to 4.
|
||||
prefix (str, optional): Prefix name of unsigned cla. Defaults to "u_cla".
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, cla_block_size: int = 4, prefix: str = "u_cla"):
|
||||
super().__init__()
|
||||
self.N = max(a.N, b.N)
|
||||
self.prefix = prefix
|
||||
self.a = Bus(prefix=a.prefix, wires_list=a.bus)
|
||||
self.b = Bus(prefix=b.prefix, wires_list=b.bus)
|
||||
|
||||
# Bus sign extension in case buses have different lengths
|
||||
self.a.bus_extend(N=self.N, prefix=a.prefix)
|
||||
self.b.bus_extend(N=self.N, prefix=b.prefix)
|
||||
|
||||
# Output wires for N sum bits and additional cout bit
|
||||
self.out = Bus(self.prefix+"_out", self.N+1)
|
||||
|
||||
# To signify current number of blocks and number of bits that remain to be added into function blocks
|
||||
N_blocks = 0
|
||||
N_wires = self.N
|
||||
cin = ConstantWireValue0()
|
||||
|
||||
while N_wires != 0:
|
||||
# Lists containing all propagate/generate wires
|
||||
self.propagate = []
|
||||
self.generate = []
|
||||
# Cin0 used as a first generate wire for obtaining next carry bits
|
||||
self.generate.append(cin)
|
||||
block_size = cla_block_size if N_wires >= cla_block_size else N_wires
|
||||
|
||||
# Gradual addition of propagate/generate logic blocks and AND/OR gates for Cout bits generation, XOR gates for Sum bits generation
|
||||
for i in range(block_size):
|
||||
pg_block = PGLogicBlock(self.a.get_wire((N_blocks*cla_block_size)+i), self.b.get_wire((N_blocks*cla_block_size)+i), prefix=self.prefix+"_pg_logic"+str(self.get_instance_num(cls=PGLogicBlock)))
|
||||
self.propagate.append(pg_block.get_propagate_wire())
|
||||
self.generate.append(pg_block.get_generate_wire())
|
||||
self.add_component(pg_block)
|
||||
|
||||
if i == 0 and N_blocks == 0:
|
||||
obj_sum_xor = XorGate(pg_block.get_sum_wire(), cin, prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), parent_component=self)
|
||||
self.add_component(obj_sum_xor)
|
||||
self.out.connect(i+(N_blocks*cla_block_size), obj_sum_xor.out)
|
||||
|
||||
# Carry propagation calculation
|
||||
obj_and = AndGate(self.propagate[(N_blocks*cla_block_size)+i], self.generate[(N_blocks*cla_block_size)+i], prefix=self.prefix+"_and"+str(self.get_instance_num(cls=AndGate)), parent_component=self)
|
||||
self.add_component(obj_and)
|
||||
|
||||
# Carry bit generation
|
||||
obj_cout_or = OrGate(pg_block.get_generate_wire(), self.get_previous_component().out, prefix=self.prefix+"_or"+str(self.get_instance_num(cls=OrGate, count_disabled_gates=False)), parent_component=self)
|
||||
self.add_component(obj_cout_or)
|
||||
else:
|
||||
obj_sum_xor = XorGate(pg_block.get_sum_wire(), self.get_previous_component(2).out, prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), parent_component=self)
|
||||
self.add_component(obj_sum_xor)
|
||||
self.out.connect(i+(N_blocks*cla_block_size), obj_sum_xor.out)
|
||||
|
||||
# List of AND gates outputs that are later combined in a multi-bit OR gate
|
||||
composite_or_gates_inputs = []
|
||||
|
||||
for g_index in range(len(self.generate)-1):
|
||||
composite_wires = []
|
||||
# Getting a list of wires used for current bit position cout composite AND gate's generation
|
||||
# E.g. for Cout2 = G1 + G0·P1 C0·P0·P1 it gets a list containing [C0,P0,P1] then [G0,P1]
|
||||
composite_wires.append(self.generate[g_index])
|
||||
for p_index in range(len(self.propagate)-1, g_index-1, -1):
|
||||
composite_wires.append(self.propagate[p_index])
|
||||
|
||||
# For each pg pair values algorithmically combine two input AND gates to replace multiple input gates (resolves fan-in issue)
|
||||
pg_wires = Bus(wires_list=composite_wires)
|
||||
multi_bit_and_gate = MultipleInputLogicGate(a=pg_wires, two_input_gate_cls=AndGate, prefix=self.prefix+"_and", parent_component=self)
|
||||
composite_or_gates_inputs.append(multi_bit_and_gate.out)
|
||||
|
||||
# Final OR gates cascade using generated AND gates output wires
|
||||
composite_or_wires = Bus(wires_list=composite_or_gates_inputs)
|
||||
multi_bit_or_gate = MultipleInputLogicGate(a=composite_or_wires, two_input_gate_cls=OrGate, prefix=self.prefix+"_or", parent_component=self)
|
||||
|
||||
# Carry bit generation
|
||||
obj_cout_or = OrGate(pg_block.get_generate_wire(), multi_bit_or_gate.out, prefix=self.prefix+"_or"+str(self.get_instance_num(cls=OrGate, count_disabled_gates=False)), parent_component=self)
|
||||
self.add_component(obj_cout_or)
|
||||
|
||||
# Updating cin for the the next bypass block
|
||||
# Also updating cout value which is used as cin for the first adder of the next block
|
||||
cin = obj_cout_or.out
|
||||
|
||||
N_wires -= block_size
|
||||
N_blocks += 1
|
||||
|
||||
# Connection of final Cout
|
||||
self.out.connect(self.N, cin)
|
||||
|
||||
|
||||
class SignedCarryLookaheadAdder(UnsignedCarryLookaheadAdder, ArithmeticCircuit):
|
||||
"""Class representing signed carry-lookahead adder.
|
||||
|
||||
Signed carry-lookahead adder represents faster adder circuit which is composed
|
||||
of more complex circuitry but provides much less propagation delay as opposed to rca.
|
||||
It is mainly composed of propagate/generate blocks and many AND/OR gates to calculate carries individually.
|
||||
|
||||
Class enables to choose the size of composite inner cla blocks (default is 4). These cla blocks are then cascaded
|
||||
to form the final N bit adder.
|
||||
At last XOR gates are used to ensure proper sign extension.
|
||||
|
||||
```
|
||||
B3 A3 B2 A2 B1 A1 B0 A0
|
||||
│ │ │ │ │ │ │ │
|
||||
┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ PG │ │ PG │ │ PG │ │ PG │
|
||||
│ block│ │ block│ │ block│ │ block│
|
||||
│ │ │ │ │ │ │ │
|
||||
└─┬┬┬──┘ └─┬┬┬──┘ └─┬┬┬──┘ └─┬┬┬──┘
|
||||
│││G3P3S3 │││G2P2S2 │││G1P1S1 │││G0P0S0
|
||||
┌─▼▼▼────────▼▼▼────────▼▼▼────────▼▼▼──┐
|
||||
│ Carry Lookahead logic │
|
||||
│ with sign extension │
|
||||
└┬────┬───────┬──────────┬──────────┬───┘
|
||||
│ │ │ │ │
|
||||
▼ ▼ ▼ ▼ ▼
|
||||
Cout S3 S1 S0 S0
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
cla_block_size (int, optional): Size of each composite cla adder block size. Defaults to 4.
|
||||
prefix (str, optional): Prefix name of signed cla. Defaults to "s_cla".
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, cla_block_size: int = 4, prefix: str = "s_cla"):
|
||||
super().__init__(a=a, b=b, cla_block_size=cla_block_size, prefix=prefix)
|
||||
self.c_data_type = "int64_t"
|
||||
|
||||
# Additional XOR gates to ensure correct sign extension in case of sign addition
|
||||
sign_xor_1 = XorGate(self.a.get_wire(self.N-1), self.b.get_wire(self.N-1), prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), parent_component=self)
|
||||
self.add_component(sign_xor_1)
|
||||
sign_xor_2 = XorGate(sign_xor_1.out, self.get_previous_component(2).out, prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), parent_component=self)
|
||||
self.add_component(sign_xor_2)
|
||||
self.out.connect(self.N, sign_xor_2.out)</code></pre>
|
||||
</details>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.SignedCarryLookaheadAdder"><code class="flex name class">
|
||||
<span>class <span class="ident">SignedCarryLookaheadAdder</span></span>
|
||||
<span>(</span><span>a: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, b: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, cla_block_size: int = 4, prefix: str = 's_cla')</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Class representing signed carry-lookahead adder.</p>
|
||||
<p>Signed carry-lookahead adder represents faster adder circuit which is composed
|
||||
of more complex circuitry but provides much less propagation delay as opposed to rca.
|
||||
It is mainly composed of propagate/generate blocks and many AND/OR gates to calculate carries individually.</p>
|
||||
<p>Class enables to choose the size of composite inner cla blocks (default is 4). These cla blocks are then cascaded
|
||||
to form the final N bit adder.
|
||||
At last XOR gates are used to ensure proper sign extension.</p>
|
||||
<pre><code> B3 A3 B2 A2 B1 A1 B0 A0
|
||||
│ │ │ │ │ │ │ │
|
||||
┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ PG │ │ PG │ │ PG │ │ PG │
|
||||
│ block│ │ block│ │ block│ │ block│
|
||||
│ │ │ │ │ │ │ │
|
||||
└─┬┬┬──┘ └─┬┬┬──┘ └─┬┬┬──┘ └─┬┬┬──┘
|
||||
│││G3P3S3 │││G2P2S2 │││G1P1S1 │││G0P0S0
|
||||
┌─▼▼▼────────▼▼▼────────▼▼▼────────▼▼▼──┐
|
||||
│ Carry Lookahead logic │
|
||||
│ with sign extension │
|
||||
└┬────┬───────┬──────────┬──────────┬───┘
|
||||
│ │ │ │ │
|
||||
▼ ▼ ▼ ▼ ▼
|
||||
Cout S3 S1 S0 S0
|
||||
</code></pre>
|
||||
<p>Description of the <strong>init</strong> method.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>a</code></strong> : <code>Bus</code></dt>
|
||||
<dd>First input bus.</dd>
|
||||
<dt><strong><code>b</code></strong> : <code>Bus</code></dt>
|
||||
<dd>Second input bus.</dd>
|
||||
<dt><strong><code>cla_block_size</code></strong> : <code>int</code>, optional</dt>
|
||||
<dd>Size of each composite cla adder block size. Defaults to 4.</dd>
|
||||
<dt><strong><code>prefix</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Prefix name of signed cla. Defaults to "s_cla".</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class SignedCarryLookaheadAdder(UnsignedCarryLookaheadAdder, ArithmeticCircuit):
|
||||
"""Class representing signed carry-lookahead adder.
|
||||
|
||||
Signed carry-lookahead adder represents faster adder circuit which is composed
|
||||
of more complex circuitry but provides much less propagation delay as opposed to rca.
|
||||
It is mainly composed of propagate/generate blocks and many AND/OR gates to calculate carries individually.
|
||||
|
||||
Class enables to choose the size of composite inner cla blocks (default is 4). These cla blocks are then cascaded
|
||||
to form the final N bit adder.
|
||||
At last XOR gates are used to ensure proper sign extension.
|
||||
|
||||
```
|
||||
B3 A3 B2 A2 B1 A1 B0 A0
|
||||
│ │ │ │ │ │ │ │
|
||||
┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ PG │ │ PG │ │ PG │ │ PG │
|
||||
│ block│ │ block│ │ block│ │ block│
|
||||
│ │ │ │ │ │ │ │
|
||||
└─┬┬┬──┘ └─┬┬┬──┘ └─┬┬┬──┘ └─┬┬┬──┘
|
||||
│││G3P3S3 │││G2P2S2 │││G1P1S1 │││G0P0S0
|
||||
┌─▼▼▼────────▼▼▼────────▼▼▼────────▼▼▼──┐
|
||||
│ Carry Lookahead logic │
|
||||
│ with sign extension │
|
||||
└┬────┬───────┬──────────┬──────────┬───┘
|
||||
│ │ │ │ │
|
||||
▼ ▼ ▼ ▼ ▼
|
||||
Cout S3 S1 S0 S0
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
cla_block_size (int, optional): Size of each composite cla adder block size. Defaults to 4.
|
||||
prefix (str, optional): Prefix name of signed cla. Defaults to "s_cla".
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, cla_block_size: int = 4, prefix: str = "s_cla"):
|
||||
super().__init__(a=a, b=b, cla_block_size=cla_block_size, prefix=prefix)
|
||||
self.c_data_type = "int64_t"
|
||||
|
||||
# Additional XOR gates to ensure correct sign extension in case of sign addition
|
||||
sign_xor_1 = XorGate(self.a.get_wire(self.N-1), self.b.get_wire(self.N-1), prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), parent_component=self)
|
||||
self.add_component(sign_xor_1)
|
||||
sign_xor_2 = XorGate(sign_xor_1.out, self.get_previous_component(2).out, prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), parent_component=self)
|
||||
self.add_component(sign_xor_2)
|
||||
self.out.connect(self.N, sign_xor_2.out)</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder" href="#ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder">UnsignedCarryLookaheadAdder</a></li>
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></li>
|
||||
</ul>
|
||||
<h3>Inherited members</h3>
|
||||
<ul class="hlist">
|
||||
<li><code><b><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder" href="#ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder">UnsignedCarryLookaheadAdder</a></b></code>:
|
||||
<ul class="hlist">
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.add_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component">add_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_blif_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_flat">get_blif_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_blif_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier">get_blif_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_c_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat">get_c_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_c_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier">get_c_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_carry_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire">get_carry_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_cgp_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat">get_cgp_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_cgp_wires" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires">get_cgp_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_circuit_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif">get_circuit_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_circuit_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c">get_circuit_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_circuit_gates" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates">get_circuit_gates</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_circuit_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v">get_circuit_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_circuit_wire_index" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index">get_circuit_wire_index</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_component_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types">get_component_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_declaration_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_blif">get_declaration_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_declaration_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_flat">get_declaration_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_declaration_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_hier">get_declaration_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_declaration_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_flat">get_declaration_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_declaration_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_hier">get_declaration_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_declarations_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier">get_declarations_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_declarations_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_v_hier">get_declarations_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_function_blif_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blif_flat">get_function_blif_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_function_block_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_blif">get_function_block_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_function_block_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_c">get_function_block_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_function_block_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_v">get_function_block_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_function_blocks_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif">get_function_blocks_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_function_blocks_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c">get_function_blocks_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_function_blocks_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v">get_function_blocks_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_function_out_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif">get_function_out_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_function_out_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat">get_function_out_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_function_out_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_hier">get_function_out_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_function_out_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat">get_function_out_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_function_out_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier">get_function_out_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_includes_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c">get_includes_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_init_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_flat">get_init_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_init_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier">get_init_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_init_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_flat">get_init_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_init_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier">get_init_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_instance_num" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num">get_instance_num</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_invocation_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocation_blif_hier">get_invocation_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_invocations_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocations_blif_hier">get_invocations_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_multi_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components">get_multi_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_one_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components">get_one_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_out_invocation_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_c">get_out_invocation_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_out_invocation_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_v">get_out_invocation_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_outputs_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp">get_outputs_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_parameters_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_parameters_cgp">get_parameters_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_previous_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component">get_previous_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_prototype_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif">get_prototype_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_prototype_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_c">get_prototype_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_prototype_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_v">get_prototype_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_sum_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire">get_sum_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_triplets_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp">get_triplets_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_unique_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types">get_unique_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_v_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_flat">get_v_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.get_v_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier">get_v_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder.save_wire_id" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id">save_wire_id</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dt id="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder"><code class="flex name class">
|
||||
<span>class <span class="ident">UnsignedCarryLookaheadAdder</span></span>
|
||||
<span>(</span><span>a: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, b: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, cla_block_size: int = 4, prefix: str = 'u_cla')</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Class representing unsigned carry-lookahead adder.</p>
|
||||
<p>Unsigned carry-lookahead adder represents faster adder circuit which is composed
|
||||
of more complex circuitry but provides much less propagation delay as opposed to rca.
|
||||
It is mainly composed of propagate/generate blocks and many AND/OR gates to calculate carries individually.</p>
|
||||
<p>Class enables to choose the size of composite inner cla blocks (default is 4). These cla blocks are then cascaded
|
||||
to form the final N bit adder.</p>
|
||||
<pre><code> B3 A3 B2 A2 B1 A1 B0 A0
|
||||
│ │ │ │ │ │ │ │
|
||||
┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ PG │ │ PG │ │ PG │ │ PG │
|
||||
│ block│ │ block│ │ block│ │ block│
|
||||
│ │ │ │ │ │ │ │
|
||||
└─┬┬┬──┘ └─┬┬┬──┘ └─┬┬┬──┘ └─┬┬┬──┘
|
||||
│││G3P3S3 │││G2P2S2 │││G1P1S1 │││G0P0S0
|
||||
┌─▼▼▼────────▼▼▼────────▼▼▼────────▼▼▼──┐
|
||||
│ Carry Lookahead logic │
|
||||
│ │
|
||||
└┬────┬───────┬──────────┬──────────┬───┘
|
||||
│ │ │ │ │
|
||||
▼ ▼ ▼ ▼ ▼
|
||||
Cout S3 S1 S0 S0
|
||||
</code></pre>
|
||||
<p>Description of the <strong>init</strong> method.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>a</code></strong> : <code>Bus</code></dt>
|
||||
<dd>First input bus.</dd>
|
||||
<dt><strong><code>b</code></strong> : <code>Bus</code></dt>
|
||||
<dd>Second input bus.</dd>
|
||||
<dt><strong><code>cla_block_size</code></strong> : <code>int</code>, optional</dt>
|
||||
<dd>Size of each composite cla adder block size. Defaults to 4.</dd>
|
||||
<dt><strong><code>prefix</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Prefix name of unsigned cla. Defaults to "u_cla".</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class UnsignedCarryLookaheadAdder(ArithmeticCircuit):
|
||||
"""Class representing unsigned carry-lookahead adder.
|
||||
|
||||
Unsigned carry-lookahead adder represents faster adder circuit which is composed
|
||||
of more complex circuitry but provides much less propagation delay as opposed to rca.
|
||||
It is mainly composed of propagate/generate blocks and many AND/OR gates to calculate carries individually.
|
||||
|
||||
Class enables to choose the size of composite inner cla blocks (default is 4). These cla blocks are then cascaded
|
||||
to form the final N bit adder.
|
||||
|
||||
```
|
||||
B3 A3 B2 A2 B1 A1 B0 A0
|
||||
│ │ │ │ │ │ │ │
|
||||
┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ PG │ │ PG │ │ PG │ │ PG │
|
||||
│ block│ │ block│ │ block│ │ block│
|
||||
│ │ │ │ │ │ │ │
|
||||
└─┬┬┬──┘ └─┬┬┬──┘ └─┬┬┬──┘ └─┬┬┬──┘
|
||||
│││G3P3S3 │││G2P2S2 │││G1P1S1 │││G0P0S0
|
||||
┌─▼▼▼────────▼▼▼────────▼▼▼────────▼▼▼──┐
|
||||
│ Carry Lookahead logic │
|
||||
│ │
|
||||
└┬────┬───────┬──────────┬──────────┬───┘
|
||||
│ │ │ │ │
|
||||
▼ ▼ ▼ ▼ ▼
|
||||
Cout S3 S1 S0 S0
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
cla_block_size (int, optional): Size of each composite cla adder block size. Defaults to 4.
|
||||
prefix (str, optional): Prefix name of unsigned cla. Defaults to "u_cla".
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, cla_block_size: int = 4, prefix: str = "u_cla"):
|
||||
super().__init__()
|
||||
self.N = max(a.N, b.N)
|
||||
self.prefix = prefix
|
||||
self.a = Bus(prefix=a.prefix, wires_list=a.bus)
|
||||
self.b = Bus(prefix=b.prefix, wires_list=b.bus)
|
||||
|
||||
# Bus sign extension in case buses have different lengths
|
||||
self.a.bus_extend(N=self.N, prefix=a.prefix)
|
||||
self.b.bus_extend(N=self.N, prefix=b.prefix)
|
||||
|
||||
# Output wires for N sum bits and additional cout bit
|
||||
self.out = Bus(self.prefix+"_out", self.N+1)
|
||||
|
||||
# To signify current number of blocks and number of bits that remain to be added into function blocks
|
||||
N_blocks = 0
|
||||
N_wires = self.N
|
||||
cin = ConstantWireValue0()
|
||||
|
||||
while N_wires != 0:
|
||||
# Lists containing all propagate/generate wires
|
||||
self.propagate = []
|
||||
self.generate = []
|
||||
# Cin0 used as a first generate wire for obtaining next carry bits
|
||||
self.generate.append(cin)
|
||||
block_size = cla_block_size if N_wires >= cla_block_size else N_wires
|
||||
|
||||
# Gradual addition of propagate/generate logic blocks and AND/OR gates for Cout bits generation, XOR gates for Sum bits generation
|
||||
for i in range(block_size):
|
||||
pg_block = PGLogicBlock(self.a.get_wire((N_blocks*cla_block_size)+i), self.b.get_wire((N_blocks*cla_block_size)+i), prefix=self.prefix+"_pg_logic"+str(self.get_instance_num(cls=PGLogicBlock)))
|
||||
self.propagate.append(pg_block.get_propagate_wire())
|
||||
self.generate.append(pg_block.get_generate_wire())
|
||||
self.add_component(pg_block)
|
||||
|
||||
if i == 0 and N_blocks == 0:
|
||||
obj_sum_xor = XorGate(pg_block.get_sum_wire(), cin, prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), parent_component=self)
|
||||
self.add_component(obj_sum_xor)
|
||||
self.out.connect(i+(N_blocks*cla_block_size), obj_sum_xor.out)
|
||||
|
||||
# Carry propagation calculation
|
||||
obj_and = AndGate(self.propagate[(N_blocks*cla_block_size)+i], self.generate[(N_blocks*cla_block_size)+i], prefix=self.prefix+"_and"+str(self.get_instance_num(cls=AndGate)), parent_component=self)
|
||||
self.add_component(obj_and)
|
||||
|
||||
# Carry bit generation
|
||||
obj_cout_or = OrGate(pg_block.get_generate_wire(), self.get_previous_component().out, prefix=self.prefix+"_or"+str(self.get_instance_num(cls=OrGate, count_disabled_gates=False)), parent_component=self)
|
||||
self.add_component(obj_cout_or)
|
||||
else:
|
||||
obj_sum_xor = XorGate(pg_block.get_sum_wire(), self.get_previous_component(2).out, prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), parent_component=self)
|
||||
self.add_component(obj_sum_xor)
|
||||
self.out.connect(i+(N_blocks*cla_block_size), obj_sum_xor.out)
|
||||
|
||||
# List of AND gates outputs that are later combined in a multi-bit OR gate
|
||||
composite_or_gates_inputs = []
|
||||
|
||||
for g_index in range(len(self.generate)-1):
|
||||
composite_wires = []
|
||||
# Getting a list of wires used for current bit position cout composite AND gate's generation
|
||||
# E.g. for Cout2 = G1 + G0·P1 C0·P0·P1 it gets a list containing [C0,P0,P1] then [G0,P1]
|
||||
composite_wires.append(self.generate[g_index])
|
||||
for p_index in range(len(self.propagate)-1, g_index-1, -1):
|
||||
composite_wires.append(self.propagate[p_index])
|
||||
|
||||
# For each pg pair values algorithmically combine two input AND gates to replace multiple input gates (resolves fan-in issue)
|
||||
pg_wires = Bus(wires_list=composite_wires)
|
||||
multi_bit_and_gate = MultipleInputLogicGate(a=pg_wires, two_input_gate_cls=AndGate, prefix=self.prefix+"_and", parent_component=self)
|
||||
composite_or_gates_inputs.append(multi_bit_and_gate.out)
|
||||
|
||||
# Final OR gates cascade using generated AND gates output wires
|
||||
composite_or_wires = Bus(wires_list=composite_or_gates_inputs)
|
||||
multi_bit_or_gate = MultipleInputLogicGate(a=composite_or_wires, two_input_gate_cls=OrGate, prefix=self.prefix+"_or", parent_component=self)
|
||||
|
||||
# Carry bit generation
|
||||
obj_cout_or = OrGate(pg_block.get_generate_wire(), multi_bit_or_gate.out, prefix=self.prefix+"_or"+str(self.get_instance_num(cls=OrGate, count_disabled_gates=False)), parent_component=self)
|
||||
self.add_component(obj_cout_or)
|
||||
|
||||
# Updating cin for the the next bypass block
|
||||
# Also updating cout value which is used as cin for the first adder of the next block
|
||||
cin = obj_cout_or.out
|
||||
|
||||
N_wires -= block_size
|
||||
N_blocks += 1
|
||||
|
||||
# Connection of final Cout
|
||||
self.out.connect(self.N, cin)</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></li>
|
||||
</ul>
|
||||
<h3>Subclasses</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.SignedCarryLookaheadAdder" href="#ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.SignedCarryLookaheadAdder">SignedCarryLookaheadAdder</a></li>
|
||||
</ul>
|
||||
<h3>Inherited members</h3>
|
||||
<ul class="hlist">
|
||||
<li><code><b><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></b></code>:
|
||||
<ul class="hlist">
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component">add_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_flat">get_blif_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier">get_blif_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat">get_c_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier">get_c_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire">get_carry_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat">get_cgp_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires">get_cgp_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif">get_circuit_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c">get_circuit_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates">get_circuit_gates</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v">get_circuit_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index">get_circuit_wire_index</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types">get_component_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_blif">get_declaration_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_flat">get_declaration_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_hier">get_declaration_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_flat">get_declaration_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_hier">get_declaration_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier">get_declarations_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_v_hier">get_declarations_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blif_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blif_flat">get_function_blif_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_blif">get_function_block_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_c">get_function_block_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_v">get_function_block_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif">get_function_blocks_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c">get_function_blocks_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v">get_function_blocks_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif">get_function_out_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat">get_function_out_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_hier">get_function_out_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat">get_function_out_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier">get_function_out_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c">get_includes_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_flat">get_init_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier">get_init_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_flat">get_init_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier">get_init_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num">get_instance_num</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocation_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocation_blif_hier">get_invocation_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocations_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocations_blif_hier">get_invocations_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components">get_multi_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components">get_one_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_c">get_out_invocation_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_v">get_out_invocation_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp">get_outputs_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_parameters_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_parameters_cgp">get_parameters_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component">get_previous_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif">get_prototype_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_c">get_prototype_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_v">get_prototype_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire">get_sum_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp">get_triplets_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types">get_unique_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_flat">get_v_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier">get_v_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id">save_wire_id</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders" href="index.html">ariths_gen.multi_bit_circuits.adders</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.SignedCarryLookaheadAdder" href="#ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.SignedCarryLookaheadAdder">SignedCarryLookaheadAdder</a></code></h4>
|
||||
</li>
|
||||
<li>
|
||||
<h4><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder" href="#ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder">UnsignedCarryLookaheadAdder</a></code></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
643
ariths_gen/multi_bit_circuits/adders/carry_skip_adder.html
Normal file
643
ariths_gen/multi_bit_circuits/adders/carry_skip_adder.html
Normal file
@ -0,0 +1,643 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen.multi_bit_circuits.adders.carry_skip_adder API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>ariths_gen.multi_bit_circuits.adders.carry_skip_adder</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">from ariths_gen.wire_components import (
|
||||
Wire,
|
||||
ConstantWireValue0,
|
||||
ConstantWireValue1,
|
||||
Bus,
|
||||
wires
|
||||
)
|
||||
from ariths_gen.core.arithmetic_circuits import (
|
||||
ArithmeticCircuit,
|
||||
MultiplierCircuit
|
||||
)
|
||||
from ariths_gen.core.logic_gate_circuits import (
|
||||
MultipleInputLogicGate
|
||||
)
|
||||
from ariths_gen.one_bit_circuits.one_bit_components import (
|
||||
HalfAdder,
|
||||
PGLogicBlock,
|
||||
FullAdder,
|
||||
FullAdderPG,
|
||||
TwoOneMultiplexer
|
||||
)
|
||||
from ariths_gen.one_bit_circuits.logic_gates import (
|
||||
AndGate,
|
||||
NandGate,
|
||||
OrGate,
|
||||
NorGate,
|
||||
XorGate,
|
||||
XnorGate,
|
||||
NotGate
|
||||
)
|
||||
|
||||
|
||||
class UnsignedCarrySkipAdder(ArithmeticCircuit):
|
||||
"""Class representing unsigned carry skip (bypass) adder composed of smaller carry bypass blocks of chosen size to reduce propagation delay.
|
||||
|
||||
Unsigned carry skip (bypass) adder represents faster adder circuit which is composed
|
||||
of more complex circuitry but provides much less propagation delay as opposed to rca.
|
||||
|
||||
Each carry bypass block is composed of these logic parts:
|
||||
Propagate XOR gates compute propagate signals of corresponding bit pairs, these signals
|
||||
are then combined in multiple input AND gate (cascaded two input gates).
|
||||
Half/full adder cascade represents basic ripple carry adder design for input carry to ripple through them,
|
||||
additionally these adders compute individual output sum bits.
|
||||
Finally multiplexer lies at the end of each carry bypass block and is used to propagate block's input carry
|
||||
if multiple input AND gate output, which serves as select signal, is 1 or to wait for rippling of cout from the block's adders if it is 0.
|
||||
|
||||
```
|
||||
┼ ┼ ┼ ┼
|
||||
┌───▼───▼───┐ ┌───▼───▼───┐
|
||||
┌────┤ Propagate │ ┌────┤ Propagate │
|
||||
│SEL │ signals │ │SEL │ signals │
|
||||
┌────▼─┐ └───────────┘ ┌────▼─┐ └───────────┘
|
||||
│ │ │ │
|
||||
┌──┤2:1MUX│◄────────────────┬─┤2:1MUX│◄────────────────┬─Cin
|
||||
│ │ │ │ │ │ │
|
||||
│ └────▲─┘ ┼ ┼ │ └────▲─┘ ┼ ┼ │
|
||||
│ │ ┌───▼───▼───┐ │ │ ┌───▼───▼───┐ │
|
||||
│ │ │ Adders │◄─┘ │ │ Adders │◄─┘
|
||||
│ └────┤ │ └────┤ │
|
||||
│ └─────┬─────┘ └─────┬─────┘
|
||||
│ │ │
|
||||
▼ ▼ ▼
|
||||
Cout Sums Sums
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
bypass_block_size (int, optional): Size of each composite bypass adder block size. Defaults to 4.
|
||||
prefix (str, optional): Prefix name of unsigned cska. Defaults to "u_cska".
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, bypass_block_size: int = 4, prefix: str = "u_cska"):
|
||||
super().__init__()
|
||||
self.N = max(a.N, b.N)
|
||||
self.prefix = prefix
|
||||
self.a = Bus(prefix=a.prefix, wires_list=a.bus)
|
||||
self.b = Bus(prefix=b.prefix, wires_list=b.bus)
|
||||
|
||||
# Bus sign extension in case buses have different lengths
|
||||
self.a.bus_extend(N=self.N, prefix=a.prefix)
|
||||
self.b.bus_extend(N=self.N, prefix=b.prefix)
|
||||
|
||||
# Output wires for N sum bits and additional cout bit
|
||||
self.out = Bus(self.prefix+"_out", self.N+1)
|
||||
|
||||
# To signify current number of blocks and number of bits that remain to be added into function blocks
|
||||
N_blocks = 0
|
||||
N_wires = self.N
|
||||
cin = ConstantWireValue0()
|
||||
|
||||
while N_wires != 0:
|
||||
propagate_wires = []
|
||||
block_size = bypass_block_size if N_wires >= bypass_block_size else N_wires
|
||||
|
||||
for i in range(block_size):
|
||||
# Generate propagate wires for corresponding bit pairs
|
||||
propagate_xor = XorGate(a=self.a.get_wire((N_blocks*bypass_block_size)+i), b=self.b.get_wire((N_blocks*bypass_block_size)+i), prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), parent_component=self)
|
||||
self.add_component(propagate_xor)
|
||||
propagate_wires.append(propagate_xor.out)
|
||||
|
||||
if N_blocks == 0 and i == 0:
|
||||
obj_adder = HalfAdder(a=self.a.get_wire((N_blocks*bypass_block_size)+i), b=self.b.get_wire((N_blocks*bypass_block_size)+i), prefix=self.prefix+"_ha"+str(self.get_instance_num(cls=HalfAdder)))
|
||||
else:
|
||||
obj_adder = FullAdder(a=self.a.get_wire((N_blocks*bypass_block_size)+i), b=self.b.get_wire((N_blocks*bypass_block_size)+i), c=cout, prefix=self.prefix+"_fa"+str(self.get_instance_num(cls=FullAdder)))
|
||||
|
||||
cout = obj_adder.get_carry_wire()
|
||||
self.add_component(obj_adder)
|
||||
# Connecting adder's output sum bit to its proper position within the described circuit's output bus
|
||||
self.out.connect(i+(N_blocks*bypass_block_size), obj_adder.get_sum_wire())
|
||||
|
||||
# ANDing of propagate wires, gate's output serves as select signal into 2:1 multiplexer and signifies whether block's input carry should be propagated (thus reducing delay) or not
|
||||
propagation_and = MultipleInputLogicGate(a=Bus(prefix=self.prefix+f"_propagate_signal{N_blocks}", N=len(propagate_wires), wires_list=propagate_wires), two_input_gate_cls=AndGate, parent_component=self, prefix=self.prefix+f"_and_propagate{N_blocks}")
|
||||
|
||||
mux = TwoOneMultiplexer(a=cout, b=cin, c=propagation_and.out, prefix=self.prefix+"_mux2to1"+str(self.get_instance_num(cls=TwoOneMultiplexer)))
|
||||
self.add_component(mux)
|
||||
|
||||
# Updating cin for the the next bypass block
|
||||
# Also updating cout value which is used as cin for the first adder of the next block
|
||||
cin = mux.out.get_wire()
|
||||
cout = mux.out.get_wire()
|
||||
N_wires -= block_size
|
||||
N_blocks += 1
|
||||
|
||||
# Connection of final Cout
|
||||
self.out.connect(self.N, cin)
|
||||
|
||||
|
||||
class SignedCarrySkipAdder(UnsignedCarrySkipAdder, ArithmeticCircuit):
|
||||
"""Class representing signed carry skip (bypass) adder composed of smaller carry bypass blocks of chosen size to reduce propagation delay.
|
||||
|
||||
Signed carry skip (bypass) adder represents faster adder circuit which is composed
|
||||
of more complex circuitry but provides much less propagation delay as opposed to rca.
|
||||
|
||||
Each carry bypass block is composed of these logic parts:
|
||||
Propagate XOR gates compute propagate signals of corresponding bit pairs, these signals
|
||||
are then combined in multiple input AND gate (cascaded two input gates).
|
||||
Half/full adder cascade represents basic ripple carry adder design for input carry to ripple through them,
|
||||
additionally these adders compute individual output sum bits.
|
||||
Finally multiplexer lies at the end of each carry bypass block and is used to propagate block's input carry
|
||||
if multiple input AND gate output, which serves as select signal, is 1 or to wait for rippling of cout from the block's adders if it is 0.
|
||||
|
||||
At last XOR gates are used to ensure proper sign extension.
|
||||
|
||||
```
|
||||
┼ ┼ ┼ ┼
|
||||
┌───▼───▼───┐ ┌───▼───▼───┐
|
||||
┌────┤ Propagate │ ┌────┤ Propagate │
|
||||
│SEL │ signals │ │SEL │ signals │
|
||||
┌────▼─┐ └───────────┘ ┌────▼─┐ └───────────┘
|
||||
│ │ │ │
|
||||
┌─┤2:1MUX│◄────────────────┬─┤2:1MUX│◄────────────────┬─Cin
|
||||
│ │ │ │ │ │ │
|
||||
│ └────▲─┘ ┼ ┼ │ └────▲─┘ ┼ ┼ │
|
||||
┌──▼───┐ │ ┌───▼───▼───┐ │ │ ┌───▼───▼───┐ │
|
||||
│ SIGN │ │ │ Adders │◄─┘ │ │ Adders │◄─┘
|
||||
│Extend│ └────┤ │ └────┤ │
|
||||
└──┬───┘ └─────┬─────┘ └─────┬─────┘
|
||||
│ │ │
|
||||
▼ ▼ ▼
|
||||
Cout Sums Sums
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
bypass_block_size (int, optional): Size of each composite bypass adder block size. Defaults to 4.
|
||||
prefix (str, optional): Prefix name of signed cska. Defaults to "s_cska".
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, bypass_block_size: int = 4, prefix: str = "s_cska"):
|
||||
super().__init__(a=a, b=b, bypass_block_size=bypass_block_size, prefix=prefix)
|
||||
self.c_data_type = "int64_t"
|
||||
|
||||
# Additional XOR gates to ensure correct sign extension in case of sign addition
|
||||
sign_xor_1 = XorGate(self.a.get_wire(self.N-1), self.b.get_wire(self.N-1), prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate, count_disabled_gates=False)), parent_component=self)
|
||||
self.add_component(sign_xor_1)
|
||||
sign_xor_2 = XorGate(sign_xor_1.out, self.get_previous_component(2).out.get_wire(), prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate, count_disabled_gates=False)), parent_component=self)
|
||||
self.add_component(sign_xor_2)
|
||||
self.out.connect(self.N, sign_xor_2.out)</code></pre>
|
||||
</details>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.SignedCarrySkipAdder"><code class="flex name class">
|
||||
<span>class <span class="ident">SignedCarrySkipAdder</span></span>
|
||||
<span>(</span><span>a: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, b: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, bypass_block_size: int = 4, prefix: str = 's_cska')</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Class representing signed carry skip (bypass) adder composed of smaller carry bypass blocks of chosen size to reduce propagation delay.</p>
|
||||
<p>Signed carry skip (bypass) adder represents faster adder circuit which is composed
|
||||
of more complex circuitry but provides much less propagation delay as opposed to rca.</p>
|
||||
<p>Each carry bypass block is composed of these logic parts:
|
||||
Propagate XOR gates compute propagate signals of corresponding bit pairs, these signals
|
||||
are then combined in multiple input AND gate (cascaded two input gates).
|
||||
Half/full adder cascade represents basic ripple carry adder design for input carry to ripple through them,
|
||||
additionally these adders compute individual output sum bits.
|
||||
Finally multiplexer lies at the end of each carry bypass block and is used to propagate block's input carry
|
||||
if multiple input AND gate output, which serves as select signal, is 1 or to wait for rippling of cout from the block's adders if it is 0.</p>
|
||||
<p>At last XOR gates are used to ensure proper sign extension.</p>
|
||||
<pre><code> ┼ ┼ ┼ ┼
|
||||
┌───▼───▼───┐ ┌───▼───▼───┐
|
||||
┌────┤ Propagate │ ┌────┤ Propagate │
|
||||
│SEL │ signals │ │SEL │ signals │
|
||||
┌────▼─┐ └───────────┘ ┌────▼─┐ └───────────┘
|
||||
│ │ │ │
|
||||
┌─┤2:1MUX│◄────────────────┬─┤2:1MUX│◄────────────────┬─Cin
|
||||
│ │ │ │ │ │ │
|
||||
│ └────▲─┘ ┼ ┼ │ └────▲─┘ ┼ ┼ │
|
||||
┌──▼───┐ │ ┌───▼───▼───┐ │ │ ┌───▼───▼───┐ │
|
||||
│ SIGN │ │ │ Adders │◄─┘ │ │ Adders │◄─┘
|
||||
│Extend│ └────┤ │ └────┤ │
|
||||
└──┬───┘ └─────┬─────┘ └─────┬─────┘
|
||||
│ │ │
|
||||
▼ ▼ ▼
|
||||
Cout Sums Sums
|
||||
</code></pre>
|
||||
<p>Description of the <strong>init</strong> method.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>a</code></strong> : <code>Bus</code></dt>
|
||||
<dd>First input bus.</dd>
|
||||
<dt><strong><code>b</code></strong> : <code>Bus</code></dt>
|
||||
<dd>Second input bus.</dd>
|
||||
<dt><strong><code>bypass_block_size</code></strong> : <code>int</code>, optional</dt>
|
||||
<dd>Size of each composite bypass adder block size. Defaults to 4.</dd>
|
||||
<dt><strong><code>prefix</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Prefix name of signed cska. Defaults to "s_cska".</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class SignedCarrySkipAdder(UnsignedCarrySkipAdder, ArithmeticCircuit):
|
||||
"""Class representing signed carry skip (bypass) adder composed of smaller carry bypass blocks of chosen size to reduce propagation delay.
|
||||
|
||||
Signed carry skip (bypass) adder represents faster adder circuit which is composed
|
||||
of more complex circuitry but provides much less propagation delay as opposed to rca.
|
||||
|
||||
Each carry bypass block is composed of these logic parts:
|
||||
Propagate XOR gates compute propagate signals of corresponding bit pairs, these signals
|
||||
are then combined in multiple input AND gate (cascaded two input gates).
|
||||
Half/full adder cascade represents basic ripple carry adder design for input carry to ripple through them,
|
||||
additionally these adders compute individual output sum bits.
|
||||
Finally multiplexer lies at the end of each carry bypass block and is used to propagate block's input carry
|
||||
if multiple input AND gate output, which serves as select signal, is 1 or to wait for rippling of cout from the block's adders if it is 0.
|
||||
|
||||
At last XOR gates are used to ensure proper sign extension.
|
||||
|
||||
```
|
||||
┼ ┼ ┼ ┼
|
||||
┌───▼───▼───┐ ┌───▼───▼───┐
|
||||
┌────┤ Propagate │ ┌────┤ Propagate │
|
||||
│SEL │ signals │ │SEL │ signals │
|
||||
┌────▼─┐ └───────────┘ ┌────▼─┐ └───────────┘
|
||||
│ │ │ │
|
||||
┌─┤2:1MUX│◄────────────────┬─┤2:1MUX│◄────────────────┬─Cin
|
||||
│ │ │ │ │ │ │
|
||||
│ └────▲─┘ ┼ ┼ │ └────▲─┘ ┼ ┼ │
|
||||
┌──▼───┐ │ ┌───▼───▼───┐ │ │ ┌───▼───▼───┐ │
|
||||
│ SIGN │ │ │ Adders │◄─┘ │ │ Adders │◄─┘
|
||||
│Extend│ └────┤ │ └────┤ │
|
||||
└──┬───┘ └─────┬─────┘ └─────┬─────┘
|
||||
│ │ │
|
||||
▼ ▼ ▼
|
||||
Cout Sums Sums
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
bypass_block_size (int, optional): Size of each composite bypass adder block size. Defaults to 4.
|
||||
prefix (str, optional): Prefix name of signed cska. Defaults to "s_cska".
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, bypass_block_size: int = 4, prefix: str = "s_cska"):
|
||||
super().__init__(a=a, b=b, bypass_block_size=bypass_block_size, prefix=prefix)
|
||||
self.c_data_type = "int64_t"
|
||||
|
||||
# Additional XOR gates to ensure correct sign extension in case of sign addition
|
||||
sign_xor_1 = XorGate(self.a.get_wire(self.N-1), self.b.get_wire(self.N-1), prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate, count_disabled_gates=False)), parent_component=self)
|
||||
self.add_component(sign_xor_1)
|
||||
sign_xor_2 = XorGate(sign_xor_1.out, self.get_previous_component(2).out.get_wire(), prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate, count_disabled_gates=False)), parent_component=self)
|
||||
self.add_component(sign_xor_2)
|
||||
self.out.connect(self.N, sign_xor_2.out)</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder" href="#ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder">UnsignedCarrySkipAdder</a></li>
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></li>
|
||||
</ul>
|
||||
<h3>Inherited members</h3>
|
||||
<ul class="hlist">
|
||||
<li><code><b><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder" href="#ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder">UnsignedCarrySkipAdder</a></b></code>:
|
||||
<ul class="hlist">
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.add_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component">add_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_blif_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_flat">get_blif_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_blif_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier">get_blif_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_c_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat">get_c_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_c_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier">get_c_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_carry_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire">get_carry_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_cgp_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat">get_cgp_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_cgp_wires" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires">get_cgp_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_circuit_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif">get_circuit_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_circuit_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c">get_circuit_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_circuit_gates" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates">get_circuit_gates</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_circuit_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v">get_circuit_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_circuit_wire_index" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index">get_circuit_wire_index</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_component_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types">get_component_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_declaration_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_blif">get_declaration_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_declaration_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_flat">get_declaration_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_declaration_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_hier">get_declaration_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_declaration_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_flat">get_declaration_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_declaration_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_hier">get_declaration_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_declarations_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier">get_declarations_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_declarations_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_v_hier">get_declarations_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_function_blif_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blif_flat">get_function_blif_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_function_block_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_blif">get_function_block_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_function_block_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_c">get_function_block_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_function_block_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_v">get_function_block_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_function_blocks_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif">get_function_blocks_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_function_blocks_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c">get_function_blocks_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_function_blocks_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v">get_function_blocks_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_function_out_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif">get_function_out_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_function_out_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat">get_function_out_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_function_out_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_hier">get_function_out_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_function_out_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat">get_function_out_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_function_out_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier">get_function_out_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_includes_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c">get_includes_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_init_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_flat">get_init_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_init_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier">get_init_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_init_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_flat">get_init_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_init_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier">get_init_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_instance_num" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num">get_instance_num</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_invocation_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocation_blif_hier">get_invocation_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_invocations_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocations_blif_hier">get_invocations_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_multi_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components">get_multi_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_one_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components">get_one_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_out_invocation_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_c">get_out_invocation_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_out_invocation_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_v">get_out_invocation_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_outputs_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp">get_outputs_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_parameters_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_parameters_cgp">get_parameters_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_previous_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component">get_previous_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_prototype_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif">get_prototype_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_prototype_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_c">get_prototype_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_prototype_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_v">get_prototype_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_sum_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire">get_sum_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_triplets_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp">get_triplets_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_unique_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types">get_unique_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_v_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_flat">get_v_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.get_v_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier">get_v_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder.save_wire_id" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id">save_wire_id</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dt id="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder"><code class="flex name class">
|
||||
<span>class <span class="ident">UnsignedCarrySkipAdder</span></span>
|
||||
<span>(</span><span>a: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, b: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, bypass_block_size: int = 4, prefix: str = 'u_cska')</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Class representing unsigned carry skip (bypass) adder composed of smaller carry bypass blocks of chosen size to reduce propagation delay.</p>
|
||||
<p>Unsigned carry skip (bypass) adder represents faster adder circuit which is composed
|
||||
of more complex circuitry but provides much less propagation delay as opposed to rca.</p>
|
||||
<p>Each carry bypass block is composed of these logic parts:
|
||||
Propagate XOR gates compute propagate signals of corresponding bit pairs, these signals
|
||||
are then combined in multiple input AND gate (cascaded two input gates).
|
||||
Half/full adder cascade represents basic ripple carry adder design for input carry to ripple through them,
|
||||
additionally these adders compute individual output sum bits.
|
||||
Finally multiplexer lies at the end of each carry bypass block and is used to propagate block's input carry
|
||||
if multiple input AND gate output, which serves as select signal, is 1 or to wait for rippling of cout from the block's adders if it is 0.</p>
|
||||
<pre><code> ┼ ┼ ┼ ┼
|
||||
┌───▼───▼───┐ ┌───▼───▼───┐
|
||||
┌────┤ Propagate │ ┌────┤ Propagate │
|
||||
│SEL │ signals │ │SEL │ signals │
|
||||
┌────▼─┐ └───────────┘ ┌────▼─┐ └───────────┘
|
||||
│ │ │ │
|
||||
┌──┤2:1MUX│◄────────────────┬─┤2:1MUX│◄────────────────┬─Cin
|
||||
│ │ │ │ │ │ │
|
||||
│ └────▲─┘ ┼ ┼ │ └────▲─┘ ┼ ┼ │
|
||||
│ │ ┌───▼───▼───┐ │ │ ┌───▼───▼───┐ │
|
||||
│ │ │ Adders │◄─┘ │ │ Adders │◄─┘
|
||||
│ └────┤ │ └────┤ │
|
||||
│ └─────┬─────┘ └─────┬─────┘
|
||||
│ │ │
|
||||
▼ ▼ ▼
|
||||
Cout Sums Sums
|
||||
</code></pre>
|
||||
<p>Description of the <strong>init</strong> method.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>a</code></strong> : <code>Bus</code></dt>
|
||||
<dd>First input bus.</dd>
|
||||
<dt><strong><code>b</code></strong> : <code>Bus</code></dt>
|
||||
<dd>Second input bus.</dd>
|
||||
<dt><strong><code>bypass_block_size</code></strong> : <code>int</code>, optional</dt>
|
||||
<dd>Size of each composite bypass adder block size. Defaults to 4.</dd>
|
||||
<dt><strong><code>prefix</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Prefix name of unsigned cska. Defaults to "u_cska".</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class UnsignedCarrySkipAdder(ArithmeticCircuit):
|
||||
"""Class representing unsigned carry skip (bypass) adder composed of smaller carry bypass blocks of chosen size to reduce propagation delay.
|
||||
|
||||
Unsigned carry skip (bypass) adder represents faster adder circuit which is composed
|
||||
of more complex circuitry but provides much less propagation delay as opposed to rca.
|
||||
|
||||
Each carry bypass block is composed of these logic parts:
|
||||
Propagate XOR gates compute propagate signals of corresponding bit pairs, these signals
|
||||
are then combined in multiple input AND gate (cascaded two input gates).
|
||||
Half/full adder cascade represents basic ripple carry adder design for input carry to ripple through them,
|
||||
additionally these adders compute individual output sum bits.
|
||||
Finally multiplexer lies at the end of each carry bypass block and is used to propagate block's input carry
|
||||
if multiple input AND gate output, which serves as select signal, is 1 or to wait for rippling of cout from the block's adders if it is 0.
|
||||
|
||||
```
|
||||
┼ ┼ ┼ ┼
|
||||
┌───▼───▼───┐ ┌───▼───▼───┐
|
||||
┌────┤ Propagate │ ┌────┤ Propagate │
|
||||
│SEL │ signals │ │SEL │ signals │
|
||||
┌────▼─┐ └───────────┘ ┌────▼─┐ └───────────┘
|
||||
│ │ │ │
|
||||
┌──┤2:1MUX│◄────────────────┬─┤2:1MUX│◄────────────────┬─Cin
|
||||
│ │ │ │ │ │ │
|
||||
│ └────▲─┘ ┼ ┼ │ └────▲─┘ ┼ ┼ │
|
||||
│ │ ┌───▼───▼───┐ │ │ ┌───▼───▼───┐ │
|
||||
│ │ │ Adders │◄─┘ │ │ Adders │◄─┘
|
||||
│ └────┤ │ └────┤ │
|
||||
│ └─────┬─────┘ └─────┬─────┘
|
||||
│ │ │
|
||||
▼ ▼ ▼
|
||||
Cout Sums Sums
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
bypass_block_size (int, optional): Size of each composite bypass adder block size. Defaults to 4.
|
||||
prefix (str, optional): Prefix name of unsigned cska. Defaults to "u_cska".
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, bypass_block_size: int = 4, prefix: str = "u_cska"):
|
||||
super().__init__()
|
||||
self.N = max(a.N, b.N)
|
||||
self.prefix = prefix
|
||||
self.a = Bus(prefix=a.prefix, wires_list=a.bus)
|
||||
self.b = Bus(prefix=b.prefix, wires_list=b.bus)
|
||||
|
||||
# Bus sign extension in case buses have different lengths
|
||||
self.a.bus_extend(N=self.N, prefix=a.prefix)
|
||||
self.b.bus_extend(N=self.N, prefix=b.prefix)
|
||||
|
||||
# Output wires for N sum bits and additional cout bit
|
||||
self.out = Bus(self.prefix+"_out", self.N+1)
|
||||
|
||||
# To signify current number of blocks and number of bits that remain to be added into function blocks
|
||||
N_blocks = 0
|
||||
N_wires = self.N
|
||||
cin = ConstantWireValue0()
|
||||
|
||||
while N_wires != 0:
|
||||
propagate_wires = []
|
||||
block_size = bypass_block_size if N_wires >= bypass_block_size else N_wires
|
||||
|
||||
for i in range(block_size):
|
||||
# Generate propagate wires for corresponding bit pairs
|
||||
propagate_xor = XorGate(a=self.a.get_wire((N_blocks*bypass_block_size)+i), b=self.b.get_wire((N_blocks*bypass_block_size)+i), prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), parent_component=self)
|
||||
self.add_component(propagate_xor)
|
||||
propagate_wires.append(propagate_xor.out)
|
||||
|
||||
if N_blocks == 0 and i == 0:
|
||||
obj_adder = HalfAdder(a=self.a.get_wire((N_blocks*bypass_block_size)+i), b=self.b.get_wire((N_blocks*bypass_block_size)+i), prefix=self.prefix+"_ha"+str(self.get_instance_num(cls=HalfAdder)))
|
||||
else:
|
||||
obj_adder = FullAdder(a=self.a.get_wire((N_blocks*bypass_block_size)+i), b=self.b.get_wire((N_blocks*bypass_block_size)+i), c=cout, prefix=self.prefix+"_fa"+str(self.get_instance_num(cls=FullAdder)))
|
||||
|
||||
cout = obj_adder.get_carry_wire()
|
||||
self.add_component(obj_adder)
|
||||
# Connecting adder's output sum bit to its proper position within the described circuit's output bus
|
||||
self.out.connect(i+(N_blocks*bypass_block_size), obj_adder.get_sum_wire())
|
||||
|
||||
# ANDing of propagate wires, gate's output serves as select signal into 2:1 multiplexer and signifies whether block's input carry should be propagated (thus reducing delay) or not
|
||||
propagation_and = MultipleInputLogicGate(a=Bus(prefix=self.prefix+f"_propagate_signal{N_blocks}", N=len(propagate_wires), wires_list=propagate_wires), two_input_gate_cls=AndGate, parent_component=self, prefix=self.prefix+f"_and_propagate{N_blocks}")
|
||||
|
||||
mux = TwoOneMultiplexer(a=cout, b=cin, c=propagation_and.out, prefix=self.prefix+"_mux2to1"+str(self.get_instance_num(cls=TwoOneMultiplexer)))
|
||||
self.add_component(mux)
|
||||
|
||||
# Updating cin for the the next bypass block
|
||||
# Also updating cout value which is used as cin for the first adder of the next block
|
||||
cin = mux.out.get_wire()
|
||||
cout = mux.out.get_wire()
|
||||
N_wires -= block_size
|
||||
N_blocks += 1
|
||||
|
||||
# Connection of final Cout
|
||||
self.out.connect(self.N, cin)</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></li>
|
||||
</ul>
|
||||
<h3>Subclasses</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.SignedCarrySkipAdder" href="#ariths_gen.multi_bit_circuits.adders.carry_skip_adder.SignedCarrySkipAdder">SignedCarrySkipAdder</a></li>
|
||||
</ul>
|
||||
<h3>Inherited members</h3>
|
||||
<ul class="hlist">
|
||||
<li><code><b><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></b></code>:
|
||||
<ul class="hlist">
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component">add_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_flat">get_blif_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier">get_blif_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat">get_c_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier">get_c_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire">get_carry_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat">get_cgp_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires">get_cgp_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif">get_circuit_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c">get_circuit_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates">get_circuit_gates</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v">get_circuit_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index">get_circuit_wire_index</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types">get_component_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_blif">get_declaration_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_flat">get_declaration_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_hier">get_declaration_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_flat">get_declaration_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_hier">get_declaration_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier">get_declarations_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_v_hier">get_declarations_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blif_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blif_flat">get_function_blif_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_blif">get_function_block_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_c">get_function_block_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_v">get_function_block_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif">get_function_blocks_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c">get_function_blocks_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v">get_function_blocks_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif">get_function_out_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat">get_function_out_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_hier">get_function_out_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat">get_function_out_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier">get_function_out_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c">get_includes_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_flat">get_init_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier">get_init_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_flat">get_init_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier">get_init_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num">get_instance_num</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocation_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocation_blif_hier">get_invocation_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocations_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocations_blif_hier">get_invocations_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components">get_multi_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components">get_one_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_c">get_out_invocation_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_v">get_out_invocation_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp">get_outputs_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_parameters_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_parameters_cgp">get_parameters_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component">get_previous_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif">get_prototype_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_c">get_prototype_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_v">get_prototype_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire">get_sum_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp">get_triplets_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types">get_unique_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_flat">get_v_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier">get_v_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id">save_wire_id</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders" href="index.html">ariths_gen.multi_bit_circuits.adders</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.SignedCarrySkipAdder" href="#ariths_gen.multi_bit_circuits.adders.carry_skip_adder.SignedCarrySkipAdder">SignedCarrySkipAdder</a></code></h4>
|
||||
</li>
|
||||
<li>
|
||||
<h4><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder" href="#ariths_gen.multi_bit_circuits.adders.carry_skip_adder.UnsignedCarrySkipAdder">UnsignedCarrySkipAdder</a></code></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
104
ariths_gen/multi_bit_circuits/adders/index.html
Normal file
104
ariths_gen/multi_bit_circuits/adders/index.html
Normal file
@ -0,0 +1,104 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen.multi_bit_circuits.adders API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>ariths_gen.multi_bit_circuits.adders</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">from ariths_gen.multi_bit_circuits.adders.ripple_carry_adder import (
|
||||
UnsignedRippleCarryAdder,
|
||||
SignedRippleCarryAdder
|
||||
)
|
||||
|
||||
from ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder import (
|
||||
UnsignedPGRippleCarryAdder,
|
||||
SignedPGRippleCarryAdder
|
||||
)
|
||||
|
||||
from ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder import (
|
||||
UnsignedCarryLookaheadAdder,
|
||||
SignedCarryLookaheadAdder
|
||||
)
|
||||
|
||||
from ariths_gen.multi_bit_circuits.adders.carry_skip_adder import (
|
||||
UnsignedCarrySkipAdder,
|
||||
SignedCarrySkipAdder
|
||||
)</code></pre>
|
||||
</details>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
|
||||
<dl>
|
||||
<dt><code class="name"><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder" href="carry_lookahead_adder.html">ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder" href="carry_skip_adder.html">ariths_gen.multi_bit_circuits.adders.carry_skip_adder</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder" href="pg_ripple_carry_adder.html">ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder" href="ripple_carry_adder.html">ariths_gen.multi_bit_circuits.adders.ripple_carry_adder</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits" href="../index.html">ariths_gen.multi_bit_circuits</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder" href="carry_lookahead_adder.html">ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.carry_skip_adder" href="carry_skip_adder.html">ariths_gen.multi_bit_circuits.adders.carry_skip_adder</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder" href="pg_ripple_carry_adder.html">ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder" href="ripple_carry_adder.html">ariths_gen.multi_bit_circuits.adders.ripple_carry_adder</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
564
ariths_gen/multi_bit_circuits/adders/pg_ripple_carry_adder.html
Normal file
564
ariths_gen/multi_bit_circuits/adders/pg_ripple_carry_adder.html
Normal file
@ -0,0 +1,564 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">from ariths_gen.wire_components import (
|
||||
Wire,
|
||||
ConstantWireValue0,
|
||||
ConstantWireValue1,
|
||||
Bus
|
||||
)
|
||||
from ariths_gen.core.arithmetic_circuits import (
|
||||
ArithmeticCircuit,
|
||||
MultiplierCircuit
|
||||
)
|
||||
from ariths_gen.one_bit_circuits.one_bit_components import (
|
||||
HalfAdder,
|
||||
PGLogicBlock,
|
||||
FullAdder,
|
||||
FullAdderPG
|
||||
)
|
||||
from ariths_gen.one_bit_circuits.logic_gates import (
|
||||
AndGate,
|
||||
NandGate,
|
||||
OrGate,
|
||||
NorGate,
|
||||
XorGate,
|
||||
XnorGate,
|
||||
NotGate
|
||||
)
|
||||
|
||||
|
||||
class UnsignedPGRippleCarryAdder(ArithmeticCircuit):
|
||||
"""Class representing unsigned ripple carry adder with propagate/generate logic.
|
||||
|
||||
Unsigned ripple carry adder with PG logic represents slightly different rca implementation
|
||||
of N-bit unsigned adder which is composed of N one bit full adders with P/G logic.
|
||||
|
||||
```
|
||||
B3 A3 B2 A2 B1 A1 B0 A0
|
||||
│ │ │ │ │ │ │ │
|
||||
┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ PG │ C3 │ PG │ C2 │ PG │ C1 │ PG │
|
||||
│ FA │◄────┐│ FA │◄──┐│ FA │◄──┐│ FA │◄──0
|
||||
│ │ ││ │ ││ │ ││ │
|
||||
└─┬──┬┬┘ │└─┬┬┬──┘ │└─┬┬┬──┘ │└─┬┬┬──┘
|
||||
│ ││G3P3S3│ │││G2P2S2│ │││G1P1S1│ │││G0P0S0
|
||||
│ ┌▼▼──────┴──▼▼▼──────┴──▼▼▼──────┴──▼▼▼──┐
|
||||
│ │ Group PG logic │
|
||||
│ │ │
|
||||
│ └─┬───────┬──────────┬──────────┬────────┘
|
||||
│ │ │ │ │
|
||||
┌─▼───▼───────▼──────────▼──────────▼────────┐
|
||||
│ Sum logic │
|
||||
│ │
|
||||
└┬────┬───────┬──────────┬──────────┬────────┘
|
||||
│ │ │ │ │
|
||||
▼ ▼ ▼ ▼ ▼
|
||||
Cout S3 S1 S0 S0
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
prefix (str, optional): Prefix name of unsigned P/G rca. Defaults to "u_pg_rca".
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, prefix: str = "u_pg_rca"):
|
||||
super().__init__()
|
||||
self.N = max(a.N, b.N)
|
||||
self.prefix = prefix
|
||||
self.a = Bus(prefix=a.prefix, wires_list=a.bus)
|
||||
self.b = Bus(prefix=b.prefix, wires_list=b.bus)
|
||||
|
||||
# Bus sign extension in case buses have different lengths
|
||||
self.a.bus_extend(N=self.N, prefix=a.prefix)
|
||||
self.b.bus_extend(N=self.N, prefix=b.prefix)
|
||||
|
||||
# Output wires for N sum bits and additional cout bit
|
||||
self.out = Bus(self.prefix+"_out", self.N+1)
|
||||
|
||||
# Gradual addition of 1-bit adder components
|
||||
for input_index in range(self.N):
|
||||
if input_index == 0:
|
||||
# First full adder with connected constant wire with value 0 as cin 0
|
||||
obj_pg_fa = FullAdderPG(self.a.get_wire(input_index), self.b.get_wire(input_index), ConstantWireValue0(), prefix=self.prefix+"_pg_fa"+str(input_index))
|
||||
else:
|
||||
obj_pg_fa = FullAdderPG(self.a.get_wire(input_index), self.b.get_wire(input_index), self.get_previous_component().out, prefix=self.prefix+"_pg_fa"+str(input_index))
|
||||
|
||||
self.add_component(obj_pg_fa)
|
||||
self.out.connect(input_index, obj_pg_fa.get_sum_wire())
|
||||
|
||||
obj_and = AndGate(self.get_previous_component().c, self.get_previous_component().get_propagate_wire(), prefix=self.prefix+"_and"+str(input_index), parent_component=self)
|
||||
obj_or = OrGate(obj_and.out, self.get_previous_component().get_generate_wire(), prefix=self.prefix+"_or"+str(input_index), parent_component=self)
|
||||
self.add_component(obj_and)
|
||||
self.add_component(obj_or)
|
||||
|
||||
# Connecting last output bit to last cout
|
||||
if input_index == (self.N-1):
|
||||
self.out.connect(self.N, obj_or.out)
|
||||
|
||||
|
||||
class SignedPGRippleCarryAdder(UnsignedPGRippleCarryAdder, ArithmeticCircuit):
|
||||
"""Class representing signed ripple carry adder with propagate/generate logic.
|
||||
|
||||
Signed ripple carry adder with PG logic represents slightly different rca implementation
|
||||
of N-bit signed adder which is composed of N one bit full adders with P/G logic.
|
||||
At last XOR gates are used to ensure proper sign extension.
|
||||
|
||||
```
|
||||
B3 A3 B2 A2 B1 A1 B0 A0
|
||||
│ │ │ │ │ │ │ │
|
||||
┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ PG │ C3 │ PG │ C2 │ PG │ C1 │ PG │
|
||||
│ FA │◄────┐│ FA │◄──┐│ FA │◄──┐│ FA │◄──0
|
||||
│ │ ││ │ ││ │ ││ │
|
||||
└─┬──┬┬┘ │└─┬┬┬──┘ │└─┬┬┬──┘ │└─┬┬┬──┘
|
||||
│ ││G3P3S3│ │││G2P2S2│ │││G1P1S1│ │││G0P0S0
|
||||
│ ┌▼▼──────┴──▼▼▼──────┴──▼▼▼──────┴──▼▼▼──┐
|
||||
│ │ Group PG logic │
|
||||
│ │ │
|
||||
│ └─┬───────┬──────────┬──────────┬────────┘
|
||||
│ │ │ │ │
|
||||
┌─▼───▼───────▼──────────▼──────────▼────────┐
|
||||
│ Sum logic │
|
||||
│ with sign extension │
|
||||
└┬────┬───────┬──────────┬──────────┬────────┘
|
||||
│ │ │ │ │
|
||||
▼ ▼ ▼ ▼ ▼
|
||||
Cout S3 S1 S0 S0
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
prefix (str, optional): Prefix name of signed P/G rca. Defaults to "s_pg_rca".
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, prefix: str = "s_pg_rca"):
|
||||
super().__init__(a=a, b=b, prefix=prefix)
|
||||
self.c_data_type = "int64_t"
|
||||
|
||||
# Additional XOR gates to ensure correct sign extension in case of sign addition
|
||||
sign_xor_1 = XorGate(self.a.get_wire(self.N-1), self.b.get_wire(self.N-1), prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), parent_component=self)
|
||||
self.add_component(sign_xor_1)
|
||||
sign_xor_2 = XorGate(sign_xor_1.out, self.get_previous_component(2).out, prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), parent_component=self)
|
||||
self.add_component(sign_xor_2)
|
||||
self.out.connect(self.N, sign_xor_2.out)</code></pre>
|
||||
</details>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.SignedPGRippleCarryAdder"><code class="flex name class">
|
||||
<span>class <span class="ident">SignedPGRippleCarryAdder</span></span>
|
||||
<span>(</span><span>a: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, b: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, prefix: str = 's_pg_rca')</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Class representing signed ripple carry adder with propagate/generate logic.</p>
|
||||
<p>Signed ripple carry adder with PG logic represents slightly different rca implementation
|
||||
of N-bit signed adder which is composed of N one bit full adders with P/G logic.
|
||||
At last XOR gates are used to ensure proper sign extension.</p>
|
||||
<pre><code> B3 A3 B2 A2 B1 A1 B0 A0
|
||||
│ │ │ │ │ │ │ │
|
||||
┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ PG │ C3 │ PG │ C2 │ PG │ C1 │ PG │
|
||||
│ FA │◄────┐│ FA │◄──┐│ FA │◄──┐│ FA │◄──0
|
||||
│ │ ││ │ ││ │ ││ │
|
||||
└─┬──┬┬┘ │└─┬┬┬──┘ │└─┬┬┬──┘ │└─┬┬┬──┘
|
||||
│ ││G3P3S3│ │││G2P2S2│ │││G1P1S1│ │││G0P0S0
|
||||
│ ┌▼▼──────┴──▼▼▼──────┴──▼▼▼──────┴──▼▼▼──┐
|
||||
│ │ Group PG logic │
|
||||
│ │ │
|
||||
│ └─┬───────┬──────────┬──────────┬────────┘
|
||||
│ │ │ │ │
|
||||
┌─▼───▼───────▼──────────▼──────────▼────────┐
|
||||
│ Sum logic │
|
||||
│ with sign extension │
|
||||
└┬────┬───────┬──────────┬──────────┬────────┘
|
||||
│ │ │ │ │
|
||||
▼ ▼ ▼ ▼ ▼
|
||||
Cout S3 S1 S0 S0
|
||||
</code></pre>
|
||||
<p>Description of the <strong>init</strong> method.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>a</code></strong> : <code>Bus</code></dt>
|
||||
<dd>First input bus.</dd>
|
||||
<dt><strong><code>b</code></strong> : <code>Bus</code></dt>
|
||||
<dd>Second input bus.</dd>
|
||||
<dt><strong><code>prefix</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Prefix name of signed P/G rca. Defaults to "s_pg_rca".</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class SignedPGRippleCarryAdder(UnsignedPGRippleCarryAdder, ArithmeticCircuit):
|
||||
"""Class representing signed ripple carry adder with propagate/generate logic.
|
||||
|
||||
Signed ripple carry adder with PG logic represents slightly different rca implementation
|
||||
of N-bit signed adder which is composed of N one bit full adders with P/G logic.
|
||||
At last XOR gates are used to ensure proper sign extension.
|
||||
|
||||
```
|
||||
B3 A3 B2 A2 B1 A1 B0 A0
|
||||
│ │ │ │ │ │ │ │
|
||||
┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ PG │ C3 │ PG │ C2 │ PG │ C1 │ PG │
|
||||
│ FA │◄────┐│ FA │◄──┐│ FA │◄──┐│ FA │◄──0
|
||||
│ │ ││ │ ││ │ ││ │
|
||||
└─┬──┬┬┘ │└─┬┬┬──┘ │└─┬┬┬──┘ │└─┬┬┬──┘
|
||||
│ ││G3P3S3│ │││G2P2S2│ │││G1P1S1│ │││G0P0S0
|
||||
│ ┌▼▼──────┴──▼▼▼──────┴──▼▼▼──────┴──▼▼▼──┐
|
||||
│ │ Group PG logic │
|
||||
│ │ │
|
||||
│ └─┬───────┬──────────┬──────────┬────────┘
|
||||
│ │ │ │ │
|
||||
┌─▼───▼───────▼──────────▼──────────▼────────┐
|
||||
│ Sum logic │
|
||||
│ with sign extension │
|
||||
└┬────┬───────┬──────────┬──────────┬────────┘
|
||||
│ │ │ │ │
|
||||
▼ ▼ ▼ ▼ ▼
|
||||
Cout S3 S1 S0 S0
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
prefix (str, optional): Prefix name of signed P/G rca. Defaults to "s_pg_rca".
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, prefix: str = "s_pg_rca"):
|
||||
super().__init__(a=a, b=b, prefix=prefix)
|
||||
self.c_data_type = "int64_t"
|
||||
|
||||
# Additional XOR gates to ensure correct sign extension in case of sign addition
|
||||
sign_xor_1 = XorGate(self.a.get_wire(self.N-1), self.b.get_wire(self.N-1), prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), parent_component=self)
|
||||
self.add_component(sign_xor_1)
|
||||
sign_xor_2 = XorGate(sign_xor_1.out, self.get_previous_component(2).out, prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), parent_component=self)
|
||||
self.add_component(sign_xor_2)
|
||||
self.out.connect(self.N, sign_xor_2.out)</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder" href="#ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder">UnsignedPGRippleCarryAdder</a></li>
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></li>
|
||||
</ul>
|
||||
<h3>Inherited members</h3>
|
||||
<ul class="hlist">
|
||||
<li><code><b><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder" href="#ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder">UnsignedPGRippleCarryAdder</a></b></code>:
|
||||
<ul class="hlist">
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.add_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component">add_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_blif_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_flat">get_blif_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_blif_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier">get_blif_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_c_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat">get_c_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_c_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier">get_c_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_carry_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire">get_carry_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_cgp_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat">get_cgp_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_cgp_wires" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires">get_cgp_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_circuit_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif">get_circuit_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_circuit_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c">get_circuit_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_circuit_gates" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates">get_circuit_gates</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_circuit_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v">get_circuit_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_circuit_wire_index" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index">get_circuit_wire_index</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_component_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types">get_component_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_declaration_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_blif">get_declaration_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_declaration_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_flat">get_declaration_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_declaration_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_hier">get_declaration_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_declaration_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_flat">get_declaration_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_declaration_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_hier">get_declaration_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_declarations_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier">get_declarations_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_declarations_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_v_hier">get_declarations_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_function_blif_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blif_flat">get_function_blif_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_function_block_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_blif">get_function_block_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_function_block_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_c">get_function_block_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_function_block_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_v">get_function_block_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_function_blocks_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif">get_function_blocks_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_function_blocks_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c">get_function_blocks_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_function_blocks_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v">get_function_blocks_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_function_out_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif">get_function_out_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_function_out_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat">get_function_out_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_function_out_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_hier">get_function_out_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_function_out_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat">get_function_out_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_function_out_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier">get_function_out_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_includes_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c">get_includes_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_init_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_flat">get_init_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_init_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier">get_init_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_init_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_flat">get_init_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_init_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier">get_init_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_instance_num" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num">get_instance_num</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_invocation_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocation_blif_hier">get_invocation_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_invocations_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocations_blif_hier">get_invocations_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_multi_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components">get_multi_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_one_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components">get_one_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_out_invocation_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_c">get_out_invocation_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_out_invocation_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_v">get_out_invocation_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_outputs_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp">get_outputs_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_parameters_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_parameters_cgp">get_parameters_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_previous_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component">get_previous_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_prototype_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif">get_prototype_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_prototype_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_c">get_prototype_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_prototype_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_v">get_prototype_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_sum_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire">get_sum_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_triplets_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp">get_triplets_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_unique_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types">get_unique_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_v_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_flat">get_v_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.get_v_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier">get_v_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder.save_wire_id" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id">save_wire_id</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dt id="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder"><code class="flex name class">
|
||||
<span>class <span class="ident">UnsignedPGRippleCarryAdder</span></span>
|
||||
<span>(</span><span>a: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, b: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, prefix: str = 'u_pg_rca')</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Class representing unsigned ripple carry adder with propagate/generate logic.</p>
|
||||
<p>Unsigned ripple carry adder with PG logic represents slightly different rca implementation
|
||||
of N-bit unsigned adder which is composed of N one bit full adders with P/G logic.</p>
|
||||
<pre><code> B3 A3 B2 A2 B1 A1 B0 A0
|
||||
│ │ │ │ │ │ │ │
|
||||
┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ PG │ C3 │ PG │ C2 │ PG │ C1 │ PG │
|
||||
│ FA │◄────┐│ FA │◄──┐│ FA │◄──┐│ FA │◄──0
|
||||
│ │ ││ │ ││ │ ││ │
|
||||
└─┬──┬┬┘ │└─┬┬┬──┘ │└─┬┬┬──┘ │└─┬┬┬──┘
|
||||
│ ││G3P3S3│ │││G2P2S2│ │││G1P1S1│ │││G0P0S0
|
||||
│ ┌▼▼──────┴──▼▼▼──────┴──▼▼▼──────┴──▼▼▼──┐
|
||||
│ │ Group PG logic │
|
||||
│ │ │
|
||||
│ └─┬───────┬──────────┬──────────┬────────┘
|
||||
│ │ │ │ │
|
||||
┌─▼───▼───────▼──────────▼──────────▼────────┐
|
||||
│ Sum logic │
|
||||
│ │
|
||||
└┬────┬───────┬──────────┬──────────┬────────┘
|
||||
│ │ │ │ │
|
||||
▼ ▼ ▼ ▼ ▼
|
||||
Cout S3 S1 S0 S0
|
||||
</code></pre>
|
||||
<p>Description of the <strong>init</strong> method.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>a</code></strong> : <code>Bus</code></dt>
|
||||
<dd>First input bus.</dd>
|
||||
<dt><strong><code>b</code></strong> : <code>Bus</code></dt>
|
||||
<dd>Second input bus.</dd>
|
||||
<dt><strong><code>prefix</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Prefix name of unsigned P/G rca. Defaults to "u_pg_rca".</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class UnsignedPGRippleCarryAdder(ArithmeticCircuit):
|
||||
"""Class representing unsigned ripple carry adder with propagate/generate logic.
|
||||
|
||||
Unsigned ripple carry adder with PG logic represents slightly different rca implementation
|
||||
of N-bit unsigned adder which is composed of N one bit full adders with P/G logic.
|
||||
|
||||
```
|
||||
B3 A3 B2 A2 B1 A1 B0 A0
|
||||
│ │ │ │ │ │ │ │
|
||||
┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ PG │ C3 │ PG │ C2 │ PG │ C1 │ PG │
|
||||
│ FA │◄────┐│ FA │◄──┐│ FA │◄──┐│ FA │◄──0
|
||||
│ │ ││ │ ││ │ ││ │
|
||||
└─┬──┬┬┘ │└─┬┬┬──┘ │└─┬┬┬──┘ │└─┬┬┬──┘
|
||||
│ ││G3P3S3│ │││G2P2S2│ │││G1P1S1│ │││G0P0S0
|
||||
│ ┌▼▼──────┴──▼▼▼──────┴──▼▼▼──────┴──▼▼▼──┐
|
||||
│ │ Group PG logic │
|
||||
│ │ │
|
||||
│ └─┬───────┬──────────┬──────────┬────────┘
|
||||
│ │ │ │ │
|
||||
┌─▼───▼───────▼──────────▼──────────▼────────┐
|
||||
│ Sum logic │
|
||||
│ │
|
||||
└┬────┬───────┬──────────┬──────────┬────────┘
|
||||
│ │ │ │ │
|
||||
▼ ▼ ▼ ▼ ▼
|
||||
Cout S3 S1 S0 S0
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
prefix (str, optional): Prefix name of unsigned P/G rca. Defaults to "u_pg_rca".
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, prefix: str = "u_pg_rca"):
|
||||
super().__init__()
|
||||
self.N = max(a.N, b.N)
|
||||
self.prefix = prefix
|
||||
self.a = Bus(prefix=a.prefix, wires_list=a.bus)
|
||||
self.b = Bus(prefix=b.prefix, wires_list=b.bus)
|
||||
|
||||
# Bus sign extension in case buses have different lengths
|
||||
self.a.bus_extend(N=self.N, prefix=a.prefix)
|
||||
self.b.bus_extend(N=self.N, prefix=b.prefix)
|
||||
|
||||
# Output wires for N sum bits and additional cout bit
|
||||
self.out = Bus(self.prefix+"_out", self.N+1)
|
||||
|
||||
# Gradual addition of 1-bit adder components
|
||||
for input_index in range(self.N):
|
||||
if input_index == 0:
|
||||
# First full adder with connected constant wire with value 0 as cin 0
|
||||
obj_pg_fa = FullAdderPG(self.a.get_wire(input_index), self.b.get_wire(input_index), ConstantWireValue0(), prefix=self.prefix+"_pg_fa"+str(input_index))
|
||||
else:
|
||||
obj_pg_fa = FullAdderPG(self.a.get_wire(input_index), self.b.get_wire(input_index), self.get_previous_component().out, prefix=self.prefix+"_pg_fa"+str(input_index))
|
||||
|
||||
self.add_component(obj_pg_fa)
|
||||
self.out.connect(input_index, obj_pg_fa.get_sum_wire())
|
||||
|
||||
obj_and = AndGate(self.get_previous_component().c, self.get_previous_component().get_propagate_wire(), prefix=self.prefix+"_and"+str(input_index), parent_component=self)
|
||||
obj_or = OrGate(obj_and.out, self.get_previous_component().get_generate_wire(), prefix=self.prefix+"_or"+str(input_index), parent_component=self)
|
||||
self.add_component(obj_and)
|
||||
self.add_component(obj_or)
|
||||
|
||||
# Connecting last output bit to last cout
|
||||
if input_index == (self.N-1):
|
||||
self.out.connect(self.N, obj_or.out)</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></li>
|
||||
</ul>
|
||||
<h3>Subclasses</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.SignedPGRippleCarryAdder" href="#ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.SignedPGRippleCarryAdder">SignedPGRippleCarryAdder</a></li>
|
||||
</ul>
|
||||
<h3>Inherited members</h3>
|
||||
<ul class="hlist">
|
||||
<li><code><b><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></b></code>:
|
||||
<ul class="hlist">
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component">add_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_flat">get_blif_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier">get_blif_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat">get_c_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier">get_c_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire">get_carry_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat">get_cgp_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires">get_cgp_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif">get_circuit_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c">get_circuit_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates">get_circuit_gates</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v">get_circuit_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index">get_circuit_wire_index</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types">get_component_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_blif">get_declaration_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_flat">get_declaration_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_hier">get_declaration_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_flat">get_declaration_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_hier">get_declaration_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier">get_declarations_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_v_hier">get_declarations_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blif_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blif_flat">get_function_blif_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_blif">get_function_block_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_c">get_function_block_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_v">get_function_block_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif">get_function_blocks_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c">get_function_blocks_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v">get_function_blocks_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif">get_function_out_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat">get_function_out_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_hier">get_function_out_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat">get_function_out_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier">get_function_out_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c">get_includes_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_flat">get_init_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier">get_init_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_flat">get_init_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier">get_init_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num">get_instance_num</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocation_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocation_blif_hier">get_invocation_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocations_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocations_blif_hier">get_invocations_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components">get_multi_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components">get_one_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_c">get_out_invocation_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_v">get_out_invocation_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp">get_outputs_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_parameters_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_parameters_cgp">get_parameters_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component">get_previous_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif">get_prototype_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_c">get_prototype_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_v">get_prototype_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire">get_sum_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp">get_triplets_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types">get_unique_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_flat">get_v_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier">get_v_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id">save_wire_id</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders" href="index.html">ariths_gen.multi_bit_circuits.adders</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.SignedPGRippleCarryAdder" href="#ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.SignedPGRippleCarryAdder">SignedPGRippleCarryAdder</a></code></h4>
|
||||
</li>
|
||||
<li>
|
||||
<h4><code><a title="ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder" href="#ariths_gen.multi_bit_circuits.adders.pg_ripple_carry_adder.UnsignedPGRippleCarryAdder">UnsignedPGRippleCarryAdder</a></code></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
496
ariths_gen/multi_bit_circuits/adders/ripple_carry_adder.html
Normal file
496
ariths_gen/multi_bit_circuits/adders/ripple_carry_adder.html
Normal file
@ -0,0 +1,496 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen.multi_bit_circuits.adders.ripple_carry_adder API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>ariths_gen.multi_bit_circuits.adders.ripple_carry_adder</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">from ariths_gen.wire_components import (
|
||||
Wire,
|
||||
ConstantWireValue0,
|
||||
ConstantWireValue1,
|
||||
Bus
|
||||
)
|
||||
from ariths_gen.core.arithmetic_circuits import (
|
||||
ArithmeticCircuit,
|
||||
MultiplierCircuit
|
||||
)
|
||||
from ariths_gen.one_bit_circuits.one_bit_components import (
|
||||
HalfAdder,
|
||||
PGLogicBlock,
|
||||
FullAdder,
|
||||
FullAdderPG
|
||||
)
|
||||
from ariths_gen.one_bit_circuits.logic_gates import (
|
||||
AndGate,
|
||||
NandGate,
|
||||
OrGate,
|
||||
NorGate,
|
||||
XorGate,
|
||||
XnorGate,
|
||||
NotGate
|
||||
)
|
||||
|
||||
|
||||
class UnsignedRippleCarryAdder(ArithmeticCircuit):
|
||||
"""Class representing unsigned ripple carry adder.
|
||||
|
||||
Unsigned ripple carry adder represents N-bit unsigned adder which is composed of
|
||||
N one bit adders, where first is a half adder and rest are full adders.
|
||||
|
||||
Its downside is its long propagation delay the bigger the circuit is.
|
||||
|
||||
```
|
||||
B3 A3 B2 A2 B1 A1 B0 A0
|
||||
│ │ │ │ │ │ │ │
|
||||
┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ │ C3│ │ C2│ │ C1│ │
|
||||
┌──┤ FA │◄──┤ FA │◄──┤ FA │◄──┤ HA │
|
||||
│ │ │ │ │ │ │ │ │
|
||||
│ └──┬───┘ └──┬───┘ └──┬───┘ └──┬───┘
|
||||
▼ ▼ ▼ ▼ ▼
|
||||
Cout S3 S2 S1 S0
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
prefix (str, optional): Prefix name of unsigned rca. Defaults to "u_rca".
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, prefix: str = "u_rca"):
|
||||
super().__init__()
|
||||
self.N = max(a.N, b.N)
|
||||
self.prefix = prefix
|
||||
self.a = Bus(prefix=a.prefix, wires_list=a.bus)
|
||||
self.b = Bus(prefix=b.prefix, wires_list=b.bus)
|
||||
|
||||
# Bus sign extension in case buses have different lengths
|
||||
self.a.bus_extend(N=self.N, prefix=a.prefix)
|
||||
self.b.bus_extend(N=self.N, prefix=b.prefix)
|
||||
|
||||
# Output wires for N sum bits and additional cout bit
|
||||
self.out = Bus(self.prefix+"_out", self.N+1)
|
||||
|
||||
# Gradual addition of 1-bit adder components
|
||||
for input_index in range(self.N):
|
||||
# First adder is a half adder
|
||||
if input_index == 0:
|
||||
obj_adder = HalfAdder(self.a.get_wire(input_index), self.b.get_wire(input_index), prefix=self.prefix+"_ha")
|
||||
# Rest adders are full adders
|
||||
else:
|
||||
obj_adder = FullAdder(self.a.get_wire(input_index), self.b.get_wire(input_index), self.get_previous_component().get_carry_wire(), prefix=self.prefix+"_fa"+str(input_index))
|
||||
|
||||
self.add_component(obj_adder)
|
||||
self.out.connect(input_index, obj_adder.get_sum_wire())
|
||||
if input_index == (self.N-1):
|
||||
self.out.connect(self.N, obj_adder.get_carry_wire())
|
||||
|
||||
|
||||
class SignedRippleCarryAdder(UnsignedRippleCarryAdder, ArithmeticCircuit):
|
||||
"""Class representing signed ripple carry adder.
|
||||
|
||||
Signed ripple carry adder represents N-bit signed adder which is composed of
|
||||
N one bit adders, where first is a half adder and rest are full adders.
|
||||
At last XOR gates are used to ensure proper sign extension.
|
||||
|
||||
Its downside is its long propagation delay the bigger the circuit is.
|
||||
|
||||
```
|
||||
B3 A3 B3 A3 B2 A2 B1 A1 B0 A0
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ SIGN │ C4│ │ C3│ │ C2│ │ C1│ │
|
||||
│Extend│◄──┤ FA │◄──┤ FA │◄──┤ FA │◄──┤ HA │
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
└──┬───┘ └──┬───┘ └──┬───┘ └──┬───┘ └──┬───┘
|
||||
▼ ▼ ▼ ▼ ▼
|
||||
Cout S3 S2 S1 S0
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
prefix (str, optional): Prefix name of signed rca. Defaults to "s_rca".
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, prefix: str = "s_rca"):
|
||||
super().__init__(a=a, b=b, prefix=prefix)
|
||||
self.c_data_type = "int64_t"
|
||||
|
||||
# Additional XOR gates to ensure correct sign extension in case of sign addition
|
||||
sign_xor_1 = XorGate(self.get_previous_component(1).a, self.get_previous_component(1).b, prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), parent_component=self)
|
||||
self.add_component(sign_xor_1)
|
||||
sign_xor_2 = XorGate(sign_xor_1.out, self.get_previous_component(2).get_carry_wire(), prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), parent_component=self)
|
||||
self.add_component(sign_xor_2)
|
||||
self.out.connect(self.N, sign_xor_2.out)</code></pre>
|
||||
</details>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.SignedRippleCarryAdder"><code class="flex name class">
|
||||
<span>class <span class="ident">SignedRippleCarryAdder</span></span>
|
||||
<span>(</span><span>a: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, b: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, prefix: str = 's_rca')</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Class representing signed ripple carry adder.</p>
|
||||
<p>Signed ripple carry adder represents N-bit signed adder which is composed of
|
||||
N one bit adders, where first is a half adder and rest are full adders.
|
||||
At last XOR gates are used to ensure proper sign extension.</p>
|
||||
<p>Its downside is its long propagation delay the bigger the circuit is.</p>
|
||||
<pre><code> B3 A3 B3 A3 B2 A2 B1 A1 B0 A0
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ SIGN │ C4│ │ C3│ │ C2│ │ C1│ │
|
||||
│Extend│◄──┤ FA │◄──┤ FA │◄──┤ FA │◄──┤ HA │
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
└──┬───┘ └──┬───┘ └──┬───┘ └──┬───┘ └──┬───┘
|
||||
▼ ▼ ▼ ▼ ▼
|
||||
Cout S3 S2 S1 S0
|
||||
</code></pre>
|
||||
<p>Description of the <strong>init</strong> method.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>a</code></strong> : <code>Bus</code></dt>
|
||||
<dd>First input bus.</dd>
|
||||
<dt><strong><code>b</code></strong> : <code>Bus</code></dt>
|
||||
<dd>Second input bus.</dd>
|
||||
<dt><strong><code>prefix</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Prefix name of signed rca. Defaults to "s_rca".</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class SignedRippleCarryAdder(UnsignedRippleCarryAdder, ArithmeticCircuit):
|
||||
"""Class representing signed ripple carry adder.
|
||||
|
||||
Signed ripple carry adder represents N-bit signed adder which is composed of
|
||||
N one bit adders, where first is a half adder and rest are full adders.
|
||||
At last XOR gates are used to ensure proper sign extension.
|
||||
|
||||
Its downside is its long propagation delay the bigger the circuit is.
|
||||
|
||||
```
|
||||
B3 A3 B3 A3 B2 A2 B1 A1 B0 A0
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ SIGN │ C4│ │ C3│ │ C2│ │ C1│ │
|
||||
│Extend│◄──┤ FA │◄──┤ FA │◄──┤ FA │◄──┤ HA │
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
└──┬───┘ └──┬───┘ └──┬───┘ └──┬───┘ └──┬───┘
|
||||
▼ ▼ ▼ ▼ ▼
|
||||
Cout S3 S2 S1 S0
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
prefix (str, optional): Prefix name of signed rca. Defaults to "s_rca".
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, prefix: str = "s_rca"):
|
||||
super().__init__(a=a, b=b, prefix=prefix)
|
||||
self.c_data_type = "int64_t"
|
||||
|
||||
# Additional XOR gates to ensure correct sign extension in case of sign addition
|
||||
sign_xor_1 = XorGate(self.get_previous_component(1).a, self.get_previous_component(1).b, prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), parent_component=self)
|
||||
self.add_component(sign_xor_1)
|
||||
sign_xor_2 = XorGate(sign_xor_1.out, self.get_previous_component(2).get_carry_wire(), prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), parent_component=self)
|
||||
self.add_component(sign_xor_2)
|
||||
self.out.connect(self.N, sign_xor_2.out)</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder" href="#ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder">UnsignedRippleCarryAdder</a></li>
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></li>
|
||||
</ul>
|
||||
<h3>Inherited members</h3>
|
||||
<ul class="hlist">
|
||||
<li><code><b><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder" href="#ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder">UnsignedRippleCarryAdder</a></b></code>:
|
||||
<ul class="hlist">
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.add_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component">add_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_blif_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_flat">get_blif_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_blif_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier">get_blif_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_c_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat">get_c_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_c_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier">get_c_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_carry_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire">get_carry_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_cgp_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat">get_cgp_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_cgp_wires" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires">get_cgp_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_circuit_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif">get_circuit_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_circuit_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c">get_circuit_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_circuit_gates" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates">get_circuit_gates</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_circuit_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v">get_circuit_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_circuit_wire_index" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index">get_circuit_wire_index</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_component_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types">get_component_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_declaration_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_blif">get_declaration_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_declaration_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_flat">get_declaration_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_declaration_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_hier">get_declaration_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_declaration_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_flat">get_declaration_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_declaration_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_hier">get_declaration_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_declarations_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier">get_declarations_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_declarations_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_v_hier">get_declarations_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_function_blif_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blif_flat">get_function_blif_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_function_block_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_blif">get_function_block_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_function_block_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_c">get_function_block_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_function_block_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_v">get_function_block_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_function_blocks_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif">get_function_blocks_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_function_blocks_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c">get_function_blocks_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_function_blocks_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v">get_function_blocks_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_function_out_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif">get_function_out_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_function_out_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat">get_function_out_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_function_out_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_hier">get_function_out_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_function_out_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat">get_function_out_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_function_out_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier">get_function_out_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_includes_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c">get_includes_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_init_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_flat">get_init_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_init_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier">get_init_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_init_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_flat">get_init_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_init_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier">get_init_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_instance_num" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num">get_instance_num</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_invocation_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocation_blif_hier">get_invocation_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_invocations_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocations_blif_hier">get_invocations_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_multi_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components">get_multi_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_one_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components">get_one_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_out_invocation_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_c">get_out_invocation_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_out_invocation_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_v">get_out_invocation_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_outputs_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp">get_outputs_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_parameters_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_parameters_cgp">get_parameters_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_previous_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component">get_previous_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_prototype_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif">get_prototype_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_prototype_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_c">get_prototype_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_prototype_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_v">get_prototype_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_sum_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire">get_sum_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_triplets_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp">get_triplets_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_unique_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types">get_unique_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_v_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_flat">get_v_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.get_v_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier">get_v_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder.save_wire_id" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id">save_wire_id</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dt id="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder"><code class="flex name class">
|
||||
<span>class <span class="ident">UnsignedRippleCarryAdder</span></span>
|
||||
<span>(</span><span>a: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, b: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, prefix: str = 'u_rca')</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Class representing unsigned ripple carry adder.</p>
|
||||
<p>Unsigned ripple carry adder represents N-bit unsigned adder which is composed of
|
||||
N one bit adders, where first is a half adder and rest are full adders.</p>
|
||||
<p>Its downside is its long propagation delay the bigger the circuit is.</p>
|
||||
<pre><code> B3 A3 B2 A2 B1 A1 B0 A0
|
||||
│ │ │ │ │ │ │ │
|
||||
┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ │ C3│ │ C2│ │ C1│ │
|
||||
┌──┤ FA │◄──┤ FA │◄──┤ FA │◄──┤ HA │
|
||||
│ │ │ │ │ │ │ │ │
|
||||
│ └──┬───┘ └──┬───┘ └──┬───┘ └──┬───┘
|
||||
▼ ▼ ▼ ▼ ▼
|
||||
Cout S3 S2 S1 S0
|
||||
</code></pre>
|
||||
<p>Description of the <strong>init</strong> method.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>a</code></strong> : <code>Bus</code></dt>
|
||||
<dd>First input bus.</dd>
|
||||
<dt><strong><code>b</code></strong> : <code>Bus</code></dt>
|
||||
<dd>Second input bus.</dd>
|
||||
<dt><strong><code>prefix</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Prefix name of unsigned rca. Defaults to "u_rca".</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class UnsignedRippleCarryAdder(ArithmeticCircuit):
|
||||
"""Class representing unsigned ripple carry adder.
|
||||
|
||||
Unsigned ripple carry adder represents N-bit unsigned adder which is composed of
|
||||
N one bit adders, where first is a half adder and rest are full adders.
|
||||
|
||||
Its downside is its long propagation delay the bigger the circuit is.
|
||||
|
||||
```
|
||||
B3 A3 B2 A2 B1 A1 B0 A0
|
||||
│ │ │ │ │ │ │ │
|
||||
┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ │ C3│ │ C2│ │ C1│ │
|
||||
┌──┤ FA │◄──┤ FA │◄──┤ FA │◄──┤ HA │
|
||||
│ │ │ │ │ │ │ │ │
|
||||
│ └──┬───┘ └──┬───┘ └──┬───┘ └──┬───┘
|
||||
▼ ▼ ▼ ▼ ▼
|
||||
Cout S3 S2 S1 S0
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
prefix (str, optional): Prefix name of unsigned rca. Defaults to "u_rca".
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, prefix: str = "u_rca"):
|
||||
super().__init__()
|
||||
self.N = max(a.N, b.N)
|
||||
self.prefix = prefix
|
||||
self.a = Bus(prefix=a.prefix, wires_list=a.bus)
|
||||
self.b = Bus(prefix=b.prefix, wires_list=b.bus)
|
||||
|
||||
# Bus sign extension in case buses have different lengths
|
||||
self.a.bus_extend(N=self.N, prefix=a.prefix)
|
||||
self.b.bus_extend(N=self.N, prefix=b.prefix)
|
||||
|
||||
# Output wires for N sum bits and additional cout bit
|
||||
self.out = Bus(self.prefix+"_out", self.N+1)
|
||||
|
||||
# Gradual addition of 1-bit adder components
|
||||
for input_index in range(self.N):
|
||||
# First adder is a half adder
|
||||
if input_index == 0:
|
||||
obj_adder = HalfAdder(self.a.get_wire(input_index), self.b.get_wire(input_index), prefix=self.prefix+"_ha")
|
||||
# Rest adders are full adders
|
||||
else:
|
||||
obj_adder = FullAdder(self.a.get_wire(input_index), self.b.get_wire(input_index), self.get_previous_component().get_carry_wire(), prefix=self.prefix+"_fa"+str(input_index))
|
||||
|
||||
self.add_component(obj_adder)
|
||||
self.out.connect(input_index, obj_adder.get_sum_wire())
|
||||
if input_index == (self.N-1):
|
||||
self.out.connect(self.N, obj_adder.get_carry_wire())</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></li>
|
||||
</ul>
|
||||
<h3>Subclasses</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.SignedRippleCarryAdder" href="#ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.SignedRippleCarryAdder">SignedRippleCarryAdder</a></li>
|
||||
</ul>
|
||||
<h3>Inherited members</h3>
|
||||
<ul class="hlist">
|
||||
<li><code><b><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></b></code>:
|
||||
<ul class="hlist">
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component">add_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_flat">get_blif_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier">get_blif_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat">get_c_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier">get_c_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire">get_carry_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat">get_cgp_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires">get_cgp_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif">get_circuit_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c">get_circuit_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates">get_circuit_gates</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v">get_circuit_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index">get_circuit_wire_index</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types">get_component_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_blif">get_declaration_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_flat">get_declaration_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_hier">get_declaration_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_flat">get_declaration_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_hier">get_declaration_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier">get_declarations_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_v_hier">get_declarations_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blif_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blif_flat">get_function_blif_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_blif">get_function_block_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_c">get_function_block_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_v">get_function_block_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif">get_function_blocks_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c">get_function_blocks_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v">get_function_blocks_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif">get_function_out_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat">get_function_out_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_hier">get_function_out_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat">get_function_out_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier">get_function_out_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c">get_includes_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_flat">get_init_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier">get_init_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_flat">get_init_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier">get_init_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num">get_instance_num</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocation_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocation_blif_hier">get_invocation_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocations_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocations_blif_hier">get_invocations_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components">get_multi_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components">get_one_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_c">get_out_invocation_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_v">get_out_invocation_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp">get_outputs_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_parameters_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_parameters_cgp">get_parameters_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component">get_previous_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif">get_prototype_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_c">get_prototype_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_v">get_prototype_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire">get_sum_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp">get_triplets_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types">get_unique_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_flat">get_v_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier">get_v_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id">save_wire_id</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders" href="index.html">ariths_gen.multi_bit_circuits.adders</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.SignedRippleCarryAdder" href="#ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.SignedRippleCarryAdder">SignedRippleCarryAdder</a></code></h4>
|
||||
</li>
|
||||
<li>
|
||||
<h4><code><a title="ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder" href="#ariths_gen.multi_bit_circuits.adders.ripple_carry_adder.UnsignedRippleCarryAdder">UnsignedRippleCarryAdder</a></code></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
452
ariths_gen/multi_bit_circuits/dividers/array_divider.html
Normal file
452
ariths_gen/multi_bit_circuits/dividers/array_divider.html
Normal file
@ -0,0 +1,452 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen.multi_bit_circuits.dividers.array_divider API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>ariths_gen.multi_bit_circuits.dividers.array_divider</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">from ariths_gen.wire_components import (
|
||||
Wire,
|
||||
ConstantWireValue0,
|
||||
ConstantWireValue1,
|
||||
Bus
|
||||
)
|
||||
from ariths_gen.core.arithmetic_circuits import (
|
||||
ArithmeticCircuit,
|
||||
MultiplierCircuit
|
||||
)
|
||||
from ariths_gen.one_bit_circuits.one_bit_components import (
|
||||
HalfAdder,
|
||||
FullAdder,
|
||||
FullAdderPG,
|
||||
TwoOneMultiplexer,
|
||||
FullSubtractor
|
||||
)
|
||||
from ariths_gen.one_bit_circuits.logic_gates import (
|
||||
AndGate,
|
||||
NandGate,
|
||||
OrGate,
|
||||
NorGate,
|
||||
XorGate,
|
||||
XnorGate,
|
||||
NotGate
|
||||
)
|
||||
|
||||
|
||||
class ArrayDivider(ArithmeticCircuit):
|
||||
"""Class representing array divider.
|
||||
|
||||
Array divider performs division between two N bit numbers and stores their
|
||||
quotient in the output bus (remainder bits are not returned).
|
||||
|
||||
Design is based on series of iterative subtractions.
|
||||
|
||||
```
|
||||
0 B3 0 B2 0 B1 A3 B0
|
||||
│ │ │ │ │ │ │ │
|
||||
│ │ │ │ │ │ │ │
|
||||
┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ │ │ │ │ │ │ │
|
||||
┌─┤ FS │◄─┤ FS │◄─┤ FS │◄─┤ FS │◄─ 0
|
||||
│ │ │ │ │ │ │ │ │
|
||||
│ └──────┘ └───┬──┘ └───┬──┘ └───┬──┘
|
||||
│ │ │0 │ │0 │ │A3
|
||||
│ ┌─▼───▼┐ ┌─▼───▼┐ ┌─▼───▼┐
|
||||
├────────────►│2:1MUX├─►│2:1MUX├─►│2:1MUX│
|
||||
│ └───┬──┘ └───┬──┘ └───┬──┘
|
||||
│ MX0│ B3 MX1│ B2 MX2│ B1 A2 B0
|
||||
│ │ │ │ │ │ │ │ │
|
||||
│ ┌─▼─▼──┐ ┌─▼─▼──┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ │ │ │ │ │ │ │ │
|
||||
│ ┌─┤ FS │◄─┤ FS │◄─┤ FS │◄─┤ FS │◄─ 0
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
│ │ └──────┘ └───┬──┘ └───┬──┘ └───┬──┘
|
||||
│ │ │ │MX1 │ │MX2 │ │A2
|
||||
│ │ ┌─▼───▼┐ ┌─▼───▼┐ ┌─▼───▼┐
|
||||
│ ├────────────►│2:1MUX├─►│2:1MUX│─►│2:1MUX│
|
||||
│ │ └───┬──┘ └───┬──┘ └───┬──┘
|
||||
│ │ MX3│ B3 MX4│ B2 MX5│ B1 A1 B0
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
│ │ ┌─▼─▼──┐ ┌─▼─▼──┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
│ │ ┌─┤ FS │◄─┤ FS │◄─┤ FS │◄─┤ FS │◄─ 0
|
||||
│ │ │ │ │ │ │ │ │ │ │
|
||||
│ │ │ └──────┘ └───┬──┘ └───┬──┘ └───┬──┘
|
||||
│ │ │ │ │MX4 │ │MX5 │ │A1
|
||||
│ │ │ ┌─▼───▼┐ ┌─▼───▼┐ ┌─▼───▼┐
|
||||
│ │ │────────────►│2:1MUX├─►│2:1MUX│─►│2:1MUX│
|
||||
│ │ │ └───┬──┘ └───┬──┘ └───┬──┘
|
||||
│ │ │ MX6│ B3 MX7│ B2 MX8│ B1 A0 B0
|
||||
│ │ │ │ │ │ │ │ │ │ │
|
||||
│ │ │ ┌─▼─▼──┐ ┌─▼─▼──┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ │ │ │ │ │ │ │ │ │ │
|
||||
│ │ │ ┌─┤ FS │◄─┤ FS │◄─┤ FS │◄─┤ FS │◄─ 0
|
||||
│ │ │ │ │ │ │ │ │ │ │ │
|
||||
│ │ │ │ └──────┘ └──────┘ └──────┘ └──────┘
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
┌──▼──┐ ┌──▼──┐ ┌──▼──┐ ┌──▼──┐
|
||||
│ │ │ │ │ │ │ │
|
||||
│ NOT │ │ NOT │ │ NOT │ │ NOT │
|
||||
│ │ │ │ │ │ │ │
|
||||
└──┬──┘ └──┬──┘ └──┬──┘ └──┬──┘
|
||||
▼ ▼ ▼ ▼
|
||||
Q3 Q2 Q1 Q0
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
prefix (str, optional): Prefix name of array divider. Defaults to "arrdiv".
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, prefix: str = "arrdiv"):
|
||||
super().__init__()
|
||||
self.N = max(a.N, b.N)
|
||||
self.prefix = prefix
|
||||
self.a = Bus(prefix=a.prefix, wires_list=a.bus)
|
||||
self.b = Bus(prefix=b.prefix, wires_list=b.bus)
|
||||
|
||||
# Bus sign extension in case buses have different lengths
|
||||
self.a.bus_extend(N=self.N, prefix=a.prefix)
|
||||
self.b.bus_extend(N=self.N, prefix=b.prefix)
|
||||
|
||||
# Output wires for quotient result
|
||||
self.out = Bus(self.prefix+"_out", self.N)
|
||||
|
||||
# Performing series of iterative subtractions
|
||||
# Gradually shifting the divisor
|
||||
for a_index in reversed(range(self.N)):
|
||||
# Series of subtractions to obtain quotient bit
|
||||
for b_index in range(self.N):
|
||||
# First full subtractor is formed from divisor's LSB bit (b_index) and divident's MSB bit (a_index)
|
||||
if b_index == 0:
|
||||
adder_object = FullSubtractor(a=self.a.get_wire(a_index), b=self.b.get_wire(b_index), c=ConstantWireValue0(), prefix=self.prefix+"_fs"+str(self.get_instance_num(cls=FullSubtractor)))
|
||||
elif a_index == self.N-1:
|
||||
adder_object = FullSubtractor(a=ConstantWireValue0(), b=self.b.get_wire(b_index), c=self.get_previous_component().get_borrow_wire(), prefix=self.prefix+"_fs"+str(self.get_instance_num(cls=FullSubtractor)))
|
||||
else:
|
||||
adder_object = FullSubtractor(a=self.get_previous_component(self.N+1).out.get_wire(), b=self.b.get_wire(b_index), c=self.get_previous_component().get_borrow_wire(), prefix=self.prefix+"_fs"+str(self.get_instance_num(cls=FullSubtractor)))
|
||||
self.add_component(adder_object)
|
||||
|
||||
# Don't generate multiplexers for divison remainders
|
||||
if a_index != 0:
|
||||
for mux_index in range(self.N-1):
|
||||
mux_object = TwoOneMultiplexer(a=self.get_previous_component(self.N).get_difference_wire(), b=self.get_previous_component(self.N).a, c=self.get_previous_component(1+mux_index).get_borrow_wire(), prefix=self.prefix+"_mux2to1"+str(self.get_instance_num(cls=TwoOneMultiplexer)))
|
||||
self.add_component(mux_object)
|
||||
|
||||
# Every borrow out obtained from each iteration of subtractions needs to be negated to represent the quotient output bit
|
||||
quotient = NotGate(a=adder_object.get_borrow_wire(), prefix=self.prefix+"_not"+str(self.get_instance_num(cls=NotGate)), parent_component=self)
|
||||
self.add_component(quotient)
|
||||
self.out.connect(a_index, quotient.out)</code></pre>
|
||||
</details>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="ariths_gen.multi_bit_circuits.dividers.array_divider.ArrayDivider"><code class="flex name class">
|
||||
<span>class <span class="ident">ArrayDivider</span></span>
|
||||
<span>(</span><span>a: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, b: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, prefix: str = 'arrdiv')</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Class representing array divider.</p>
|
||||
<p>Array divider performs division between two N bit numbers and stores their
|
||||
quotient in the output bus (remainder bits are not returned).</p>
|
||||
<p>Design is based on series of iterative subtractions.</p>
|
||||
<pre><code> 0 B3 0 B2 0 B1 A3 B0
|
||||
│ │ │ │ │ │ │ │
|
||||
│ │ │ │ │ │ │ │
|
||||
┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ │ │ │ │ │ │ │
|
||||
┌─┤ FS │◄─┤ FS │◄─┤ FS │◄─┤ FS │◄─ 0
|
||||
│ │ │ │ │ │ │ │ │
|
||||
│ └──────┘ └───┬──┘ └───┬──┘ └───┬──┘
|
||||
│ │ │0 │ │0 │ │A3
|
||||
│ ┌─▼───▼┐ ┌─▼───▼┐ ┌─▼───▼┐
|
||||
├────────────►│2:1MUX├─►│2:1MUX├─►│2:1MUX│
|
||||
│ └───┬──┘ └───┬──┘ └───┬──┘
|
||||
│ MX0│ B3 MX1│ B2 MX2│ B1 A2 B0
|
||||
│ │ │ │ │ │ │ │ │
|
||||
│ ┌─▼─▼──┐ ┌─▼─▼──┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ │ │ │ │ │ │ │ │
|
||||
│ ┌─┤ FS │◄─┤ FS │◄─┤ FS │◄─┤ FS │◄─ 0
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
│ │ └──────┘ └───┬──┘ └───┬──┘ └───┬──┘
|
||||
│ │ │ │MX1 │ │MX2 │ │A2
|
||||
│ │ ┌─▼───▼┐ ┌─▼───▼┐ ┌─▼───▼┐
|
||||
│ ├────────────►│2:1MUX├─►│2:1MUX│─►│2:1MUX│
|
||||
│ │ └───┬──┘ └───┬──┘ └───┬──┘
|
||||
│ │ MX3│ B3 MX4│ B2 MX5│ B1 A1 B0
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
│ │ ┌─▼─▼──┐ ┌─▼─▼──┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
│ │ ┌─┤ FS │◄─┤ FS │◄─┤ FS │◄─┤ FS │◄─ 0
|
||||
│ │ │ │ │ │ │ │ │ │ │
|
||||
│ │ │ └──────┘ └───┬──┘ └───┬──┘ └───┬──┘
|
||||
│ │ │ │ │MX4 │ │MX5 │ │A1
|
||||
│ │ │ ┌─▼───▼┐ ┌─▼───▼┐ ┌─▼───▼┐
|
||||
│ │ │────────────►│2:1MUX├─►│2:1MUX│─►│2:1MUX│
|
||||
│ │ │ └───┬──┘ └───┬──┘ └───┬──┘
|
||||
│ │ │ MX6│ B3 MX7│ B2 MX8│ B1 A0 B0
|
||||
│ │ │ │ │ │ │ │ │ │ │
|
||||
│ │ │ ┌─▼─▼──┐ ┌─▼─▼──┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ │ │ │ │ │ │ │ │ │ │
|
||||
│ │ │ ┌─┤ FS │◄─┤ FS │◄─┤ FS │◄─┤ FS │◄─ 0
|
||||
│ │ │ │ │ │ │ │ │ │ │ │
|
||||
│ │ │ │ └──────┘ └──────┘ └──────┘ └──────┘
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
┌──▼──┐ ┌──▼──┐ ┌──▼──┐ ┌──▼──┐
|
||||
│ │ │ │ │ │ │ │
|
||||
│ NOT │ │ NOT │ │ NOT │ │ NOT │
|
||||
│ │ │ │ │ │ │ │
|
||||
└──┬──┘ └──┬──┘ └──┬──┘ └──┬──┘
|
||||
▼ ▼ ▼ ▼
|
||||
Q3 Q2 Q1 Q0
|
||||
</code></pre>
|
||||
<p>Description of the <strong>init</strong> method.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>a</code></strong> : <code>Bus</code></dt>
|
||||
<dd>First input bus.</dd>
|
||||
<dt><strong><code>b</code></strong> : <code>Bus</code></dt>
|
||||
<dd>Second input bus.</dd>
|
||||
<dt><strong><code>prefix</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Prefix name of array divider. Defaults to "arrdiv".</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class ArrayDivider(ArithmeticCircuit):
|
||||
"""Class representing array divider.
|
||||
|
||||
Array divider performs division between two N bit numbers and stores their
|
||||
quotient in the output bus (remainder bits are not returned).
|
||||
|
||||
Design is based on series of iterative subtractions.
|
||||
|
||||
```
|
||||
0 B3 0 B2 0 B1 A3 B0
|
||||
│ │ │ │ │ │ │ │
|
||||
│ │ │ │ │ │ │ │
|
||||
┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ │ │ │ │ │ │ │
|
||||
┌─┤ FS │◄─┤ FS │◄─┤ FS │◄─┤ FS │◄─ 0
|
||||
│ │ │ │ │ │ │ │ │
|
||||
│ └──────┘ └───┬──┘ └───┬──┘ └───┬──┘
|
||||
│ │ │0 │ │0 │ │A3
|
||||
│ ┌─▼───▼┐ ┌─▼───▼┐ ┌─▼───▼┐
|
||||
├────────────►│2:1MUX├─►│2:1MUX├─►│2:1MUX│
|
||||
│ └───┬──┘ └───┬──┘ └───┬──┘
|
||||
│ MX0│ B3 MX1│ B2 MX2│ B1 A2 B0
|
||||
│ │ │ │ │ │ │ │ │
|
||||
│ ┌─▼─▼──┐ ┌─▼─▼──┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ │ │ │ │ │ │ │ │
|
||||
│ ┌─┤ FS │◄─┤ FS │◄─┤ FS │◄─┤ FS │◄─ 0
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
│ │ └──────┘ └───┬──┘ └───┬──┘ └───┬──┘
|
||||
│ │ │ │MX1 │ │MX2 │ │A2
|
||||
│ │ ┌─▼───▼┐ ┌─▼───▼┐ ┌─▼───▼┐
|
||||
│ ├────────────►│2:1MUX├─►│2:1MUX│─►│2:1MUX│
|
||||
│ │ └───┬──┘ └───┬──┘ └───┬──┘
|
||||
│ │ MX3│ B3 MX4│ B2 MX5│ B1 A1 B0
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
│ │ ┌─▼─▼──┐ ┌─▼─▼──┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
│ │ ┌─┤ FS │◄─┤ FS │◄─┤ FS │◄─┤ FS │◄─ 0
|
||||
│ │ │ │ │ │ │ │ │ │ │
|
||||
│ │ │ └──────┘ └───┬──┘ └───┬──┘ └───┬──┘
|
||||
│ │ │ │ │MX4 │ │MX5 │ │A1
|
||||
│ │ │ ┌─▼───▼┐ ┌─▼───▼┐ ┌─▼───▼┐
|
||||
│ │ │────────────►│2:1MUX├─►│2:1MUX│─►│2:1MUX│
|
||||
│ │ │ └───┬──┘ └───┬──┘ └───┬──┘
|
||||
│ │ │ MX6│ B3 MX7│ B2 MX8│ B1 A0 B0
|
||||
│ │ │ │ │ │ │ │ │ │ │
|
||||
│ │ │ ┌─▼─▼──┐ ┌─▼─▼──┐ ┌─▼──▼─┐ ┌─▼──▼─┐
|
||||
│ │ │ │ │ │ │ │ │ │ │
|
||||
│ │ │ ┌─┤ FS │◄─┤ FS │◄─┤ FS │◄─┤ FS │◄─ 0
|
||||
│ │ │ │ │ │ │ │ │ │ │ │
|
||||
│ │ │ │ └──────┘ └──────┘ └──────┘ └──────┘
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
┌──▼──┐ ┌──▼──┐ ┌──▼──┐ ┌──▼──┐
|
||||
│ │ │ │ │ │ │ │
|
||||
│ NOT │ │ NOT │ │ NOT │ │ NOT │
|
||||
│ │ │ │ │ │ │ │
|
||||
└──┬──┘ └──┬──┘ └──┬──┘ └──┬──┘
|
||||
▼ ▼ ▼ ▼
|
||||
Q3 Q2 Q1 Q0
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
prefix (str, optional): Prefix name of array divider. Defaults to "arrdiv".
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, prefix: str = "arrdiv"):
|
||||
super().__init__()
|
||||
self.N = max(a.N, b.N)
|
||||
self.prefix = prefix
|
||||
self.a = Bus(prefix=a.prefix, wires_list=a.bus)
|
||||
self.b = Bus(prefix=b.prefix, wires_list=b.bus)
|
||||
|
||||
# Bus sign extension in case buses have different lengths
|
||||
self.a.bus_extend(N=self.N, prefix=a.prefix)
|
||||
self.b.bus_extend(N=self.N, prefix=b.prefix)
|
||||
|
||||
# Output wires for quotient result
|
||||
self.out = Bus(self.prefix+"_out", self.N)
|
||||
|
||||
# Performing series of iterative subtractions
|
||||
# Gradually shifting the divisor
|
||||
for a_index in reversed(range(self.N)):
|
||||
# Series of subtractions to obtain quotient bit
|
||||
for b_index in range(self.N):
|
||||
# First full subtractor is formed from divisor's LSB bit (b_index) and divident's MSB bit (a_index)
|
||||
if b_index == 0:
|
||||
adder_object = FullSubtractor(a=self.a.get_wire(a_index), b=self.b.get_wire(b_index), c=ConstantWireValue0(), prefix=self.prefix+"_fs"+str(self.get_instance_num(cls=FullSubtractor)))
|
||||
elif a_index == self.N-1:
|
||||
adder_object = FullSubtractor(a=ConstantWireValue0(), b=self.b.get_wire(b_index), c=self.get_previous_component().get_borrow_wire(), prefix=self.prefix+"_fs"+str(self.get_instance_num(cls=FullSubtractor)))
|
||||
else:
|
||||
adder_object = FullSubtractor(a=self.get_previous_component(self.N+1).out.get_wire(), b=self.b.get_wire(b_index), c=self.get_previous_component().get_borrow_wire(), prefix=self.prefix+"_fs"+str(self.get_instance_num(cls=FullSubtractor)))
|
||||
self.add_component(adder_object)
|
||||
|
||||
# Don't generate multiplexers for divison remainders
|
||||
if a_index != 0:
|
||||
for mux_index in range(self.N-1):
|
||||
mux_object = TwoOneMultiplexer(a=self.get_previous_component(self.N).get_difference_wire(), b=self.get_previous_component(self.N).a, c=self.get_previous_component(1+mux_index).get_borrow_wire(), prefix=self.prefix+"_mux2to1"+str(self.get_instance_num(cls=TwoOneMultiplexer)))
|
||||
self.add_component(mux_object)
|
||||
|
||||
# Every borrow out obtained from each iteration of subtractions needs to be negated to represent the quotient output bit
|
||||
quotient = NotGate(a=adder_object.get_borrow_wire(), prefix=self.prefix+"_not"+str(self.get_instance_num(cls=NotGate)), parent_component=self)
|
||||
self.add_component(quotient)
|
||||
self.out.connect(a_index, quotient.out)</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></li>
|
||||
</ul>
|
||||
<h3>Inherited members</h3>
|
||||
<ul class="hlist">
|
||||
<li><code><b><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></b></code>:
|
||||
<ul class="hlist">
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component">add_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_flat">get_blif_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier">get_blif_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat">get_c_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier">get_c_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire">get_carry_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat">get_cgp_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires">get_cgp_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif">get_circuit_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c">get_circuit_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates">get_circuit_gates</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v">get_circuit_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index">get_circuit_wire_index</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types">get_component_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_blif">get_declaration_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_flat">get_declaration_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_hier">get_declaration_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_flat">get_declaration_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_hier">get_declaration_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier">get_declarations_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_v_hier">get_declarations_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blif_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blif_flat">get_function_blif_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_blif">get_function_block_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_c">get_function_block_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_v">get_function_block_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif">get_function_blocks_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c">get_function_blocks_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v">get_function_blocks_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif">get_function_out_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat">get_function_out_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_hier">get_function_out_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat">get_function_out_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier">get_function_out_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c">get_includes_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_flat">get_init_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier">get_init_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_flat">get_init_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier">get_init_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num">get_instance_num</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocation_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocation_blif_hier">get_invocation_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocations_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocations_blif_hier">get_invocations_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components">get_multi_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components">get_one_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_c">get_out_invocation_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_v">get_out_invocation_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp">get_outputs_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_parameters_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_parameters_cgp">get_parameters_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component">get_previous_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif">get_prototype_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_c">get_prototype_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_v">get_prototype_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire">get_sum_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp">get_triplets_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types">get_unique_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_flat">get_v_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier">get_v_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id">save_wire_id</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.dividers" href="index.html">ariths_gen.multi_bit_circuits.dividers</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="ariths_gen.multi_bit_circuits.dividers.array_divider.ArrayDivider" href="#ariths_gen.multi_bit_circuits.dividers.array_divider.ArrayDivider">ArrayDivider</a></code></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
73
ariths_gen/multi_bit_circuits/dividers/index.html
Normal file
73
ariths_gen/multi_bit_circuits/dividers/index.html
Normal file
@ -0,0 +1,73 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen.multi_bit_circuits.dividers API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>ariths_gen.multi_bit_circuits.dividers</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">from ariths_gen.multi_bit_circuits.dividers.array_divider import (
|
||||
ArrayDivider
|
||||
)</code></pre>
|
||||
</details>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
|
||||
<dl>
|
||||
<dt><code class="name"><a title="ariths_gen.multi_bit_circuits.dividers.array_divider" href="array_divider.html">ariths_gen.multi_bit_circuits.dividers.array_divider</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits" href="../index.html">ariths_gen.multi_bit_circuits</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.dividers.array_divider" href="array_divider.html">ariths_gen.multi_bit_circuits.dividers.array_divider</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
75
ariths_gen/multi_bit_circuits/index.html
Normal file
75
ariths_gen/multi_bit_circuits/index.html
Normal file
@ -0,0 +1,75 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen.multi_bit_circuits API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>ariths_gen.multi_bit_circuits</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
|
||||
<dl>
|
||||
<dt><code class="name"><a title="ariths_gen.multi_bit_circuits.adders" href="adders/index.html">ariths_gen.multi_bit_circuits.adders</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="ariths_gen.multi_bit_circuits.dividers" href="dividers/index.html">ariths_gen.multi_bit_circuits.dividers</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="ariths_gen.multi_bit_circuits.multipliers" href="multipliers/index.html">ariths_gen.multi_bit_circuits.multipliers</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen" href="../index.html">ariths_gen</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.adders" href="adders/index.html">ariths_gen.multi_bit_circuits.adders</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.dividers" href="dividers/index.html">ariths_gen.multi_bit_circuits.dividers</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.multipliers" href="multipliers/index.html">ariths_gen.multi_bit_circuits.multipliers</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
845
ariths_gen/multi_bit_circuits/multipliers/array_multiplier.html
Normal file
845
ariths_gen/multi_bit_circuits/multipliers/array_multiplier.html
Normal file
@ -0,0 +1,845 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen.multi_bit_circuits.multipliers.array_multiplier API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>ariths_gen.multi_bit_circuits.multipliers.array_multiplier</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">from ariths_gen.wire_components import (
|
||||
Wire,
|
||||
ConstantWireValue0,
|
||||
ConstantWireValue1,
|
||||
Bus
|
||||
)
|
||||
from ariths_gen.core.arithmetic_circuits import (
|
||||
ArithmeticCircuit,
|
||||
MultiplierCircuit
|
||||
)
|
||||
from ariths_gen.one_bit_circuits.one_bit_components import (
|
||||
HalfAdder,
|
||||
FullAdder,
|
||||
FullAdderPG
|
||||
)
|
||||
from ariths_gen.one_bit_circuits.logic_gates import (
|
||||
AndGate,
|
||||
NandGate,
|
||||
OrGate,
|
||||
NorGate,
|
||||
XorGate,
|
||||
XnorGate,
|
||||
NotGate
|
||||
)
|
||||
|
||||
|
||||
class UnsignedArrayMultiplier(MultiplierCircuit):
|
||||
"""Class representing unsigned array multiplier.
|
||||
|
||||
Unsigned array multiplier represents N-bit multiplier composed of
|
||||
many AND gates and half/full adders to calculate partial products and
|
||||
gradually sum them.
|
||||
|
||||
Downside is its rather big area because it is composed of many logic gates.
|
||||
|
||||
```
|
||||
A3B0 A2B0 A1B0 A0B0
|
||||
│ │ │ │ │ │ │ │
|
||||
┌▼─▼┐ ┌▼─▼┐ ┌▼─▼┐ ┌▼─▼┐
|
||||
│AND│ │AND│ │AND│ │AND│
|
||||
└┬──┘ └┬──┘ └┬──┘ └─┬─┘
|
||||
A3B1 │ A2B1 │ A1B1 │ A0B1 │
|
||||
┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │
|
||||
│AND│ │ │AND│ │ │AND│ │ │AND│ │
|
||||
└┬──┘ │ └┬──┘ │ └┬──┘ │ └┬──┘ │
|
||||
│ │ │ │ │ │ │ │
|
||||
┌───▼┐ ┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ │
|
||||
│ │ │ │ │ │ │ │ │
|
||||
┌───────┤ HA │◄──┤ FA │◄──┤ FA │◄──┤ HA │ │
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
│ └┬───┘ └┬───┘ └┬───┘ └─┬──┘ │
|
||||
│ A3B2 │ A2B2 │ A1B2 │ A0B2 │ │
|
||||
│ ┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ │
|
||||
│ │AND│ │ │AND│ │ │AND│ │ │AND│ │ │
|
||||
│ └┬──┘ │ └┬──┘ │ └┬──┘ │ └┬──┘ │ │
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ │ │
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
┌───────┤ FA │◄──┤ FA │◄──┤ FA │◄──┤ HA │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │
|
||||
│ └┬───┘ └┬───┘ └┬───┘ └─┬──┘ │ │
|
||||
│ A3B3 │ A2B3 │ A1B3 │ A0B3 │ │ │
|
||||
│ ┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ │ │
|
||||
│ │AND│ │ │AND│ │ │AND│ │ │AND│ │ │ │
|
||||
│ └┬──┘ │ └┬──┘ │ └┬──┘ │ └┬──┘ │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │
|
||||
┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │
|
||||
┌──────┤ FA │◄──┤ FA │◄──┤ FA │◄──┤ HA │ │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │ │
|
||||
│ └─┬──┘ └─┬──┘ └─┬──┘ └─┬──┘ │ │ │
|
||||
│ │ │ │ │ │ │ │
|
||||
▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
|
||||
P7 P6 P5 P4 P3 P2 P1 P0
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
prefix (str, optional): Prefix name of unsigned array multiplier. Defaults to "u_arrmul".
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, prefix: str = "u_arrmul"):
|
||||
super().__init__()
|
||||
self.N = max(a.N, b.N)
|
||||
self.prefix = prefix
|
||||
self.a = Bus(prefix=a.prefix, wires_list=a.bus)
|
||||
self.b = Bus(prefix=b.prefix, wires_list=b.bus)
|
||||
|
||||
# Bus sign extension in case buses have different lengths
|
||||
self.a.bus_extend(N=self.N, prefix=a.prefix)
|
||||
self.b.bus_extend(N=self.N, prefix=b.prefix)
|
||||
|
||||
# Output wires for multiplication product
|
||||
self.out = Bus(self.prefix+"_out", self.N*2)
|
||||
|
||||
# Gradual generation of partial products
|
||||
for b_multiplier_index in range(self.N):
|
||||
for a_multiplicand_index in range(self.N):
|
||||
# AND gates generation for calculation of partial products
|
||||
obj_and = AndGate(self.a.get_wire(a_multiplicand_index), self.b.get_wire(b_multiplier_index), prefix=self.prefix+"_and"+str(a_multiplicand_index)+"_"+str(b_multiplier_index))
|
||||
self.add_component(obj_and)
|
||||
|
||||
if b_multiplier_index != 0:
|
||||
previous_product = self.components[a_multiplicand_index + b_multiplier_index].out if b_multiplier_index == 1 else self.get_previous_partial_product(a_index=a_multiplicand_index, b_index=b_multiplier_index)
|
||||
# HA generation for first 1-bit adder in each row starting from the second one
|
||||
if a_multiplicand_index == 0:
|
||||
obj_adder = HalfAdder(self.get_previous_component().out, previous_product, prefix=self.prefix+"_ha"+str(a_multiplicand_index)+"_"+str(b_multiplier_index))
|
||||
self.add_component(obj_adder)
|
||||
# Product generation
|
||||
self.out.connect(b_multiplier_index, obj_adder.get_sum_wire())
|
||||
|
||||
# HA generation, last 1-bit adder in second row
|
||||
elif a_multiplicand_index == self.N-1 and b_multiplier_index == 1:
|
||||
obj_adder = HalfAdder(self.get_previous_component().out, self.get_previous_component(number=2).get_carry_wire(), prefix=self.prefix+"_ha"+str(a_multiplicand_index)+"_"+str(b_multiplier_index))
|
||||
self.add_component(obj_adder)
|
||||
|
||||
# FA generation
|
||||
else:
|
||||
obj_adder = FullAdder(self.get_previous_component().out, previous_product, self.get_previous_component(number=2).get_carry_wire(), prefix=self.prefix+"_fa"+str(a_multiplicand_index)+"_"+str(b_multiplier_index))
|
||||
self.add_component(obj_adder)
|
||||
|
||||
# PRODUCT GENERATION
|
||||
if a_multiplicand_index == 0 and b_multiplier_index == 0:
|
||||
self.out.connect(a_multiplicand_index, obj_and.out)
|
||||
|
||||
# 1 bit multiplier case
|
||||
if a_multiplicand_index == self.N-1:
|
||||
self.out.connect(a_multiplicand_index+1, ConstantWireValue0)
|
||||
|
||||
elif b_multiplier_index == self.N-1:
|
||||
self.out.connect(b_multiplier_index + a_multiplicand_index, obj_adder.get_sum_wire())
|
||||
|
||||
if a_multiplicand_index == self.N-1:
|
||||
self.out.connect(self.out.N-1, obj_adder.get_carry_wire())
|
||||
|
||||
|
||||
class SignedArrayMultiplier(MultiplierCircuit):
|
||||
"""Class representing signed array multiplier.
|
||||
|
||||
Signed array multiplier represents N-bit multiplier composed of
|
||||
many AND/NAND gates and half/full adders to calculate partial products and
|
||||
gradually sum them.
|
||||
|
||||
Downside is its rather big area because it is composed of many logic gates.
|
||||
|
||||
```
|
||||
A3B0 A2B0 A1B0 A0B0
|
||||
│ │ │ │ │ │ │ │
|
||||
┌▼─▼─┐ ┌▼─▼┐ ┌▼─▼┐ ┌▼─▼┐
|
||||
│NAND│ │AND│ │AND│ │AND│
|
||||
└┬───┘ └┬──┘ └┬──┘ └─┬─┘
|
||||
A3B1 │ A2B1 │ A1B1 │ A0B1 │
|
||||
┌▼─▼─┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │
|
||||
│NAND│ │ │AND│ │ │AND│ │ │AND│ │
|
||||
1 └┬───┘ │ └┬──┘ │ └┬──┘ │ └┬──┘ │
|
||||
│ │ │ │ │ │ │ │ │
|
||||
┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ │
|
||||
│ │ │ │ │ │ │ │ │
|
||||
┌───────┤ FA │◄──┤ FA │◄──┤ FA │◄──┤ HA │ │
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
│ └┬───┘ └┬───┘ └┬───┘ └─┬──┘ │
|
||||
│ A3B2 │ A2B2 │ A1B2 │ A0B2 │ │
|
||||
│ ┌▼─▼─┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ │
|
||||
│ │NAND│ │ │AND│ │ │AND│ │ │AND│ │ │
|
||||
│ └┬───┘ │ └┬──┘ │ └┬──┘ │ └┬──┘ │ │
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ │ │
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
┌───────┤ FA │◄──┤ FA │◄──┤ FA │◄──┤ HA │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │
|
||||
│ └┬───┘ └┬───┘ └┬───┘ └─┬──┘ │ │
|
||||
│ A3B3 │ A2B3 │ A1B3 │ A0B3 │ │ │
|
||||
│ ┌▼─▼┐ │ ┌▼─▼─┐ │ ┌▼─▼─┐ │ ┌▼─▼─┐ │ │ │
|
||||
│ │AND│ │ │NAND│ │ │NAND│ │ │NAND│ │ │ │
|
||||
1 │ └┬──┘ │ └┬───┘ │ └┬───┘ │ └┬───┘ │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │ │
|
||||
┌─▼──┐ ┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │ │ │
|
||||
│XOR │◄──┤ FA │◄──┤ FA │◄──┤ FA │◄──┤ HA │ │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │ │ │
|
||||
└─┬──┘ └─┬──┘ └─┬──┘ └─┬──┘ └─┬──┘ │ │ │
|
||||
│ │ │ │ │ │ │ │
|
||||
▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
|
||||
P7 P6 P5 P4 P3 P2 P1 P0
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
prefix (str, optional): Prefix name of signed array multiplier. Defaults to "s_arrmul".
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, prefix: str = "s_arrmul"):
|
||||
super().__init__()
|
||||
self.c_data_type = "int64_t"
|
||||
self.N = max(a.N, b.N)
|
||||
self.prefix = prefix
|
||||
self.a = Bus(prefix=a.prefix, wires_list=a.bus)
|
||||
self.b = Bus(prefix=b.prefix, wires_list=b.bus)
|
||||
|
||||
# Bus sign extension in case buses have different lengths
|
||||
self.a.bus_extend(N=self.N, prefix=a.prefix)
|
||||
self.b.bus_extend(N=self.N, prefix=b.prefix)
|
||||
|
||||
# Output wires for multiplication product
|
||||
self.out = Bus(self.prefix+"_out", self.N*2)
|
||||
|
||||
# Gradual generation of partial products
|
||||
for b_multiplier_index in range(self.N):
|
||||
for a_multiplicand_index in range(self.N):
|
||||
# AND and NAND gates generation for calculation of partial products and sign extension
|
||||
if (b_multiplier_index == self.N-1 and a_multiplicand_index != self.N-1) or (b_multiplier_index != self.N-1 and a_multiplicand_index == self.N-1):
|
||||
obj_nand = NandGate(self.a.get_wire(a_multiplicand_index), self.b.get_wire(b_multiplier_index), prefix=self.prefix+"_nand"+str(a_multiplicand_index)+"_"+str(b_multiplier_index), parent_component=self)
|
||||
self.add_component(obj_nand)
|
||||
else:
|
||||
obj_and = AndGate(self.a.get_wire(a_multiplicand_index), self.b.get_wire(b_multiplier_index), prefix=self.prefix+"_and"+str(a_multiplicand_index)+"_"+str(b_multiplier_index), parent_component=self)
|
||||
self.add_component(obj_and)
|
||||
|
||||
if b_multiplier_index != 0:
|
||||
previous_product = self.components[a_multiplicand_index + b_multiplier_index].out if b_multiplier_index == 1 else self.get_previous_partial_product(a_index=a_multiplicand_index, b_index=b_multiplier_index)
|
||||
# HA generation for first 1-bit adder in each row starting from the second one
|
||||
if a_multiplicand_index == 0:
|
||||
obj_adder = HalfAdder(self.get_previous_component().out, previous_product, prefix=self.prefix+"_ha"+str(a_multiplicand_index)+"_"+str(b_multiplier_index))
|
||||
self.add_component(obj_adder)
|
||||
# Product generation
|
||||
self.out.connect(b_multiplier_index, obj_adder.get_sum_wire())
|
||||
|
||||
# FA generation
|
||||
else:
|
||||
# Constant wire with value 1 used at the last FA in second row (as one of its inputs) for signed multiplication (based on Baugh Wooley algorithm)
|
||||
if a_multiplicand_index == self.N-1 and b_multiplier_index == 1:
|
||||
previous_product = ConstantWireValue1()
|
||||
|
||||
obj_adder = FullAdder(self.get_previous_component().out, previous_product, self.get_previous_component(number=2).get_carry_wire(), prefix=self.prefix+"_fa"+str(a_multiplicand_index)+"_"+str(b_multiplier_index))
|
||||
self.add_component(obj_adder)
|
||||
|
||||
# PRODUCT GENERATION
|
||||
if a_multiplicand_index == 0 and b_multiplier_index == 0:
|
||||
self.out.connect(a_multiplicand_index, obj_and.out)
|
||||
|
||||
# 1 bit multiplier case
|
||||
if a_multiplicand_index == self.N-1:
|
||||
obj_nor = NorGate(ConstantWireValue1(), self.get_previous_component().out, prefix=self.prefix+"_nor_zero_extend", parent_component=self)
|
||||
self.add_component(obj_nor)
|
||||
|
||||
self.out.connect(a_multiplicand_index+1, obj_nor.out)
|
||||
|
||||
elif b_multiplier_index == self.N-1:
|
||||
self.out.connect(b_multiplier_index + a_multiplicand_index, obj_adder.get_sum_wire())
|
||||
|
||||
if a_multiplicand_index == self.N-1:
|
||||
obj_xor = XorGate(self.get_previous_component().get_carry_wire(), ConstantWireValue1(), prefix=self.prefix+"_xor"+str(a_multiplicand_index+1)+"_"+str(b_multiplier_index), parent_component=self)
|
||||
self.add_component(obj_xor)
|
||||
|
||||
self.out.connect(self.out.N-1, obj_xor.out)</code></pre>
|
||||
</details>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="ariths_gen.multi_bit_circuits.multipliers.array_multiplier.SignedArrayMultiplier"><code class="flex name class">
|
||||
<span>class <span class="ident">SignedArrayMultiplier</span></span>
|
||||
<span>(</span><span>a: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, b: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, prefix: str = 's_arrmul')</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Class representing signed array multiplier.</p>
|
||||
<p>Signed array multiplier represents N-bit multiplier composed of
|
||||
many AND/NAND gates and half/full adders to calculate partial products and
|
||||
gradually sum them.</p>
|
||||
<p>Downside is its rather big area because it is composed of many logic gates.</p>
|
||||
<pre><code> A3B0 A2B0 A1B0 A0B0
|
||||
│ │ │ │ │ │ │ │
|
||||
┌▼─▼─┐ ┌▼─▼┐ ┌▼─▼┐ ┌▼─▼┐
|
||||
│NAND│ │AND│ │AND│ │AND│
|
||||
└┬───┘ └┬──┘ └┬──┘ └─┬─┘
|
||||
A3B1 │ A2B1 │ A1B1 │ A0B1 │
|
||||
┌▼─▼─┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │
|
||||
│NAND│ │ │AND│ │ │AND│ │ │AND│ │
|
||||
1 └┬───┘ │ └┬──┘ │ └┬──┘ │ └┬──┘ │
|
||||
│ │ │ │ │ │ │ │ │
|
||||
┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ │
|
||||
│ │ │ │ │ │ │ │ │
|
||||
┌───────┤ FA │◄──┤ FA │◄──┤ FA │◄──┤ HA │ │
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
│ └┬───┘ └┬───┘ └┬───┘ └─┬──┘ │
|
||||
│ A3B2 │ A2B2 │ A1B2 │ A0B2 │ │
|
||||
│ ┌▼─▼─┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ │
|
||||
│ │NAND│ │ │AND│ │ │AND│ │ │AND│ │ │
|
||||
│ └┬───┘ │ └┬──┘ │ └┬──┘ │ └┬──┘ │ │
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ │ │
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
┌───────┤ FA │◄──┤ FA │◄──┤ FA │◄──┤ HA │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │
|
||||
│ └┬───┘ └┬───┘ └┬───┘ └─┬──┘ │ │
|
||||
│ A3B3 │ A2B3 │ A1B3 │ A0B3 │ │ │
|
||||
│ ┌▼─▼┐ │ ┌▼─▼─┐ │ ┌▼─▼─┐ │ ┌▼─▼─┐ │ │ │
|
||||
│ │AND│ │ │NAND│ │ │NAND│ │ │NAND│ │ │ │
|
||||
1 │ └┬──┘ │ └┬───┘ │ └┬───┘ │ └┬───┘ │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │ │
|
||||
┌─▼──┐ ┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │ │ │
|
||||
│XOR │◄──┤ FA │◄──┤ FA │◄──┤ FA │◄──┤ HA │ │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │ │ │
|
||||
└─┬──┘ └─┬──┘ └─┬──┘ └─┬──┘ └─┬──┘ │ │ │
|
||||
│ │ │ │ │ │ │ │
|
||||
▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
|
||||
P7 P6 P5 P4 P3 P2 P1 P0
|
||||
</code></pre>
|
||||
<p>Description of the <strong>init</strong> method.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>a</code></strong> : <code>Bus</code></dt>
|
||||
<dd>First input bus.</dd>
|
||||
<dt><strong><code>b</code></strong> : <code>Bus</code></dt>
|
||||
<dd>Second input bus.</dd>
|
||||
<dt><strong><code>prefix</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Prefix name of signed array multiplier. Defaults to "s_arrmul".</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class SignedArrayMultiplier(MultiplierCircuit):
|
||||
"""Class representing signed array multiplier.
|
||||
|
||||
Signed array multiplier represents N-bit multiplier composed of
|
||||
many AND/NAND gates and half/full adders to calculate partial products and
|
||||
gradually sum them.
|
||||
|
||||
Downside is its rather big area because it is composed of many logic gates.
|
||||
|
||||
```
|
||||
A3B0 A2B0 A1B0 A0B0
|
||||
│ │ │ │ │ │ │ │
|
||||
┌▼─▼─┐ ┌▼─▼┐ ┌▼─▼┐ ┌▼─▼┐
|
||||
│NAND│ │AND│ │AND│ │AND│
|
||||
└┬───┘ └┬──┘ └┬──┘ └─┬─┘
|
||||
A3B1 │ A2B1 │ A1B1 │ A0B1 │
|
||||
┌▼─▼─┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │
|
||||
│NAND│ │ │AND│ │ │AND│ │ │AND│ │
|
||||
1 └┬───┘ │ └┬──┘ │ └┬──┘ │ └┬──┘ │
|
||||
│ │ │ │ │ │ │ │ │
|
||||
┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ │
|
||||
│ │ │ │ │ │ │ │ │
|
||||
┌───────┤ FA │◄──┤ FA │◄──┤ FA │◄──┤ HA │ │
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
│ └┬───┘ └┬───┘ └┬───┘ └─┬──┘ │
|
||||
│ A3B2 │ A2B2 │ A1B2 │ A0B2 │ │
|
||||
│ ┌▼─▼─┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ │
|
||||
│ │NAND│ │ │AND│ │ │AND│ │ │AND│ │ │
|
||||
│ └┬───┘ │ └┬──┘ │ └┬──┘ │ └┬──┘ │ │
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ │ │
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
┌───────┤ FA │◄──┤ FA │◄──┤ FA │◄──┤ HA │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │
|
||||
│ └┬───┘ └┬───┘ └┬───┘ └─┬──┘ │ │
|
||||
│ A3B3 │ A2B3 │ A1B3 │ A0B3 │ │ │
|
||||
│ ┌▼─▼┐ │ ┌▼─▼─┐ │ ┌▼─▼─┐ │ ┌▼─▼─┐ │ │ │
|
||||
│ │AND│ │ │NAND│ │ │NAND│ │ │NAND│ │ │ │
|
||||
1 │ └┬──┘ │ └┬───┘ │ └┬───┘ │ └┬───┘ │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │ │
|
||||
┌─▼──┐ ┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │ │ │
|
||||
│XOR │◄──┤ FA │◄──┤ FA │◄──┤ FA │◄──┤ HA │ │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │ │ │
|
||||
└─┬──┘ └─┬──┘ └─┬──┘ └─┬──┘ └─┬──┘ │ │ │
|
||||
│ │ │ │ │ │ │ │
|
||||
▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
|
||||
P7 P6 P5 P4 P3 P2 P1 P0
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
prefix (str, optional): Prefix name of signed array multiplier. Defaults to "s_arrmul".
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, prefix: str = "s_arrmul"):
|
||||
super().__init__()
|
||||
self.c_data_type = "int64_t"
|
||||
self.N = max(a.N, b.N)
|
||||
self.prefix = prefix
|
||||
self.a = Bus(prefix=a.prefix, wires_list=a.bus)
|
||||
self.b = Bus(prefix=b.prefix, wires_list=b.bus)
|
||||
|
||||
# Bus sign extension in case buses have different lengths
|
||||
self.a.bus_extend(N=self.N, prefix=a.prefix)
|
||||
self.b.bus_extend(N=self.N, prefix=b.prefix)
|
||||
|
||||
# Output wires for multiplication product
|
||||
self.out = Bus(self.prefix+"_out", self.N*2)
|
||||
|
||||
# Gradual generation of partial products
|
||||
for b_multiplier_index in range(self.N):
|
||||
for a_multiplicand_index in range(self.N):
|
||||
# AND and NAND gates generation for calculation of partial products and sign extension
|
||||
if (b_multiplier_index == self.N-1 and a_multiplicand_index != self.N-1) or (b_multiplier_index != self.N-1 and a_multiplicand_index == self.N-1):
|
||||
obj_nand = NandGate(self.a.get_wire(a_multiplicand_index), self.b.get_wire(b_multiplier_index), prefix=self.prefix+"_nand"+str(a_multiplicand_index)+"_"+str(b_multiplier_index), parent_component=self)
|
||||
self.add_component(obj_nand)
|
||||
else:
|
||||
obj_and = AndGate(self.a.get_wire(a_multiplicand_index), self.b.get_wire(b_multiplier_index), prefix=self.prefix+"_and"+str(a_multiplicand_index)+"_"+str(b_multiplier_index), parent_component=self)
|
||||
self.add_component(obj_and)
|
||||
|
||||
if b_multiplier_index != 0:
|
||||
previous_product = self.components[a_multiplicand_index + b_multiplier_index].out if b_multiplier_index == 1 else self.get_previous_partial_product(a_index=a_multiplicand_index, b_index=b_multiplier_index)
|
||||
# HA generation for first 1-bit adder in each row starting from the second one
|
||||
if a_multiplicand_index == 0:
|
||||
obj_adder = HalfAdder(self.get_previous_component().out, previous_product, prefix=self.prefix+"_ha"+str(a_multiplicand_index)+"_"+str(b_multiplier_index))
|
||||
self.add_component(obj_adder)
|
||||
# Product generation
|
||||
self.out.connect(b_multiplier_index, obj_adder.get_sum_wire())
|
||||
|
||||
# FA generation
|
||||
else:
|
||||
# Constant wire with value 1 used at the last FA in second row (as one of its inputs) for signed multiplication (based on Baugh Wooley algorithm)
|
||||
if a_multiplicand_index == self.N-1 and b_multiplier_index == 1:
|
||||
previous_product = ConstantWireValue1()
|
||||
|
||||
obj_adder = FullAdder(self.get_previous_component().out, previous_product, self.get_previous_component(number=2).get_carry_wire(), prefix=self.prefix+"_fa"+str(a_multiplicand_index)+"_"+str(b_multiplier_index))
|
||||
self.add_component(obj_adder)
|
||||
|
||||
# PRODUCT GENERATION
|
||||
if a_multiplicand_index == 0 and b_multiplier_index == 0:
|
||||
self.out.connect(a_multiplicand_index, obj_and.out)
|
||||
|
||||
# 1 bit multiplier case
|
||||
if a_multiplicand_index == self.N-1:
|
||||
obj_nor = NorGate(ConstantWireValue1(), self.get_previous_component().out, prefix=self.prefix+"_nor_zero_extend", parent_component=self)
|
||||
self.add_component(obj_nor)
|
||||
|
||||
self.out.connect(a_multiplicand_index+1, obj_nor.out)
|
||||
|
||||
elif b_multiplier_index == self.N-1:
|
||||
self.out.connect(b_multiplier_index + a_multiplicand_index, obj_adder.get_sum_wire())
|
||||
|
||||
if a_multiplicand_index == self.N-1:
|
||||
obj_xor = XorGate(self.get_previous_component().get_carry_wire(), ConstantWireValue1(), prefix=self.prefix+"_xor"+str(a_multiplicand_index+1)+"_"+str(b_multiplier_index), parent_component=self)
|
||||
self.add_component(obj_xor)
|
||||
|
||||
self.out.connect(self.out.N-1, obj_xor.out)</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit">MultiplierCircuit</a></li>
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></li>
|
||||
</ul>
|
||||
<h3>Inherited members</h3>
|
||||
<ul class="hlist">
|
||||
<li><code><b><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit">MultiplierCircuit</a></b></code>:
|
||||
<ul class="hlist">
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wire" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wire">add_column_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wires" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wires">add_column_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component">add_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_blif_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_flat">get_blif_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_blif_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier">get_blif_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_c_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat">get_c_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_c_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier">get_c_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_carry_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire">get_carry_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_cgp_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat">get_cgp_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_cgp_wires" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires">get_cgp_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif">get_circuit_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c">get_circuit_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_gates" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates">get_circuit_gates</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v">get_circuit_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_wire_index" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index">get_circuit_wire_index</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_height" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_height">get_column_height</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_wire" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_wire">get_column_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_component_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types">get_component_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_blif">get_declaration_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_flat">get_declaration_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_hier">get_declaration_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_flat">get_declaration_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_hier">get_declaration_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declarations_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier">get_declarations_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declarations_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_v_hier">get_declarations_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blif_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blif_flat">get_function_blif_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_block_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_blif">get_function_block_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_block_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_c">get_function_block_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_block_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_v">get_function_block_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blocks_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif">get_function_blocks_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blocks_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c">get_function_blocks_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blocks_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v">get_function_blocks_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif">get_function_out_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat">get_function_out_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_hier">get_function_out_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat">get_function_out_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier">get_function_out_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_includes_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c">get_includes_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_flat">get_init_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier">get_init_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_flat">get_init_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier">get_init_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_instance_num" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num">get_instance_num</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_invocation_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocation_blif_hier">get_invocation_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_invocations_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocations_blif_hier">get_invocations_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_maximum_height" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_maximum_height">get_maximum_height</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_multi_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components">get_multi_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_one_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components">get_one_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_out_invocation_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_c">get_out_invocation_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_out_invocation_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_v">get_out_invocation_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_outputs_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp">get_outputs_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_parameters_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_parameters_cgp">get_parameters_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_previous_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component">get_previous_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_previous_partial_product" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_previous_partial_product">get_previous_partial_product</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_prototype_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif">get_prototype_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_prototype_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_c">get_prototype_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_prototype_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_v">get_prototype_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_sum_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire">get_sum_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_triplets_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp">get_triplets_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_unique_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types">get_unique_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_v_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_flat">get_v_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_v_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier">get_v_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.init_column_heights" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.init_column_heights">init_column_heights</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.save_wire_id" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id">save_wire_id</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_heights" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_heights">update_column_heights</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_wires" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_wires">update_column_wires</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dt id="ariths_gen.multi_bit_circuits.multipliers.array_multiplier.UnsignedArrayMultiplier"><code class="flex name class">
|
||||
<span>class <span class="ident">UnsignedArrayMultiplier</span></span>
|
||||
<span>(</span><span>a: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, b: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, prefix: str = 'u_arrmul')</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Class representing unsigned array multiplier.</p>
|
||||
<p>Unsigned array multiplier represents N-bit multiplier composed of
|
||||
many AND gates and half/full adders to calculate partial products and
|
||||
gradually sum them.</p>
|
||||
<p>Downside is its rather big area because it is composed of many logic gates.</p>
|
||||
<pre><code> A3B0 A2B0 A1B0 A0B0
|
||||
│ │ │ │ │ │ │ │
|
||||
┌▼─▼┐ ┌▼─▼┐ ┌▼─▼┐ ┌▼─▼┐
|
||||
│AND│ │AND│ │AND│ │AND│
|
||||
└┬──┘ └┬──┘ └┬──┘ └─┬─┘
|
||||
A3B1 │ A2B1 │ A1B1 │ A0B1 │
|
||||
┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │
|
||||
│AND│ │ │AND│ │ │AND│ │ │AND│ │
|
||||
└┬──┘ │ └┬──┘ │ └┬──┘ │ └┬──┘ │
|
||||
│ │ │ │ │ │ │ │
|
||||
┌───▼┐ ┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ │
|
||||
│ │ │ │ │ │ │ │ │
|
||||
┌───────┤ HA │◄──┤ FA │◄──┤ FA │◄──┤ HA │ │
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
│ └┬───┘ └┬───┘ └┬───┘ └─┬──┘ │
|
||||
│ A3B2 │ A2B2 │ A1B2 │ A0B2 │ │
|
||||
│ ┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ │
|
||||
│ │AND│ │ │AND│ │ │AND│ │ │AND│ │ │
|
||||
│ └┬──┘ │ └┬──┘ │ └┬──┘ │ └┬──┘ │ │
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ │ │
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
┌───────┤ FA │◄──┤ FA │◄──┤ FA │◄──┤ HA │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │
|
||||
│ └┬───┘ └┬───┘ └┬───┘ └─┬──┘ │ │
|
||||
│ A3B3 │ A2B3 │ A1B3 │ A0B3 │ │ │
|
||||
│ ┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ │ │
|
||||
│ │AND│ │ │AND│ │ │AND│ │ │AND│ │ │ │
|
||||
│ └┬──┘ │ └┬──┘ │ └┬──┘ │ └┬──┘ │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │
|
||||
┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │
|
||||
┌──────┤ FA │◄──┤ FA │◄──┤ FA │◄──┤ HA │ │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │ │
|
||||
│ └─┬──┘ └─┬──┘ └─┬──┘ └─┬──┘ │ │ │
|
||||
│ │ │ │ │ │ │ │
|
||||
▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
|
||||
P7 P6 P5 P4 P3 P2 P1 P0
|
||||
</code></pre>
|
||||
<p>Description of the <strong>init</strong> method.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>a</code></strong> : <code>Bus</code></dt>
|
||||
<dd>First input bus.</dd>
|
||||
<dt><strong><code>b</code></strong> : <code>Bus</code></dt>
|
||||
<dd>Second input bus.</dd>
|
||||
<dt><strong><code>prefix</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Prefix name of unsigned array multiplier. Defaults to "u_arrmul".</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class UnsignedArrayMultiplier(MultiplierCircuit):
|
||||
"""Class representing unsigned array multiplier.
|
||||
|
||||
Unsigned array multiplier represents N-bit multiplier composed of
|
||||
many AND gates and half/full adders to calculate partial products and
|
||||
gradually sum them.
|
||||
|
||||
Downside is its rather big area because it is composed of many logic gates.
|
||||
|
||||
```
|
||||
A3B0 A2B0 A1B0 A0B0
|
||||
│ │ │ │ │ │ │ │
|
||||
┌▼─▼┐ ┌▼─▼┐ ┌▼─▼┐ ┌▼─▼┐
|
||||
│AND│ │AND│ │AND│ │AND│
|
||||
└┬──┘ └┬──┘ └┬──┘ └─┬─┘
|
||||
A3B1 │ A2B1 │ A1B1 │ A0B1 │
|
||||
┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │
|
||||
│AND│ │ │AND│ │ │AND│ │ │AND│ │
|
||||
└┬──┘ │ └┬──┘ │ └┬──┘ │ └┬──┘ │
|
||||
│ │ │ │ │ │ │ │
|
||||
┌───▼┐ ┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ │
|
||||
│ │ │ │ │ │ │ │ │
|
||||
┌───────┤ HA │◄──┤ FA │◄──┤ FA │◄──┤ HA │ │
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
│ └┬───┘ └┬───┘ └┬───┘ └─┬──┘ │
|
||||
│ A3B2 │ A2B2 │ A1B2 │ A0B2 │ │
|
||||
│ ┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ │
|
||||
│ │AND│ │ │AND│ │ │AND│ │ │AND│ │ │
|
||||
│ └┬──┘ │ └┬──┘ │ └┬──┘ │ └┬──┘ │ │
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ │ │
|
||||
│ │ │ │ │ │ │ │ │ │
|
||||
┌───────┤ FA │◄──┤ FA │◄──┤ FA │◄──┤ HA │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │
|
||||
│ └┬───┘ └┬───┘ └┬───┘ └─┬──┘ │ │
|
||||
│ A3B3 │ A2B3 │ A1B3 │ A0B3 │ │ │
|
||||
│ ┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ ┌▼─▼┐ │ │ │
|
||||
│ │AND│ │ │AND│ │ │AND│ │ │AND│ │ │ │
|
||||
│ └┬──┘ │ └┬──┘ │ └┬──┘ │ └┬──┘ │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │
|
||||
┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ ┌▼──▼┐ │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │
|
||||
┌──────┤ FA │◄──┤ FA │◄──┤ FA │◄──┤ HA │ │ │ │
|
||||
│ │ │ │ │ │ │ │ │ │ │ │
|
||||
│ └─┬──┘ └─┬──┘ └─┬──┘ └─┬──┘ │ │ │
|
||||
│ │ │ │ │ │ │ │
|
||||
▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
|
||||
P7 P6 P5 P4 P3 P2 P1 P0
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
prefix (str, optional): Prefix name of unsigned array multiplier. Defaults to "u_arrmul".
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, prefix: str = "u_arrmul"):
|
||||
super().__init__()
|
||||
self.N = max(a.N, b.N)
|
||||
self.prefix = prefix
|
||||
self.a = Bus(prefix=a.prefix, wires_list=a.bus)
|
||||
self.b = Bus(prefix=b.prefix, wires_list=b.bus)
|
||||
|
||||
# Bus sign extension in case buses have different lengths
|
||||
self.a.bus_extend(N=self.N, prefix=a.prefix)
|
||||
self.b.bus_extend(N=self.N, prefix=b.prefix)
|
||||
|
||||
# Output wires for multiplication product
|
||||
self.out = Bus(self.prefix+"_out", self.N*2)
|
||||
|
||||
# Gradual generation of partial products
|
||||
for b_multiplier_index in range(self.N):
|
||||
for a_multiplicand_index in range(self.N):
|
||||
# AND gates generation for calculation of partial products
|
||||
obj_and = AndGate(self.a.get_wire(a_multiplicand_index), self.b.get_wire(b_multiplier_index), prefix=self.prefix+"_and"+str(a_multiplicand_index)+"_"+str(b_multiplier_index))
|
||||
self.add_component(obj_and)
|
||||
|
||||
if b_multiplier_index != 0:
|
||||
previous_product = self.components[a_multiplicand_index + b_multiplier_index].out if b_multiplier_index == 1 else self.get_previous_partial_product(a_index=a_multiplicand_index, b_index=b_multiplier_index)
|
||||
# HA generation for first 1-bit adder in each row starting from the second one
|
||||
if a_multiplicand_index == 0:
|
||||
obj_adder = HalfAdder(self.get_previous_component().out, previous_product, prefix=self.prefix+"_ha"+str(a_multiplicand_index)+"_"+str(b_multiplier_index))
|
||||
self.add_component(obj_adder)
|
||||
# Product generation
|
||||
self.out.connect(b_multiplier_index, obj_adder.get_sum_wire())
|
||||
|
||||
# HA generation, last 1-bit adder in second row
|
||||
elif a_multiplicand_index == self.N-1 and b_multiplier_index == 1:
|
||||
obj_adder = HalfAdder(self.get_previous_component().out, self.get_previous_component(number=2).get_carry_wire(), prefix=self.prefix+"_ha"+str(a_multiplicand_index)+"_"+str(b_multiplier_index))
|
||||
self.add_component(obj_adder)
|
||||
|
||||
# FA generation
|
||||
else:
|
||||
obj_adder = FullAdder(self.get_previous_component().out, previous_product, self.get_previous_component(number=2).get_carry_wire(), prefix=self.prefix+"_fa"+str(a_multiplicand_index)+"_"+str(b_multiplier_index))
|
||||
self.add_component(obj_adder)
|
||||
|
||||
# PRODUCT GENERATION
|
||||
if a_multiplicand_index == 0 and b_multiplier_index == 0:
|
||||
self.out.connect(a_multiplicand_index, obj_and.out)
|
||||
|
||||
# 1 bit multiplier case
|
||||
if a_multiplicand_index == self.N-1:
|
||||
self.out.connect(a_multiplicand_index+1, ConstantWireValue0)
|
||||
|
||||
elif b_multiplier_index == self.N-1:
|
||||
self.out.connect(b_multiplier_index + a_multiplicand_index, obj_adder.get_sum_wire())
|
||||
|
||||
if a_multiplicand_index == self.N-1:
|
||||
self.out.connect(self.out.N-1, obj_adder.get_carry_wire())</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit">MultiplierCircuit</a></li>
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></li>
|
||||
</ul>
|
||||
<h3>Inherited members</h3>
|
||||
<ul class="hlist">
|
||||
<li><code><b><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit">MultiplierCircuit</a></b></code>:
|
||||
<ul class="hlist">
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wire" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wire">add_column_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wires" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wires">add_column_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component">add_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_blif_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_flat">get_blif_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_blif_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier">get_blif_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_c_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat">get_c_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_c_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier">get_c_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_carry_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire">get_carry_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_cgp_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat">get_cgp_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_cgp_wires" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires">get_cgp_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif">get_circuit_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c">get_circuit_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_gates" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates">get_circuit_gates</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v">get_circuit_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_wire_index" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index">get_circuit_wire_index</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_height" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_height">get_column_height</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_wire" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_wire">get_column_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_component_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types">get_component_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_blif">get_declaration_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_flat">get_declaration_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_hier">get_declaration_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_flat">get_declaration_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_hier">get_declaration_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declarations_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier">get_declarations_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declarations_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_v_hier">get_declarations_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blif_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blif_flat">get_function_blif_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_block_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_blif">get_function_block_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_block_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_c">get_function_block_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_block_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_v">get_function_block_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blocks_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif">get_function_blocks_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blocks_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c">get_function_blocks_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blocks_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v">get_function_blocks_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif">get_function_out_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat">get_function_out_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_hier">get_function_out_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat">get_function_out_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier">get_function_out_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_includes_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c">get_includes_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_flat">get_init_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier">get_init_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_flat">get_init_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier">get_init_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_instance_num" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num">get_instance_num</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_invocation_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocation_blif_hier">get_invocation_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_invocations_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocations_blif_hier">get_invocations_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_maximum_height" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_maximum_height">get_maximum_height</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_multi_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components">get_multi_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_one_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components">get_one_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_out_invocation_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_c">get_out_invocation_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_out_invocation_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_v">get_out_invocation_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_outputs_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp">get_outputs_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_parameters_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_parameters_cgp">get_parameters_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_previous_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component">get_previous_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_previous_partial_product" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_previous_partial_product">get_previous_partial_product</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_prototype_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif">get_prototype_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_prototype_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_c">get_prototype_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_prototype_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_v">get_prototype_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_sum_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire">get_sum_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_triplets_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp">get_triplets_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_unique_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types">get_unique_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_v_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_flat">get_v_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_v_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier">get_v_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.init_column_heights" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.init_column_heights">init_column_heights</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.save_wire_id" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id">save_wire_id</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_heights" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_heights">update_column_heights</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_wires" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_wires">update_column_wires</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.multipliers" href="index.html">ariths_gen.multi_bit_circuits.multipliers</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="ariths_gen.multi_bit_circuits.multipliers.array_multiplier.SignedArrayMultiplier" href="#ariths_gen.multi_bit_circuits.multipliers.array_multiplier.SignedArrayMultiplier">SignedArrayMultiplier</a></code></h4>
|
||||
</li>
|
||||
<li>
|
||||
<h4><code><a title="ariths_gen.multi_bit_circuits.multipliers.array_multiplier.UnsignedArrayMultiplier" href="#ariths_gen.multi_bit_circuits.multipliers.array_multiplier.UnsignedArrayMultiplier">UnsignedArrayMultiplier</a></code></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
774
ariths_gen/multi_bit_circuits/multipliers/dadda_multiplier.html
Normal file
774
ariths_gen/multi_bit_circuits/multipliers/dadda_multiplier.html
Normal file
@ -0,0 +1,774 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen.multi_bit_circuits.multipliers.dadda_multiplier API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>ariths_gen.multi_bit_circuits.multipliers.dadda_multiplier</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">from ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder import UnsignedCarryLookaheadAdder
|
||||
from ariths_gen.wire_components import (
|
||||
Wire,
|
||||
ConstantWireValue0,
|
||||
ConstantWireValue1,
|
||||
Bus
|
||||
)
|
||||
from ariths_gen.core.arithmetic_circuits import (
|
||||
ArithmeticCircuit,
|
||||
MultiplierCircuit
|
||||
)
|
||||
from ariths_gen.one_bit_circuits.one_bit_components import (
|
||||
HalfAdder,
|
||||
FullAdder,
|
||||
FullAdderPG
|
||||
)
|
||||
from ariths_gen.one_bit_circuits.logic_gates import (
|
||||
AndGate,
|
||||
NandGate,
|
||||
OrGate,
|
||||
NorGate,
|
||||
XorGate,
|
||||
XnorGate,
|
||||
NotGate
|
||||
)
|
||||
|
||||
|
||||
class UnsignedDaddaMultiplier(MultiplierCircuit):
|
||||
"""Class representing unsigned dadda multiplier.
|
||||
|
||||
Unsigned dadda multiplier represents fast N-bit multiplier which utilizes
|
||||
the functionality of reduction algorithm proposed by Luigi Dadda.
|
||||
|
||||
First partial products are calculated for each bit pair that form the partial product multiplication columns.
|
||||
At last the reduced pairs are inserted into chosen multi bit unsigned adder to execute their summation and obtain the final output bits.
|
||||
|
||||
Dadda algorithm is described more in detail here:
|
||||
https://en.wikipedia.org/wiki/Dadda_multiplier
|
||||
|
||||
It is composed of much less inner components (half/full adders, AND gates) as opposed
|
||||
to e.g. wallace and array multipliers.
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
prefix (str, optional): Prefix name of unsigned dadda multiplier. Defaults to "u_dadda_cla".
|
||||
unsigned_adder_class_name (str, optional): Unsigned multi bit adder used to obtain final sums of products. Defaults to UnsignedCarryLookaheadAdder.
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, prefix: str = "u_dadda_cla", unsigned_adder_class_name: str = UnsignedCarryLookaheadAdder):
|
||||
super().__init__()
|
||||
self.N = max(a.N, b.N)
|
||||
self.prefix = prefix
|
||||
self.a = Bus(prefix=a.prefix, wires_list=a.bus)
|
||||
self.b = Bus(prefix=b.prefix, wires_list=b.bus)
|
||||
|
||||
# Bus sign extension in case buses have different lengths
|
||||
self.a.bus_extend(N=self.N, prefix=a.prefix)
|
||||
self.b.bus_extend(N=self.N, prefix=b.prefix)
|
||||
|
||||
# Output wires for multiplication product
|
||||
self.out = Bus(self.prefix+"_out", self.N*2)
|
||||
|
||||
# Get starting stage and maximum possible column height
|
||||
self.stage, self.d = self.get_maximum_height(initial_value=min(self.a.N, self.b.N))
|
||||
# Initialize all columns partial products forming AND gates matrix
|
||||
self.columns = self.init_column_heights()
|
||||
|
||||
# Perform reduction until stage 0
|
||||
for stage in range(self.stage, 0, -1):
|
||||
col = 0
|
||||
while col < len(self.columns):
|
||||
if self.get_column_height(col) == self.d + 1:
|
||||
# Add half adder and also AND gates if neccesarry (via add_column_wire invocation) into list of circuit components
|
||||
obj_adder = HalfAdder(self.add_column_wire(column=col, bit=0), self.add_column_wire(column=col, bit=1), prefix=self.prefix+"_ha"+str(self.get_instance_num(cls=HalfAdder)))
|
||||
self.add_component(obj_adder)
|
||||
|
||||
# Update the number of current and next column wires
|
||||
self.update_column_heights(curr_column=col, curr_height_change=-1, next_column=col+1, next_height_change=1)
|
||||
|
||||
# Update current and next column wires arrangement
|
||||
# add ha's generated sum to the bottom of current column
|
||||
# add ha's generated cout to the top of next column
|
||||
self.update_column_wires(curr_column=col, next_column=col+1, adder=self.get_previous_component(1))
|
||||
|
||||
elif self.get_column_height(col) > self.d:
|
||||
# Add full adder and also AND gates if neccesarry (via add_column_wire invocation) into list of circuit components
|
||||
obj_adder = FullAdder(self.add_column_wire(column=col, bit=0), self.add_column_wire(column=col, bit=1), self.add_column_wire(column=col, bit=2), prefix=self.prefix+"_fa"+str(self.get_instance_num(cls=FullAdder)))
|
||||
self.add_component(obj_adder)
|
||||
|
||||
# Update the number of current and next column wires
|
||||
self.update_column_heights(curr_column=col, curr_height_change=-2, next_column=col+1, next_height_change=1)
|
||||
|
||||
# Update current and next column wires arrangement
|
||||
# add fa's generated sum to the bottom of current column
|
||||
# add fa's generated cout to the top of next column
|
||||
self.update_column_wires(curr_column=col, next_column=col+1, adder=self.get_previous_component(1))
|
||||
|
||||
# Next iteration with same column in case there is need for further reduction
|
||||
col -= 1
|
||||
col += 1
|
||||
# Update maximum possible column height
|
||||
_, self.d = self.get_maximum_height(stage)
|
||||
|
||||
# Output generation
|
||||
# First output bit from single first pp AND gate
|
||||
self.out.connect(0, self.add_column_wire(column=0, bit=0))
|
||||
# Final addition of remaining bits
|
||||
# 1 bit multiplier case
|
||||
if self.N == 1:
|
||||
self.out.connect(1, ConstantWireValue0())
|
||||
# 2 bit multiplier case
|
||||
elif self.N == 2:
|
||||
obj_ha = HalfAdder(self.add_column_wire(column=1, bit=0), self.add_column_wire(column=1, bit=1), prefix=self.prefix+"_ha"+str(self.get_instance_num(cls=HalfAdder)))
|
||||
self.add_component(obj_ha)
|
||||
self.out.connect(1, obj_ha.get_sum_wire())
|
||||
|
||||
obj_ha = HalfAdder(self.get_previous_component().get_carry_wire(), self.add_column_wire(column=2, bit=0), prefix=self.prefix+"_ha"+str(self.get_instance_num(cls=HalfAdder)))
|
||||
self.add_component(obj_ha)
|
||||
self.out.connect(2, obj_ha.get_sum_wire())
|
||||
self.out.connect(3, obj_ha.get_carry_wire())
|
||||
# Final addition of remaining bits using chosen unsigned multi bit adder
|
||||
else:
|
||||
# Obtain proper adder name with its bit width (columns bit pairs minus the first alone bit)
|
||||
adder_prefix = self.prefix + "_" + unsigned_adder_class_name(a=a, b=b).prefix + str(len(self.columns)-1)
|
||||
|
||||
adder_a = Bus(prefix=f"{adder_prefix}_a", wires_list=[self.add_column_wire(column=col, bit=0) for col in range(1, len(self.columns))])
|
||||
adder_b = Bus(prefix=f"{adder_prefix}_b", wires_list=[self.add_column_wire(column=col, bit=1) for col in range(1, len(self.columns))])
|
||||
final_adder = unsigned_adder_class_name(a=adder_a, b=adder_b, prefix=adder_prefix)
|
||||
self.add_component(final_adder)
|
||||
|
||||
[self.out.connect(o, final_adder.out.get_wire(o-1), inserted_wire_desired_index=o-1) for o in range(1, len(self.out.bus))]
|
||||
|
||||
|
||||
class SignedDaddaMultiplier(MultiplierCircuit):
|
||||
"""Class representing signed dadda multiplier.
|
||||
|
||||
Signed dadda multiplier represents fast N-bit multiplier which utilizes
|
||||
the functionality of reduction algorithm proposed by Luigi Dadda and uses Baugh-Wooley algorithm
|
||||
to perform signed multiplication.
|
||||
|
||||
First partial products are calculated for each bit pair that form the partial product multiplication columns.
|
||||
At last the reduced pairs are inserted into chosen multi bit unsigned adder to execute their summation and obtain the final output bits,
|
||||
additional XOR gate serve the necessary sign extension.
|
||||
|
||||
Dadda algorithm is described more in detail here:
|
||||
https://en.wikipedia.org/wiki/Dadda_multiplier
|
||||
|
||||
It is composed of much less inner components (half/full adders, AND/NAND gates) as opposed
|
||||
to e.g. wallace and array multipliers.
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
prefix (str, optional): Prefix name of signed dadda multiplier. Defaults to "s_dadda_cla".
|
||||
unsigned_adder_class_name (str, optional): Unsigned multi bit adder used to obtain final sums of products. Defaults to UnsignedCarryLookaheadAdder.
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, prefix: str = "s_dadda_cla", unsigned_adder_class_name: str = UnsignedCarryLookaheadAdder):
|
||||
super().__init__()
|
||||
self.N = max(a.N, b.N)
|
||||
self.prefix = prefix
|
||||
self.a = Bus(prefix=a.prefix, wires_list=a.bus)
|
||||
self.b = Bus(prefix=b.prefix, wires_list=b.bus)
|
||||
|
||||
# Bus sign extension in case buses have different lengths
|
||||
self.a.bus_extend(N=self.N, prefix=a.prefix)
|
||||
self.b.bus_extend(N=self.N, prefix=b.prefix)
|
||||
|
||||
# Output wires for multiplication product
|
||||
self.out = Bus(self.prefix+"_out", self.N*2)
|
||||
|
||||
# Get starting stage and maximum possible column height
|
||||
self.stage, self.d = self.get_maximum_height(initial_value=min(self.a.N, self.b.N))
|
||||
# Initialize all columns partial products forming AND/NAND gates matrix based on Baugh-Wooley multiplication
|
||||
self.columns = self.init_column_heights(signed=True)
|
||||
|
||||
# Not used for 1 bit multiplier
|
||||
if self.N != 1:
|
||||
# Adding constant wire with value 1 to achieve signedness based on Baugh-Wooley multiplication algorithm
|
||||
# (adding constant value bit to last column (with one bit) to combine them in XOR gate to get the correct final multplication output bit at the end)
|
||||
self.columns[self.N].insert(1, ConstantWireValue1())
|
||||
self.update_column_heights(curr_column=self.N, curr_height_change=1)
|
||||
|
||||
# Perform reduction until stage 0
|
||||
for stage in range(self.stage, 0, -1):
|
||||
col = 0
|
||||
while col < len(self.columns):
|
||||
if self.get_column_height(col) == self.d + 1:
|
||||
# Add half adder and also AND/NAND gates if neccesarry (via add_column_wire invocation) into list of circuit components
|
||||
obj_adder = HalfAdder(self.add_column_wire(column=col, bit=0), self.add_column_wire(column=col, bit=1), prefix=self.prefix+"_ha"+str(self.get_instance_num(cls=HalfAdder)))
|
||||
self.add_component(obj_adder)
|
||||
|
||||
# Update the number of current and next column wires
|
||||
self.update_column_heights(curr_column=col, curr_height_change=-1, next_column=col+1, next_height_change=1)
|
||||
|
||||
# Update current and next column wires arrangement
|
||||
# add ha's generated sum to the bottom of current column
|
||||
# add ha's generated cout to the top of next column
|
||||
self.update_column_wires(curr_column=col, next_column=col+1, adder=self.get_previous_component(1))
|
||||
elif self.get_column_height(col) > self.d:
|
||||
# Add full adder and also AND/NAND gates if neccesarry (via add_column_wire invocation) into list of circuit components
|
||||
obj_adder = FullAdder(self.add_column_wire(column=col, bit=0), self.add_column_wire(column=col, bit=1), self.add_column_wire(column=col, bit=2), prefix=self.prefix+"_fa"+str(self.get_instance_num(cls=FullAdder)))
|
||||
self.add_component(obj_adder)
|
||||
|
||||
# Update the number of current and next column wires
|
||||
self.update_column_heights(curr_column=col, curr_height_change=-2, next_column=col+1, next_height_change=1)
|
||||
|
||||
# Update current and next column wires arrangement
|
||||
# add fa's generated sum to the bottom of current column
|
||||
# add fa's generated cout to the top of next column
|
||||
self.update_column_wires(curr_column=col, next_column=col+1, adder=self.get_previous_component(1))
|
||||
# Next iteration with same column in case there is need for further reduction
|
||||
col -= 1
|
||||
col += 1
|
||||
# Update maximum possible column height
|
||||
_, self.d = self.get_maximum_height(stage)
|
||||
|
||||
# Output generation
|
||||
# First output bit from single first pp AND gate
|
||||
self.out.connect(0, self.add_column_wire(column=0, bit=0))
|
||||
# Final addition of remaining bits
|
||||
# 1 bit multiplier case (no sign extension)
|
||||
if self.N == 1:
|
||||
self.out.connect(1, ConstantWireValue0())
|
||||
return
|
||||
# 2 bit multiplier case
|
||||
elif self.N == 2:
|
||||
obj_ha = HalfAdder(self.add_column_wire(column=1, bit=0), self.add_column_wire(column=1, bit=1), prefix=self.prefix+"_ha"+str(self.get_instance_num(cls=HalfAdder)))
|
||||
self.add_component(obj_ha)
|
||||
self.out.connect(1, obj_ha.get_sum_wire())
|
||||
|
||||
obj_fa = FullAdder(self.get_previous_component().get_carry_wire(), self.add_column_wire(column=2, bit=0), self.add_column_wire(column=2, bit=1), prefix=self.prefix+"_fa"+str(self.get_instance_num(cls=FullAdder)))
|
||||
self.add_component(obj_fa)
|
||||
self.out.connect(2, obj_fa.get_sum_wire())
|
||||
self.out.connect(3, obj_fa.get_carry_wire())
|
||||
|
||||
# Final addition of remaining bits using chosen unsigned multi bit adder
|
||||
else:
|
||||
# Obtain proper adder name with its bit width (columns bit pairs minus the first alone bit)
|
||||
adder_prefix = self.prefix + "_" + unsigned_adder_class_name(a=a, b=b).prefix + str(len(self.columns)-1)
|
||||
|
||||
adder_a = Bus(prefix=f"{adder_prefix}_a", wires_list=[self.add_column_wire(column=col, bit=0) for col in range(1, len(self.columns))])
|
||||
adder_b = Bus(prefix=f"{adder_prefix}_b", wires_list=[self.add_column_wire(column=col, bit=1) for col in range(1, len(self.columns))])
|
||||
final_adder = unsigned_adder_class_name(a=adder_a, b=adder_b, prefix=adder_prefix)
|
||||
self.add_component(final_adder)
|
||||
|
||||
[self.out.connect(o, final_adder.out.get_wire(o-1), inserted_wire_desired_index=o-1) for o in range(1, len(self.out.bus))]
|
||||
|
||||
# Final XOR to ensure proper sign extension
|
||||
obj_xor = XorGate(ConstantWireValue1(), self.out.get_wire(self.out.N-1), prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), parent_component=self)
|
||||
self.add_component(obj_xor)
|
||||
self.out.connect(self.out.N-1, obj_xor.out)</code></pre>
|
||||
</details>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="ariths_gen.multi_bit_circuits.multipliers.dadda_multiplier.SignedDaddaMultiplier"><code class="flex name class">
|
||||
<span>class <span class="ident">SignedDaddaMultiplier</span></span>
|
||||
<span>(</span><span>a: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, b: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, prefix: str = 's_dadda_cla', unsigned_adder_class_name: str = ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Class representing signed dadda multiplier.</p>
|
||||
<p>Signed dadda multiplier represents fast N-bit multiplier which utilizes
|
||||
the functionality of reduction algorithm proposed by Luigi Dadda and uses Baugh-Wooley algorithm
|
||||
to perform signed multiplication.</p>
|
||||
<p>First partial products are calculated for each bit pair that form the partial product multiplication columns.
|
||||
At last the reduced pairs are inserted into chosen multi bit unsigned adder to execute their summation and obtain the final output bits,
|
||||
additional XOR gate serve the necessary sign extension.</p>
|
||||
<p>Dadda algorithm is described more in detail here:
|
||||
<a href="https://en.wikipedia.org/wiki/Dadda_multiplier">https://en.wikipedia.org/wiki/Dadda_multiplier</a></p>
|
||||
<p>It is composed of much less inner components (half/full adders, AND/NAND gates) as opposed
|
||||
to e.g. wallace and array multipliers.</p>
|
||||
<p>Description of the <strong>init</strong> method.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>a</code></strong> : <code>Bus</code></dt>
|
||||
<dd>First input bus.</dd>
|
||||
<dt><strong><code>b</code></strong> : <code>Bus</code></dt>
|
||||
<dd>Second input bus.</dd>
|
||||
<dt><strong><code>prefix</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Prefix name of signed dadda multiplier. Defaults to "s_dadda_cla".</dd>
|
||||
<dt><strong><code>unsigned_adder_class_name</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Unsigned multi bit adder used to obtain final sums of products. Defaults to UnsignedCarryLookaheadAdder.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class SignedDaddaMultiplier(MultiplierCircuit):
|
||||
"""Class representing signed dadda multiplier.
|
||||
|
||||
Signed dadda multiplier represents fast N-bit multiplier which utilizes
|
||||
the functionality of reduction algorithm proposed by Luigi Dadda and uses Baugh-Wooley algorithm
|
||||
to perform signed multiplication.
|
||||
|
||||
First partial products are calculated for each bit pair that form the partial product multiplication columns.
|
||||
At last the reduced pairs are inserted into chosen multi bit unsigned adder to execute their summation and obtain the final output bits,
|
||||
additional XOR gate serve the necessary sign extension.
|
||||
|
||||
Dadda algorithm is described more in detail here:
|
||||
https://en.wikipedia.org/wiki/Dadda_multiplier
|
||||
|
||||
It is composed of much less inner components (half/full adders, AND/NAND gates) as opposed
|
||||
to e.g. wallace and array multipliers.
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
prefix (str, optional): Prefix name of signed dadda multiplier. Defaults to "s_dadda_cla".
|
||||
unsigned_adder_class_name (str, optional): Unsigned multi bit adder used to obtain final sums of products. Defaults to UnsignedCarryLookaheadAdder.
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, prefix: str = "s_dadda_cla", unsigned_adder_class_name: str = UnsignedCarryLookaheadAdder):
|
||||
super().__init__()
|
||||
self.N = max(a.N, b.N)
|
||||
self.prefix = prefix
|
||||
self.a = Bus(prefix=a.prefix, wires_list=a.bus)
|
||||
self.b = Bus(prefix=b.prefix, wires_list=b.bus)
|
||||
|
||||
# Bus sign extension in case buses have different lengths
|
||||
self.a.bus_extend(N=self.N, prefix=a.prefix)
|
||||
self.b.bus_extend(N=self.N, prefix=b.prefix)
|
||||
|
||||
# Output wires for multiplication product
|
||||
self.out = Bus(self.prefix+"_out", self.N*2)
|
||||
|
||||
# Get starting stage and maximum possible column height
|
||||
self.stage, self.d = self.get_maximum_height(initial_value=min(self.a.N, self.b.N))
|
||||
# Initialize all columns partial products forming AND/NAND gates matrix based on Baugh-Wooley multiplication
|
||||
self.columns = self.init_column_heights(signed=True)
|
||||
|
||||
# Not used for 1 bit multiplier
|
||||
if self.N != 1:
|
||||
# Adding constant wire with value 1 to achieve signedness based on Baugh-Wooley multiplication algorithm
|
||||
# (adding constant value bit to last column (with one bit) to combine them in XOR gate to get the correct final multplication output bit at the end)
|
||||
self.columns[self.N].insert(1, ConstantWireValue1())
|
||||
self.update_column_heights(curr_column=self.N, curr_height_change=1)
|
||||
|
||||
# Perform reduction until stage 0
|
||||
for stage in range(self.stage, 0, -1):
|
||||
col = 0
|
||||
while col < len(self.columns):
|
||||
if self.get_column_height(col) == self.d + 1:
|
||||
# Add half adder and also AND/NAND gates if neccesarry (via add_column_wire invocation) into list of circuit components
|
||||
obj_adder = HalfAdder(self.add_column_wire(column=col, bit=0), self.add_column_wire(column=col, bit=1), prefix=self.prefix+"_ha"+str(self.get_instance_num(cls=HalfAdder)))
|
||||
self.add_component(obj_adder)
|
||||
|
||||
# Update the number of current and next column wires
|
||||
self.update_column_heights(curr_column=col, curr_height_change=-1, next_column=col+1, next_height_change=1)
|
||||
|
||||
# Update current and next column wires arrangement
|
||||
# add ha's generated sum to the bottom of current column
|
||||
# add ha's generated cout to the top of next column
|
||||
self.update_column_wires(curr_column=col, next_column=col+1, adder=self.get_previous_component(1))
|
||||
elif self.get_column_height(col) > self.d:
|
||||
# Add full adder and also AND/NAND gates if neccesarry (via add_column_wire invocation) into list of circuit components
|
||||
obj_adder = FullAdder(self.add_column_wire(column=col, bit=0), self.add_column_wire(column=col, bit=1), self.add_column_wire(column=col, bit=2), prefix=self.prefix+"_fa"+str(self.get_instance_num(cls=FullAdder)))
|
||||
self.add_component(obj_adder)
|
||||
|
||||
# Update the number of current and next column wires
|
||||
self.update_column_heights(curr_column=col, curr_height_change=-2, next_column=col+1, next_height_change=1)
|
||||
|
||||
# Update current and next column wires arrangement
|
||||
# add fa's generated sum to the bottom of current column
|
||||
# add fa's generated cout to the top of next column
|
||||
self.update_column_wires(curr_column=col, next_column=col+1, adder=self.get_previous_component(1))
|
||||
# Next iteration with same column in case there is need for further reduction
|
||||
col -= 1
|
||||
col += 1
|
||||
# Update maximum possible column height
|
||||
_, self.d = self.get_maximum_height(stage)
|
||||
|
||||
# Output generation
|
||||
# First output bit from single first pp AND gate
|
||||
self.out.connect(0, self.add_column_wire(column=0, bit=0))
|
||||
# Final addition of remaining bits
|
||||
# 1 bit multiplier case (no sign extension)
|
||||
if self.N == 1:
|
||||
self.out.connect(1, ConstantWireValue0())
|
||||
return
|
||||
# 2 bit multiplier case
|
||||
elif self.N == 2:
|
||||
obj_ha = HalfAdder(self.add_column_wire(column=1, bit=0), self.add_column_wire(column=1, bit=1), prefix=self.prefix+"_ha"+str(self.get_instance_num(cls=HalfAdder)))
|
||||
self.add_component(obj_ha)
|
||||
self.out.connect(1, obj_ha.get_sum_wire())
|
||||
|
||||
obj_fa = FullAdder(self.get_previous_component().get_carry_wire(), self.add_column_wire(column=2, bit=0), self.add_column_wire(column=2, bit=1), prefix=self.prefix+"_fa"+str(self.get_instance_num(cls=FullAdder)))
|
||||
self.add_component(obj_fa)
|
||||
self.out.connect(2, obj_fa.get_sum_wire())
|
||||
self.out.connect(3, obj_fa.get_carry_wire())
|
||||
|
||||
# Final addition of remaining bits using chosen unsigned multi bit adder
|
||||
else:
|
||||
# Obtain proper adder name with its bit width (columns bit pairs minus the first alone bit)
|
||||
adder_prefix = self.prefix + "_" + unsigned_adder_class_name(a=a, b=b).prefix + str(len(self.columns)-1)
|
||||
|
||||
adder_a = Bus(prefix=f"{adder_prefix}_a", wires_list=[self.add_column_wire(column=col, bit=0) for col in range(1, len(self.columns))])
|
||||
adder_b = Bus(prefix=f"{adder_prefix}_b", wires_list=[self.add_column_wire(column=col, bit=1) for col in range(1, len(self.columns))])
|
||||
final_adder = unsigned_adder_class_name(a=adder_a, b=adder_b, prefix=adder_prefix)
|
||||
self.add_component(final_adder)
|
||||
|
||||
[self.out.connect(o, final_adder.out.get_wire(o-1), inserted_wire_desired_index=o-1) for o in range(1, len(self.out.bus))]
|
||||
|
||||
# Final XOR to ensure proper sign extension
|
||||
obj_xor = XorGate(ConstantWireValue1(), self.out.get_wire(self.out.N-1), prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), parent_component=self)
|
||||
self.add_component(obj_xor)
|
||||
self.out.connect(self.out.N-1, obj_xor.out)</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit">MultiplierCircuit</a></li>
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></li>
|
||||
</ul>
|
||||
<h3>Inherited members</h3>
|
||||
<ul class="hlist">
|
||||
<li><code><b><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit">MultiplierCircuit</a></b></code>:
|
||||
<ul class="hlist">
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wire" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wire">add_column_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wires" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wires">add_column_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component">add_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_blif_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_flat">get_blif_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_blif_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier">get_blif_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_c_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat">get_c_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_c_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier">get_c_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_carry_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire">get_carry_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_cgp_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat">get_cgp_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_cgp_wires" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires">get_cgp_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif">get_circuit_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c">get_circuit_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_gates" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates">get_circuit_gates</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v">get_circuit_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_wire_index" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index">get_circuit_wire_index</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_height" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_height">get_column_height</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_wire" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_wire">get_column_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_component_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types">get_component_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_blif">get_declaration_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_flat">get_declaration_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_hier">get_declaration_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_flat">get_declaration_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_hier">get_declaration_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declarations_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier">get_declarations_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declarations_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_v_hier">get_declarations_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blif_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blif_flat">get_function_blif_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_block_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_blif">get_function_block_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_block_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_c">get_function_block_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_block_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_v">get_function_block_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blocks_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif">get_function_blocks_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blocks_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c">get_function_blocks_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blocks_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v">get_function_blocks_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif">get_function_out_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat">get_function_out_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_hier">get_function_out_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat">get_function_out_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier">get_function_out_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_includes_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c">get_includes_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_flat">get_init_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier">get_init_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_flat">get_init_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier">get_init_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_instance_num" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num">get_instance_num</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_invocation_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocation_blif_hier">get_invocation_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_invocations_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocations_blif_hier">get_invocations_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_maximum_height" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_maximum_height">get_maximum_height</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_multi_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components">get_multi_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_one_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components">get_one_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_out_invocation_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_c">get_out_invocation_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_out_invocation_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_v">get_out_invocation_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_outputs_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp">get_outputs_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_parameters_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_parameters_cgp">get_parameters_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_previous_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component">get_previous_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_previous_partial_product" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_previous_partial_product">get_previous_partial_product</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_prototype_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif">get_prototype_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_prototype_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_c">get_prototype_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_prototype_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_v">get_prototype_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_sum_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire">get_sum_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_triplets_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp">get_triplets_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_unique_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types">get_unique_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_v_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_flat">get_v_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_v_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier">get_v_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.init_column_heights" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.init_column_heights">init_column_heights</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.save_wire_id" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id">save_wire_id</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_heights" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_heights">update_column_heights</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_wires" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_wires">update_column_wires</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dt id="ariths_gen.multi_bit_circuits.multipliers.dadda_multiplier.UnsignedDaddaMultiplier"><code class="flex name class">
|
||||
<span>class <span class="ident">UnsignedDaddaMultiplier</span></span>
|
||||
<span>(</span><span>a: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, b: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, prefix: str = 'u_dadda_cla', unsigned_adder_class_name: str = ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Class representing unsigned dadda multiplier.</p>
|
||||
<p>Unsigned dadda multiplier represents fast N-bit multiplier which utilizes
|
||||
the functionality of reduction algorithm proposed by Luigi Dadda.</p>
|
||||
<p>First partial products are calculated for each bit pair that form the partial product multiplication columns.
|
||||
At last the reduced pairs are inserted into chosen multi bit unsigned adder to execute their summation and obtain the final output bits.</p>
|
||||
<p>Dadda algorithm is described more in detail here:
|
||||
<a href="https://en.wikipedia.org/wiki/Dadda_multiplier">https://en.wikipedia.org/wiki/Dadda_multiplier</a></p>
|
||||
<p>It is composed of much less inner components (half/full adders, AND gates) as opposed
|
||||
to e.g. wallace and array multipliers.</p>
|
||||
<p>Description of the <strong>init</strong> method.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>a</code></strong> : <code>Bus</code></dt>
|
||||
<dd>First input bus.</dd>
|
||||
<dt><strong><code>b</code></strong> : <code>Bus</code></dt>
|
||||
<dd>Second input bus.</dd>
|
||||
<dt><strong><code>prefix</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Prefix name of unsigned dadda multiplier. Defaults to "u_dadda_cla".</dd>
|
||||
<dt><strong><code>unsigned_adder_class_name</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Unsigned multi bit adder used to obtain final sums of products. Defaults to UnsignedCarryLookaheadAdder.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class UnsignedDaddaMultiplier(MultiplierCircuit):
|
||||
"""Class representing unsigned dadda multiplier.
|
||||
|
||||
Unsigned dadda multiplier represents fast N-bit multiplier which utilizes
|
||||
the functionality of reduction algorithm proposed by Luigi Dadda.
|
||||
|
||||
First partial products are calculated for each bit pair that form the partial product multiplication columns.
|
||||
At last the reduced pairs are inserted into chosen multi bit unsigned adder to execute their summation and obtain the final output bits.
|
||||
|
||||
Dadda algorithm is described more in detail here:
|
||||
https://en.wikipedia.org/wiki/Dadda_multiplier
|
||||
|
||||
It is composed of much less inner components (half/full adders, AND gates) as opposed
|
||||
to e.g. wallace and array multipliers.
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
prefix (str, optional): Prefix name of unsigned dadda multiplier. Defaults to "u_dadda_cla".
|
||||
unsigned_adder_class_name (str, optional): Unsigned multi bit adder used to obtain final sums of products. Defaults to UnsignedCarryLookaheadAdder.
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, prefix: str = "u_dadda_cla", unsigned_adder_class_name: str = UnsignedCarryLookaheadAdder):
|
||||
super().__init__()
|
||||
self.N = max(a.N, b.N)
|
||||
self.prefix = prefix
|
||||
self.a = Bus(prefix=a.prefix, wires_list=a.bus)
|
||||
self.b = Bus(prefix=b.prefix, wires_list=b.bus)
|
||||
|
||||
# Bus sign extension in case buses have different lengths
|
||||
self.a.bus_extend(N=self.N, prefix=a.prefix)
|
||||
self.b.bus_extend(N=self.N, prefix=b.prefix)
|
||||
|
||||
# Output wires for multiplication product
|
||||
self.out = Bus(self.prefix+"_out", self.N*2)
|
||||
|
||||
# Get starting stage and maximum possible column height
|
||||
self.stage, self.d = self.get_maximum_height(initial_value=min(self.a.N, self.b.N))
|
||||
# Initialize all columns partial products forming AND gates matrix
|
||||
self.columns = self.init_column_heights()
|
||||
|
||||
# Perform reduction until stage 0
|
||||
for stage in range(self.stage, 0, -1):
|
||||
col = 0
|
||||
while col < len(self.columns):
|
||||
if self.get_column_height(col) == self.d + 1:
|
||||
# Add half adder and also AND gates if neccesarry (via add_column_wire invocation) into list of circuit components
|
||||
obj_adder = HalfAdder(self.add_column_wire(column=col, bit=0), self.add_column_wire(column=col, bit=1), prefix=self.prefix+"_ha"+str(self.get_instance_num(cls=HalfAdder)))
|
||||
self.add_component(obj_adder)
|
||||
|
||||
# Update the number of current and next column wires
|
||||
self.update_column_heights(curr_column=col, curr_height_change=-1, next_column=col+1, next_height_change=1)
|
||||
|
||||
# Update current and next column wires arrangement
|
||||
# add ha's generated sum to the bottom of current column
|
||||
# add ha's generated cout to the top of next column
|
||||
self.update_column_wires(curr_column=col, next_column=col+1, adder=self.get_previous_component(1))
|
||||
|
||||
elif self.get_column_height(col) > self.d:
|
||||
# Add full adder and also AND gates if neccesarry (via add_column_wire invocation) into list of circuit components
|
||||
obj_adder = FullAdder(self.add_column_wire(column=col, bit=0), self.add_column_wire(column=col, bit=1), self.add_column_wire(column=col, bit=2), prefix=self.prefix+"_fa"+str(self.get_instance_num(cls=FullAdder)))
|
||||
self.add_component(obj_adder)
|
||||
|
||||
# Update the number of current and next column wires
|
||||
self.update_column_heights(curr_column=col, curr_height_change=-2, next_column=col+1, next_height_change=1)
|
||||
|
||||
# Update current and next column wires arrangement
|
||||
# add fa's generated sum to the bottom of current column
|
||||
# add fa's generated cout to the top of next column
|
||||
self.update_column_wires(curr_column=col, next_column=col+1, adder=self.get_previous_component(1))
|
||||
|
||||
# Next iteration with same column in case there is need for further reduction
|
||||
col -= 1
|
||||
col += 1
|
||||
# Update maximum possible column height
|
||||
_, self.d = self.get_maximum_height(stage)
|
||||
|
||||
# Output generation
|
||||
# First output bit from single first pp AND gate
|
||||
self.out.connect(0, self.add_column_wire(column=0, bit=0))
|
||||
# Final addition of remaining bits
|
||||
# 1 bit multiplier case
|
||||
if self.N == 1:
|
||||
self.out.connect(1, ConstantWireValue0())
|
||||
# 2 bit multiplier case
|
||||
elif self.N == 2:
|
||||
obj_ha = HalfAdder(self.add_column_wire(column=1, bit=0), self.add_column_wire(column=1, bit=1), prefix=self.prefix+"_ha"+str(self.get_instance_num(cls=HalfAdder)))
|
||||
self.add_component(obj_ha)
|
||||
self.out.connect(1, obj_ha.get_sum_wire())
|
||||
|
||||
obj_ha = HalfAdder(self.get_previous_component().get_carry_wire(), self.add_column_wire(column=2, bit=0), prefix=self.prefix+"_ha"+str(self.get_instance_num(cls=HalfAdder)))
|
||||
self.add_component(obj_ha)
|
||||
self.out.connect(2, obj_ha.get_sum_wire())
|
||||
self.out.connect(3, obj_ha.get_carry_wire())
|
||||
# Final addition of remaining bits using chosen unsigned multi bit adder
|
||||
else:
|
||||
# Obtain proper adder name with its bit width (columns bit pairs minus the first alone bit)
|
||||
adder_prefix = self.prefix + "_" + unsigned_adder_class_name(a=a, b=b).prefix + str(len(self.columns)-1)
|
||||
|
||||
adder_a = Bus(prefix=f"{adder_prefix}_a", wires_list=[self.add_column_wire(column=col, bit=0) for col in range(1, len(self.columns))])
|
||||
adder_b = Bus(prefix=f"{adder_prefix}_b", wires_list=[self.add_column_wire(column=col, bit=1) for col in range(1, len(self.columns))])
|
||||
final_adder = unsigned_adder_class_name(a=adder_a, b=adder_b, prefix=adder_prefix)
|
||||
self.add_component(final_adder)
|
||||
|
||||
[self.out.connect(o, final_adder.out.get_wire(o-1), inserted_wire_desired_index=o-1) for o in range(1, len(self.out.bus))]</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit">MultiplierCircuit</a></li>
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></li>
|
||||
</ul>
|
||||
<h3>Inherited members</h3>
|
||||
<ul class="hlist">
|
||||
<li><code><b><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit">MultiplierCircuit</a></b></code>:
|
||||
<ul class="hlist">
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wire" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wire">add_column_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wires" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wires">add_column_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component">add_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_blif_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_flat">get_blif_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_blif_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier">get_blif_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_c_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat">get_c_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_c_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier">get_c_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_carry_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire">get_carry_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_cgp_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat">get_cgp_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_cgp_wires" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires">get_cgp_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif">get_circuit_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c">get_circuit_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_gates" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates">get_circuit_gates</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v">get_circuit_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_wire_index" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index">get_circuit_wire_index</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_height" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_height">get_column_height</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_wire" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_wire">get_column_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_component_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types">get_component_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_blif">get_declaration_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_flat">get_declaration_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_hier">get_declaration_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_flat">get_declaration_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_hier">get_declaration_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declarations_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier">get_declarations_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declarations_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_v_hier">get_declarations_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blif_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blif_flat">get_function_blif_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_block_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_blif">get_function_block_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_block_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_c">get_function_block_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_block_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_v">get_function_block_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blocks_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif">get_function_blocks_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blocks_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c">get_function_blocks_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blocks_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v">get_function_blocks_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif">get_function_out_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat">get_function_out_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_hier">get_function_out_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat">get_function_out_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier">get_function_out_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_includes_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c">get_includes_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_flat">get_init_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier">get_init_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_flat">get_init_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier">get_init_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_instance_num" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num">get_instance_num</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_invocation_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocation_blif_hier">get_invocation_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_invocations_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocations_blif_hier">get_invocations_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_maximum_height" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_maximum_height">get_maximum_height</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_multi_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components">get_multi_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_one_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components">get_one_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_out_invocation_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_c">get_out_invocation_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_out_invocation_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_v">get_out_invocation_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_outputs_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp">get_outputs_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_parameters_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_parameters_cgp">get_parameters_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_previous_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component">get_previous_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_previous_partial_product" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_previous_partial_product">get_previous_partial_product</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_prototype_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif">get_prototype_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_prototype_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_c">get_prototype_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_prototype_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_v">get_prototype_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_sum_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire">get_sum_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_triplets_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp">get_triplets_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_unique_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types">get_unique_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_v_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_flat">get_v_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_v_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier">get_v_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.init_column_heights" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.init_column_heights">init_column_heights</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.save_wire_id" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id">save_wire_id</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_heights" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_heights">update_column_heights</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_wires" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_wires">update_column_wires</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.multipliers" href="index.html">ariths_gen.multi_bit_circuits.multipliers</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="ariths_gen.multi_bit_circuits.multipliers.dadda_multiplier.SignedDaddaMultiplier" href="#ariths_gen.multi_bit_circuits.multipliers.dadda_multiplier.SignedDaddaMultiplier">SignedDaddaMultiplier</a></code></h4>
|
||||
</li>
|
||||
<li>
|
||||
<h4><code><a title="ariths_gen.multi_bit_circuits.multipliers.dadda_multiplier.UnsignedDaddaMultiplier" href="#ariths_gen.multi_bit_circuits.multipliers.dadda_multiplier.UnsignedDaddaMultiplier">UnsignedDaddaMultiplier</a></code></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
94
ariths_gen/multi_bit_circuits/multipliers/index.html
Normal file
94
ariths_gen/multi_bit_circuits/multipliers/index.html
Normal file
@ -0,0 +1,94 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen.multi_bit_circuits.multipliers API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>ariths_gen.multi_bit_circuits.multipliers</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">from ariths_gen.multi_bit_circuits.multipliers.array_multiplier import (
|
||||
UnsignedArrayMultiplier,
|
||||
SignedArrayMultiplier
|
||||
)
|
||||
|
||||
from ariths_gen.multi_bit_circuits.multipliers.wallace_multiplier import (
|
||||
UnsignedWallaceMultiplier,
|
||||
SignedWallaceMultiplier
|
||||
)
|
||||
|
||||
from ariths_gen.multi_bit_circuits.multipliers.dadda_multiplier import (
|
||||
UnsignedDaddaMultiplier,
|
||||
SignedDaddaMultiplier
|
||||
)</code></pre>
|
||||
</details>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
|
||||
<dl>
|
||||
<dt><code class="name"><a title="ariths_gen.multi_bit_circuits.multipliers.array_multiplier" href="array_multiplier.html">ariths_gen.multi_bit_circuits.multipliers.array_multiplier</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="ariths_gen.multi_bit_circuits.multipliers.dadda_multiplier" href="dadda_multiplier.html">ariths_gen.multi_bit_circuits.multipliers.dadda_multiplier</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="ariths_gen.multi_bit_circuits.multipliers.wallace_multiplier" href="wallace_multiplier.html">ariths_gen.multi_bit_circuits.multipliers.wallace_multiplier</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits" href="../index.html">ariths_gen.multi_bit_circuits</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.multipliers.array_multiplier" href="array_multiplier.html">ariths_gen.multi_bit_circuits.multipliers.array_multiplier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.multipliers.dadda_multiplier" href="dadda_multiplier.html">ariths_gen.multi_bit_circuits.multipliers.dadda_multiplier</a></code></li>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.multipliers.wallace_multiplier" href="wallace_multiplier.html">ariths_gen.multi_bit_circuits.multipliers.wallace_multiplier</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,752 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen.multi_bit_circuits.multipliers.wallace_multiplier API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>ariths_gen.multi_bit_circuits.multipliers.wallace_multiplier</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">from ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder import UnsignedCarryLookaheadAdder
|
||||
from ariths_gen.wire_components import (
|
||||
Wire,
|
||||
ConstantWireValue0,
|
||||
ConstantWireValue1,
|
||||
Bus
|
||||
)
|
||||
from ariths_gen.core.arithmetic_circuits import (
|
||||
ArithmeticCircuit,
|
||||
MultiplierCircuit
|
||||
)
|
||||
from ariths_gen.one_bit_circuits.one_bit_components import (
|
||||
HalfAdder,
|
||||
FullAdder,
|
||||
FullAdderPG
|
||||
)
|
||||
from ariths_gen.one_bit_circuits.logic_gates import (
|
||||
AndGate,
|
||||
NandGate,
|
||||
OrGate,
|
||||
NorGate,
|
||||
XorGate,
|
||||
XnorGate,
|
||||
NotGate
|
||||
)
|
||||
|
||||
|
||||
class UnsignedWallaceMultiplier(MultiplierCircuit):
|
||||
"""Class representing unsigned wallace multiplier.
|
||||
|
||||
Unsigned wallace multiplier represents fast N-bit multiplier which utilizes
|
||||
the functionality of wallace tree reduction algorithm proposed by Chris Wallace.
|
||||
|
||||
First partial products are calculated for each bit pair that form the partial product multiplication columns.
|
||||
At last the reduced pairs are inserted into chosen multi bit unsigned adder to execute their summation and obtain the final output bits.
|
||||
|
||||
Wallace tree algorithm is described more in detail here:
|
||||
https://en.wikipedia.org/wiki/Wallace_tree
|
||||
|
||||
It presents smaller circuit in area opposed to array multiplier but is slightly bigger then dadda because of less reduction stages.
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
prefix (str, optional): Prefix name of unsigned wallace multiplier. Defaults to "u_wallace_cla".
|
||||
unsigned_adder_class_name (str, optional): Unsigned multi bit adder used to obtain final sums of products. Defaults to UnsignedCarryLookaheadAdder.
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, prefix: str = "u_wallace_cla", unsigned_adder_class_name: str = UnsignedCarryLookaheadAdder):
|
||||
super().__init__()
|
||||
self.N = max(a.N, b.N)
|
||||
self.prefix = prefix
|
||||
self.a = Bus(prefix=a.prefix, wires_list=a.bus)
|
||||
self.b = Bus(prefix=b.prefix, wires_list=b.bus)
|
||||
|
||||
# Bus sign extension in case buses have different lengths
|
||||
self.a.bus_extend(N=self.N, prefix=a.prefix)
|
||||
self.b.bus_extend(N=self.N, prefix=b.prefix)
|
||||
|
||||
# Output wires for multiplication product
|
||||
self.out = Bus(self.prefix+"_out", self.N*2)
|
||||
|
||||
# Initialize all columns partial products forming AND gates matrix
|
||||
self.columns = self.init_column_heights()
|
||||
|
||||
# Perform reduction until all columns have 2 or less bits in them
|
||||
while not all(height <= 2 for (height, *_) in self.columns):
|
||||
col = 0
|
||||
while col < len(self.columns):
|
||||
# If column has exactly 3 bits in height and all previous columns has maximum of 2 bits in height, combine them in a half adder
|
||||
if self.get_column_height(col) == 3 and all(height <= 2 for (height, *_) in self.columns[0:col-1]):
|
||||
# Add half adder and also AND gates if neccesarry (via add_column_wire invocation) into list of circuit components
|
||||
obj_adder = HalfAdder(self.add_column_wire(column=col, bit=0), self.add_column_wire(column=col, bit=1), prefix=self.prefix+"_ha"+str(self.get_instance_num(cls=HalfAdder)))
|
||||
self.add_component(obj_adder)
|
||||
|
||||
# Update the number of current and next column wires
|
||||
self.update_column_heights(curr_column=col, curr_height_change=-1, next_column=col+1, next_height_change=1)
|
||||
|
||||
# Update current and next column wires arrangement
|
||||
# add ha's generated sum to the bottom of current column
|
||||
# add ha's generated cout to the top of next column
|
||||
self.update_column_wires(curr_column=col, next_column=col+1, adder=self.get_previous_component(1))
|
||||
|
||||
# If column has more than 3 bits in height, combine them in a full adder
|
||||
elif self.get_column_height(col) > 3:
|
||||
# Add full adder and also AND gates if neccesarry (via add_column_wire invocation) into list of circuit components
|
||||
obj_adder = FullAdder(self.add_column_wire(column=col, bit=0), self.add_column_wire(column=col, bit=1), self.add_column_wire(column=col, bit=2), prefix=self.prefix+"_fa"+str(self.get_instance_num(cls=FullAdder)))
|
||||
self.add_component(obj_adder)
|
||||
|
||||
# Update the number of current and next column wires
|
||||
self.update_column_heights(curr_column=col, curr_height_change=-2, next_column=col+1, next_height_change=1)
|
||||
|
||||
# Update current and next column wires arrangement
|
||||
# add fa's generated sum to the bottom of current column
|
||||
# add fa's generated cout to the top of next column
|
||||
self.update_column_wires(curr_column=col, next_column=col+1, adder=self.get_previous_component(1))
|
||||
col += 1
|
||||
|
||||
# Output generation
|
||||
# First output bit from single first pp AND gate
|
||||
self.out.connect(0, self.add_column_wire(column=0, bit=0))
|
||||
# Final addition of remaining bits
|
||||
# 1 bit multiplier case
|
||||
if self.N == 1:
|
||||
self.out.connect(1, ConstantWireValue0())
|
||||
# 2 bit multiplier case
|
||||
elif self.N == 2:
|
||||
obj_ha = HalfAdder(self.add_column_wire(column=1, bit=0), self.add_column_wire(column=1, bit=1), prefix=self.prefix+"_ha"+str(self.get_instance_num(cls=HalfAdder)))
|
||||
self.add_component(obj_ha)
|
||||
self.out.connect(1, obj_ha.get_sum_wire())
|
||||
|
||||
obj_ha = HalfAdder(self.get_previous_component().get_carry_wire(), self.add_column_wire(column=2, bit=0), prefix=self.prefix+"_ha"+str(self.get_instance_num(cls=HalfAdder)))
|
||||
self.add_component(obj_ha)
|
||||
self.out.connect(2, obj_ha.get_sum_wire())
|
||||
self.out.connect(3, obj_ha.get_carry_wire())
|
||||
# Final addition of remaining bits using chosen unsigned multi bit adder
|
||||
else:
|
||||
# Obtain proper adder name with its bit width (columns bit pairs minus the first alone bit)
|
||||
adder_prefix = self.prefix + "_" + unsigned_adder_class_name(a=a, b=b).prefix + str(len(self.columns)-1)
|
||||
|
||||
adder_a = Bus(prefix=f"{adder_prefix}_a", wires_list=[self.add_column_wire(column=col, bit=0) for col in range(1, len(self.columns))])
|
||||
adder_b = Bus(prefix=f"{adder_prefix}_b", wires_list=[self.add_column_wire(column=col, bit=1) for col in range(1, len(self.columns))])
|
||||
final_adder = unsigned_adder_class_name(a=adder_a, b=adder_b, prefix=adder_prefix)
|
||||
self.add_component(final_adder)
|
||||
|
||||
[self.out.connect(o, final_adder.out.get_wire(o-1), inserted_wire_desired_index=o-1) for o in range(1, len(self.out.bus))]
|
||||
|
||||
|
||||
class SignedWallaceMultiplier(MultiplierCircuit):
|
||||
"""Class representing signed wallace multiplier.
|
||||
|
||||
Signed wallace multiplier represents fast N-bit multiplier which utilizes
|
||||
the functionality of wallace tree reduction algorithm proposed by Chris Wallace and uses Baugh-Wooley algorithm
|
||||
to perform signed multiplication.
|
||||
|
||||
First partial products are calculated for each bit pair that form the partial product multiplication columns.
|
||||
At last the reduced pairs are inserted into chosen multi bit unsigned adder to execute their summation and obtain the final output bits,
|
||||
additional XOR gate serve the necessary sign extension.
|
||||
|
||||
Wallace tree algorithm is described more in detail here:
|
||||
https://en.wikipedia.org/wiki/Wallace_tree
|
||||
|
||||
It presents smaller circuit in area opposed to array multiplier but is slightly bigger then dadda because of less reduction stages.
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
prefix (str, optional): Prefix name of signed wallace multiplier. Defaults to "s_wallace_cla".
|
||||
unsigned_adder_class_name (str, optional): Unsigned multi bit adder used to obtain final sums of products. Defaults to UnsignedCarryLookaheadAdder.
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, prefix: str = "s_wallace_cla", unsigned_adder_class_name: str = UnsignedCarryLookaheadAdder):
|
||||
super().__init__()
|
||||
self.N = max(a.N, b.N)
|
||||
self.prefix = prefix
|
||||
self.a = Bus(prefix=a.prefix, wires_list=a.bus)
|
||||
self.b = Bus(prefix=b.prefix, wires_list=b.bus)
|
||||
|
||||
# Bus sign extension in case buses have different lengths
|
||||
self.a.bus_extend(N=self.N, prefix=a.prefix)
|
||||
self.b.bus_extend(N=self.N, prefix=b.prefix)
|
||||
|
||||
# Output wires for multiplication product
|
||||
self.out = Bus(self.prefix+"_out", self.N*2)
|
||||
|
||||
# Initialize all columns partial products forming AND/NAND gates matrix based on Baugh-Wooley multiplication
|
||||
self.columns = self.init_column_heights(signed=True)
|
||||
|
||||
# Not used for 1 bit multiplier
|
||||
if self.N != 1:
|
||||
# Adding constant wire with value 1 to achieve signedness based on Baugh-Wooley multiplication algorithm
|
||||
# (adding constant value bit to last column (with one bit) to combine them in XOR gate to get the correct final multplication output bit at the end)
|
||||
self.columns[self.N].insert(1, ConstantWireValue1())
|
||||
self.update_column_heights(curr_column=self.N, curr_height_change=1)
|
||||
|
||||
# Perform reduction until all columns have 2 or less bits in them
|
||||
while not all(height <= 2 for (height, *_) in self.columns):
|
||||
col = 0
|
||||
while col < len(self.columns):
|
||||
# If column has exactly 3 bits in height and all previous columns has maximum of 2 bits in height, combine them in a half adder
|
||||
if self.get_column_height(col) == 3 and all(height <= 2 for (height, *_) in self.columns[0:col-1]):
|
||||
# Add half adder and also AND/NAND gates if neccesarry (via add_column_wire invocation) into list of circuit components
|
||||
obj_adder = HalfAdder(self.add_column_wire(column=col, bit=0), self.add_column_wire(column=col, bit=1), prefix=self.prefix+"_ha"+str(self.get_instance_num(cls=HalfAdder)))
|
||||
self.add_component(obj_adder)
|
||||
|
||||
# Update the number of current and next column wires
|
||||
self.update_column_heights(curr_column=col, curr_height_change=-1, next_column=col+1, next_height_change=1)
|
||||
|
||||
# Update current and next column wires arrangement
|
||||
# add ha's generated sum to the bottom of current column
|
||||
# add ha's generated cout to the top of next column
|
||||
self.update_column_wires(curr_column=col, next_column=col+1, adder=self.get_previous_component(1))
|
||||
|
||||
# If column has more than 3 bits in height, combine them in a full adder
|
||||
elif self.get_column_height(col) > 3:
|
||||
# Add full adder and also AND/NAND gates if neccesarry (via add_column_wire invocation) into list of circuit components
|
||||
obj_adder = FullAdder(self.add_column_wire(column=col, bit=0), self.add_column_wire(column=col, bit=1), self.add_column_wire(column=col, bit=2), prefix=self.prefix+"_fa"+str(self.get_instance_num(cls=FullAdder)))
|
||||
self.add_component(obj_adder)
|
||||
|
||||
# Update the number of current and next column wires
|
||||
self.update_column_heights(curr_column=col, curr_height_change=-2, next_column=col+1, next_height_change=1)
|
||||
|
||||
# Update current and next column wires arrangement
|
||||
# add fa's generated sum to the bottom of current column
|
||||
# add fa's generated cout to the top of next column
|
||||
self.update_column_wires(curr_column=col, next_column=col+1, adder=self.get_previous_component(1))
|
||||
col += 1
|
||||
|
||||
# Output generation
|
||||
# First output bit from single first pp AND gate
|
||||
self.out.connect(0, self.add_column_wire(column=0, bit=0))
|
||||
# Final addition of remaining bits
|
||||
# 1 bit multiplier case
|
||||
if self.N == 1:
|
||||
self.out.connect(1, ConstantWireValue0())
|
||||
return
|
||||
# 2 bit multiplier case
|
||||
elif self.N == 2:
|
||||
obj_ha = HalfAdder(self.add_column_wire(column=1, bit=0), self.add_column_wire(column=1, bit=1), prefix=self.prefix+"_ha"+str(self.get_instance_num(cls=HalfAdder)))
|
||||
self.add_component(obj_ha)
|
||||
self.out.connect(1, obj_ha.get_sum_wire())
|
||||
|
||||
obj_fa = FullAdder(self.get_previous_component().get_carry_wire(), self.add_column_wire(column=2, bit=0), self.add_column_wire(column=2, bit=1), prefix=self.prefix+"_fa"+str(self.get_instance_num(cls=FullAdder)))
|
||||
self.add_component(obj_fa)
|
||||
self.out.connect(2, obj_fa.get_sum_wire())
|
||||
self.out.connect(3, obj_fa.get_carry_wire())
|
||||
|
||||
# Final addition of remaining bits using chosen unsigned multi bit adder
|
||||
else:
|
||||
# Obtain proper adder name with its bit width (columns bit pairs minus the first alone bit)
|
||||
adder_prefix = self.prefix + "_" + unsigned_adder_class_name(a=a, b=b).prefix + str(len(self.columns)-1)
|
||||
|
||||
adder_a = Bus(prefix=f"{adder_prefix}_a", wires_list=[self.add_column_wire(column=col, bit=0) for col in range(1, len(self.columns))])
|
||||
adder_b = Bus(prefix=f"{adder_prefix}_b", wires_list=[self.add_column_wire(column=col, bit=1) for col in range(1, len(self.columns))])
|
||||
final_adder = unsigned_adder_class_name(a=adder_a, b=adder_b, prefix=adder_prefix)
|
||||
self.add_component(final_adder)
|
||||
|
||||
[self.out.connect(o, final_adder.out.get_wire(o-1), inserted_wire_desired_index=o-1) for o in range(1, len(self.out.bus))]
|
||||
|
||||
# Final XOR to ensure proper sign extension
|
||||
obj_xor = XorGate(ConstantWireValue1(), self.out.get_wire(self.out.N-1), prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), parent_component=self)
|
||||
self.add_component(obj_xor)
|
||||
self.out.connect(self.out.N-1, obj_xor.out)</code></pre>
|
||||
</details>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="ariths_gen.multi_bit_circuits.multipliers.wallace_multiplier.SignedWallaceMultiplier"><code class="flex name class">
|
||||
<span>class <span class="ident">SignedWallaceMultiplier</span></span>
|
||||
<span>(</span><span>a: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, b: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, prefix: str = 's_wallace_cla', unsigned_adder_class_name: str = ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Class representing signed wallace multiplier.</p>
|
||||
<p>Signed wallace multiplier represents fast N-bit multiplier which utilizes
|
||||
the functionality of wallace tree reduction algorithm proposed by Chris Wallace and uses Baugh-Wooley algorithm
|
||||
to perform signed multiplication.</p>
|
||||
<p>First partial products are calculated for each bit pair that form the partial product multiplication columns.
|
||||
At last the reduced pairs are inserted into chosen multi bit unsigned adder to execute their summation and obtain the final output bits,
|
||||
additional XOR gate serve the necessary sign extension.</p>
|
||||
<p>Wallace tree algorithm is described more in detail here:
|
||||
<a href="https://en.wikipedia.org/wiki/Wallace_tree">https://en.wikipedia.org/wiki/Wallace_tree</a></p>
|
||||
<p>It presents smaller circuit in area opposed to array multiplier but is slightly bigger then dadda because of less reduction stages.</p>
|
||||
<p>Description of the <strong>init</strong> method.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>a</code></strong> : <code>Bus</code></dt>
|
||||
<dd>First input bus.</dd>
|
||||
<dt><strong><code>b</code></strong> : <code>Bus</code></dt>
|
||||
<dd>Second input bus.</dd>
|
||||
<dt><strong><code>prefix</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Prefix name of signed wallace multiplier. Defaults to "s_wallace_cla".</dd>
|
||||
<dt><strong><code>unsigned_adder_class_name</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Unsigned multi bit adder used to obtain final sums of products. Defaults to UnsignedCarryLookaheadAdder.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class SignedWallaceMultiplier(MultiplierCircuit):
|
||||
"""Class representing signed wallace multiplier.
|
||||
|
||||
Signed wallace multiplier represents fast N-bit multiplier which utilizes
|
||||
the functionality of wallace tree reduction algorithm proposed by Chris Wallace and uses Baugh-Wooley algorithm
|
||||
to perform signed multiplication.
|
||||
|
||||
First partial products are calculated for each bit pair that form the partial product multiplication columns.
|
||||
At last the reduced pairs are inserted into chosen multi bit unsigned adder to execute their summation and obtain the final output bits,
|
||||
additional XOR gate serve the necessary sign extension.
|
||||
|
||||
Wallace tree algorithm is described more in detail here:
|
||||
https://en.wikipedia.org/wiki/Wallace_tree
|
||||
|
||||
It presents smaller circuit in area opposed to array multiplier but is slightly bigger then dadda because of less reduction stages.
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
prefix (str, optional): Prefix name of signed wallace multiplier. Defaults to "s_wallace_cla".
|
||||
unsigned_adder_class_name (str, optional): Unsigned multi bit adder used to obtain final sums of products. Defaults to UnsignedCarryLookaheadAdder.
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, prefix: str = "s_wallace_cla", unsigned_adder_class_name: str = UnsignedCarryLookaheadAdder):
|
||||
super().__init__()
|
||||
self.N = max(a.N, b.N)
|
||||
self.prefix = prefix
|
||||
self.a = Bus(prefix=a.prefix, wires_list=a.bus)
|
||||
self.b = Bus(prefix=b.prefix, wires_list=b.bus)
|
||||
|
||||
# Bus sign extension in case buses have different lengths
|
||||
self.a.bus_extend(N=self.N, prefix=a.prefix)
|
||||
self.b.bus_extend(N=self.N, prefix=b.prefix)
|
||||
|
||||
# Output wires for multiplication product
|
||||
self.out = Bus(self.prefix+"_out", self.N*2)
|
||||
|
||||
# Initialize all columns partial products forming AND/NAND gates matrix based on Baugh-Wooley multiplication
|
||||
self.columns = self.init_column_heights(signed=True)
|
||||
|
||||
# Not used for 1 bit multiplier
|
||||
if self.N != 1:
|
||||
# Adding constant wire with value 1 to achieve signedness based on Baugh-Wooley multiplication algorithm
|
||||
# (adding constant value bit to last column (with one bit) to combine them in XOR gate to get the correct final multplication output bit at the end)
|
||||
self.columns[self.N].insert(1, ConstantWireValue1())
|
||||
self.update_column_heights(curr_column=self.N, curr_height_change=1)
|
||||
|
||||
# Perform reduction until all columns have 2 or less bits in them
|
||||
while not all(height <= 2 for (height, *_) in self.columns):
|
||||
col = 0
|
||||
while col < len(self.columns):
|
||||
# If column has exactly 3 bits in height and all previous columns has maximum of 2 bits in height, combine them in a half adder
|
||||
if self.get_column_height(col) == 3 and all(height <= 2 for (height, *_) in self.columns[0:col-1]):
|
||||
# Add half adder and also AND/NAND gates if neccesarry (via add_column_wire invocation) into list of circuit components
|
||||
obj_adder = HalfAdder(self.add_column_wire(column=col, bit=0), self.add_column_wire(column=col, bit=1), prefix=self.prefix+"_ha"+str(self.get_instance_num(cls=HalfAdder)))
|
||||
self.add_component(obj_adder)
|
||||
|
||||
# Update the number of current and next column wires
|
||||
self.update_column_heights(curr_column=col, curr_height_change=-1, next_column=col+1, next_height_change=1)
|
||||
|
||||
# Update current and next column wires arrangement
|
||||
# add ha's generated sum to the bottom of current column
|
||||
# add ha's generated cout to the top of next column
|
||||
self.update_column_wires(curr_column=col, next_column=col+1, adder=self.get_previous_component(1))
|
||||
|
||||
# If column has more than 3 bits in height, combine them in a full adder
|
||||
elif self.get_column_height(col) > 3:
|
||||
# Add full adder and also AND/NAND gates if neccesarry (via add_column_wire invocation) into list of circuit components
|
||||
obj_adder = FullAdder(self.add_column_wire(column=col, bit=0), self.add_column_wire(column=col, bit=1), self.add_column_wire(column=col, bit=2), prefix=self.prefix+"_fa"+str(self.get_instance_num(cls=FullAdder)))
|
||||
self.add_component(obj_adder)
|
||||
|
||||
# Update the number of current and next column wires
|
||||
self.update_column_heights(curr_column=col, curr_height_change=-2, next_column=col+1, next_height_change=1)
|
||||
|
||||
# Update current and next column wires arrangement
|
||||
# add fa's generated sum to the bottom of current column
|
||||
# add fa's generated cout to the top of next column
|
||||
self.update_column_wires(curr_column=col, next_column=col+1, adder=self.get_previous_component(1))
|
||||
col += 1
|
||||
|
||||
# Output generation
|
||||
# First output bit from single first pp AND gate
|
||||
self.out.connect(0, self.add_column_wire(column=0, bit=0))
|
||||
# Final addition of remaining bits
|
||||
# 1 bit multiplier case
|
||||
if self.N == 1:
|
||||
self.out.connect(1, ConstantWireValue0())
|
||||
return
|
||||
# 2 bit multiplier case
|
||||
elif self.N == 2:
|
||||
obj_ha = HalfAdder(self.add_column_wire(column=1, bit=0), self.add_column_wire(column=1, bit=1), prefix=self.prefix+"_ha"+str(self.get_instance_num(cls=HalfAdder)))
|
||||
self.add_component(obj_ha)
|
||||
self.out.connect(1, obj_ha.get_sum_wire())
|
||||
|
||||
obj_fa = FullAdder(self.get_previous_component().get_carry_wire(), self.add_column_wire(column=2, bit=0), self.add_column_wire(column=2, bit=1), prefix=self.prefix+"_fa"+str(self.get_instance_num(cls=FullAdder)))
|
||||
self.add_component(obj_fa)
|
||||
self.out.connect(2, obj_fa.get_sum_wire())
|
||||
self.out.connect(3, obj_fa.get_carry_wire())
|
||||
|
||||
# Final addition of remaining bits using chosen unsigned multi bit adder
|
||||
else:
|
||||
# Obtain proper adder name with its bit width (columns bit pairs minus the first alone bit)
|
||||
adder_prefix = self.prefix + "_" + unsigned_adder_class_name(a=a, b=b).prefix + str(len(self.columns)-1)
|
||||
|
||||
adder_a = Bus(prefix=f"{adder_prefix}_a", wires_list=[self.add_column_wire(column=col, bit=0) for col in range(1, len(self.columns))])
|
||||
adder_b = Bus(prefix=f"{adder_prefix}_b", wires_list=[self.add_column_wire(column=col, bit=1) for col in range(1, len(self.columns))])
|
||||
final_adder = unsigned_adder_class_name(a=adder_a, b=adder_b, prefix=adder_prefix)
|
||||
self.add_component(final_adder)
|
||||
|
||||
[self.out.connect(o, final_adder.out.get_wire(o-1), inserted_wire_desired_index=o-1) for o in range(1, len(self.out.bus))]
|
||||
|
||||
# Final XOR to ensure proper sign extension
|
||||
obj_xor = XorGate(ConstantWireValue1(), self.out.get_wire(self.out.N-1), prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), parent_component=self)
|
||||
self.add_component(obj_xor)
|
||||
self.out.connect(self.out.N-1, obj_xor.out)</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit">MultiplierCircuit</a></li>
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></li>
|
||||
</ul>
|
||||
<h3>Inherited members</h3>
|
||||
<ul class="hlist">
|
||||
<li><code><b><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit">MultiplierCircuit</a></b></code>:
|
||||
<ul class="hlist">
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wire" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wire">add_column_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wires" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wires">add_column_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component">add_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_blif_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_flat">get_blif_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_blif_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier">get_blif_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_c_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat">get_c_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_c_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier">get_c_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_carry_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire">get_carry_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_cgp_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat">get_cgp_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_cgp_wires" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires">get_cgp_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif">get_circuit_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c">get_circuit_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_gates" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates">get_circuit_gates</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v">get_circuit_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_wire_index" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index">get_circuit_wire_index</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_height" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_height">get_column_height</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_wire" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_wire">get_column_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_component_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types">get_component_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_blif">get_declaration_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_flat">get_declaration_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_hier">get_declaration_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_flat">get_declaration_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_hier">get_declaration_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declarations_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier">get_declarations_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declarations_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_v_hier">get_declarations_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blif_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blif_flat">get_function_blif_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_block_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_blif">get_function_block_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_block_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_c">get_function_block_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_block_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_v">get_function_block_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blocks_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif">get_function_blocks_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blocks_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c">get_function_blocks_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blocks_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v">get_function_blocks_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif">get_function_out_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat">get_function_out_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_hier">get_function_out_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat">get_function_out_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier">get_function_out_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_includes_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c">get_includes_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_flat">get_init_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier">get_init_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_flat">get_init_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier">get_init_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_instance_num" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num">get_instance_num</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_invocation_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocation_blif_hier">get_invocation_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_invocations_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocations_blif_hier">get_invocations_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_maximum_height" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_maximum_height">get_maximum_height</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_multi_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components">get_multi_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_one_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components">get_one_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_out_invocation_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_c">get_out_invocation_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_out_invocation_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_v">get_out_invocation_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_outputs_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp">get_outputs_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_parameters_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_parameters_cgp">get_parameters_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_previous_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component">get_previous_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_previous_partial_product" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_previous_partial_product">get_previous_partial_product</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_prototype_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif">get_prototype_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_prototype_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_c">get_prototype_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_prototype_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_v">get_prototype_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_sum_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire">get_sum_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_triplets_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp">get_triplets_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_unique_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types">get_unique_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_v_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_flat">get_v_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_v_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier">get_v_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.init_column_heights" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.init_column_heights">init_column_heights</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.save_wire_id" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id">save_wire_id</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_heights" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_heights">update_column_heights</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_wires" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_wires">update_column_wires</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dt id="ariths_gen.multi_bit_circuits.multipliers.wallace_multiplier.UnsignedWallaceMultiplier"><code class="flex name class">
|
||||
<span>class <span class="ident">UnsignedWallaceMultiplier</span></span>
|
||||
<span>(</span><span>a: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, b: <a title="ariths_gen.wire_components.buses.Bus" href="../../wire_components/buses.html#ariths_gen.wire_components.buses.Bus">Bus</a>, prefix: str = 'u_wallace_cla', unsigned_adder_class_name: str = ariths_gen.multi_bit_circuits.adders.carry_lookahead_adder.UnsignedCarryLookaheadAdder)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Class representing unsigned wallace multiplier.</p>
|
||||
<p>Unsigned wallace multiplier represents fast N-bit multiplier which utilizes
|
||||
the functionality of wallace tree reduction algorithm proposed by Chris Wallace.</p>
|
||||
<p>First partial products are calculated for each bit pair that form the partial product multiplication columns.
|
||||
At last the reduced pairs are inserted into chosen multi bit unsigned adder to execute their summation and obtain the final output bits.</p>
|
||||
<p>Wallace tree algorithm is described more in detail here:
|
||||
<a href="https://en.wikipedia.org/wiki/Wallace_tree">https://en.wikipedia.org/wiki/Wallace_tree</a></p>
|
||||
<p>It presents smaller circuit in area opposed to array multiplier but is slightly bigger then dadda because of less reduction stages.</p>
|
||||
<p>Description of the <strong>init</strong> method.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>a</code></strong> : <code>Bus</code></dt>
|
||||
<dd>First input bus.</dd>
|
||||
<dt><strong><code>b</code></strong> : <code>Bus</code></dt>
|
||||
<dd>Second input bus.</dd>
|
||||
<dt><strong><code>prefix</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Prefix name of unsigned wallace multiplier. Defaults to "u_wallace_cla".</dd>
|
||||
<dt><strong><code>unsigned_adder_class_name</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Unsigned multi bit adder used to obtain final sums of products. Defaults to UnsignedCarryLookaheadAdder.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class UnsignedWallaceMultiplier(MultiplierCircuit):
|
||||
"""Class representing unsigned wallace multiplier.
|
||||
|
||||
Unsigned wallace multiplier represents fast N-bit multiplier which utilizes
|
||||
the functionality of wallace tree reduction algorithm proposed by Chris Wallace.
|
||||
|
||||
First partial products are calculated for each bit pair that form the partial product multiplication columns.
|
||||
At last the reduced pairs are inserted into chosen multi bit unsigned adder to execute their summation and obtain the final output bits.
|
||||
|
||||
Wallace tree algorithm is described more in detail here:
|
||||
https://en.wikipedia.org/wiki/Wallace_tree
|
||||
|
||||
It presents smaller circuit in area opposed to array multiplier but is slightly bigger then dadda because of less reduction stages.
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Bus): First input bus.
|
||||
b (Bus): Second input bus.
|
||||
prefix (str, optional): Prefix name of unsigned wallace multiplier. Defaults to "u_wallace_cla".
|
||||
unsigned_adder_class_name (str, optional): Unsigned multi bit adder used to obtain final sums of products. Defaults to UnsignedCarryLookaheadAdder.
|
||||
"""
|
||||
def __init__(self, a: Bus, b: Bus, prefix: str = "u_wallace_cla", unsigned_adder_class_name: str = UnsignedCarryLookaheadAdder):
|
||||
super().__init__()
|
||||
self.N = max(a.N, b.N)
|
||||
self.prefix = prefix
|
||||
self.a = Bus(prefix=a.prefix, wires_list=a.bus)
|
||||
self.b = Bus(prefix=b.prefix, wires_list=b.bus)
|
||||
|
||||
# Bus sign extension in case buses have different lengths
|
||||
self.a.bus_extend(N=self.N, prefix=a.prefix)
|
||||
self.b.bus_extend(N=self.N, prefix=b.prefix)
|
||||
|
||||
# Output wires for multiplication product
|
||||
self.out = Bus(self.prefix+"_out", self.N*2)
|
||||
|
||||
# Initialize all columns partial products forming AND gates matrix
|
||||
self.columns = self.init_column_heights()
|
||||
|
||||
# Perform reduction until all columns have 2 or less bits in them
|
||||
while not all(height <= 2 for (height, *_) in self.columns):
|
||||
col = 0
|
||||
while col < len(self.columns):
|
||||
# If column has exactly 3 bits in height and all previous columns has maximum of 2 bits in height, combine them in a half adder
|
||||
if self.get_column_height(col) == 3 and all(height <= 2 for (height, *_) in self.columns[0:col-1]):
|
||||
# Add half adder and also AND gates if neccesarry (via add_column_wire invocation) into list of circuit components
|
||||
obj_adder = HalfAdder(self.add_column_wire(column=col, bit=0), self.add_column_wire(column=col, bit=1), prefix=self.prefix+"_ha"+str(self.get_instance_num(cls=HalfAdder)))
|
||||
self.add_component(obj_adder)
|
||||
|
||||
# Update the number of current and next column wires
|
||||
self.update_column_heights(curr_column=col, curr_height_change=-1, next_column=col+1, next_height_change=1)
|
||||
|
||||
# Update current and next column wires arrangement
|
||||
# add ha's generated sum to the bottom of current column
|
||||
# add ha's generated cout to the top of next column
|
||||
self.update_column_wires(curr_column=col, next_column=col+1, adder=self.get_previous_component(1))
|
||||
|
||||
# If column has more than 3 bits in height, combine them in a full adder
|
||||
elif self.get_column_height(col) > 3:
|
||||
# Add full adder and also AND gates if neccesarry (via add_column_wire invocation) into list of circuit components
|
||||
obj_adder = FullAdder(self.add_column_wire(column=col, bit=0), self.add_column_wire(column=col, bit=1), self.add_column_wire(column=col, bit=2), prefix=self.prefix+"_fa"+str(self.get_instance_num(cls=FullAdder)))
|
||||
self.add_component(obj_adder)
|
||||
|
||||
# Update the number of current and next column wires
|
||||
self.update_column_heights(curr_column=col, curr_height_change=-2, next_column=col+1, next_height_change=1)
|
||||
|
||||
# Update current and next column wires arrangement
|
||||
# add fa's generated sum to the bottom of current column
|
||||
# add fa's generated cout to the top of next column
|
||||
self.update_column_wires(curr_column=col, next_column=col+1, adder=self.get_previous_component(1))
|
||||
col += 1
|
||||
|
||||
# Output generation
|
||||
# First output bit from single first pp AND gate
|
||||
self.out.connect(0, self.add_column_wire(column=0, bit=0))
|
||||
# Final addition of remaining bits
|
||||
# 1 bit multiplier case
|
||||
if self.N == 1:
|
||||
self.out.connect(1, ConstantWireValue0())
|
||||
# 2 bit multiplier case
|
||||
elif self.N == 2:
|
||||
obj_ha = HalfAdder(self.add_column_wire(column=1, bit=0), self.add_column_wire(column=1, bit=1), prefix=self.prefix+"_ha"+str(self.get_instance_num(cls=HalfAdder)))
|
||||
self.add_component(obj_ha)
|
||||
self.out.connect(1, obj_ha.get_sum_wire())
|
||||
|
||||
obj_ha = HalfAdder(self.get_previous_component().get_carry_wire(), self.add_column_wire(column=2, bit=0), prefix=self.prefix+"_ha"+str(self.get_instance_num(cls=HalfAdder)))
|
||||
self.add_component(obj_ha)
|
||||
self.out.connect(2, obj_ha.get_sum_wire())
|
||||
self.out.connect(3, obj_ha.get_carry_wire())
|
||||
# Final addition of remaining bits using chosen unsigned multi bit adder
|
||||
else:
|
||||
# Obtain proper adder name with its bit width (columns bit pairs minus the first alone bit)
|
||||
adder_prefix = self.prefix + "_" + unsigned_adder_class_name(a=a, b=b).prefix + str(len(self.columns)-1)
|
||||
|
||||
adder_a = Bus(prefix=f"{adder_prefix}_a", wires_list=[self.add_column_wire(column=col, bit=0) for col in range(1, len(self.columns))])
|
||||
adder_b = Bus(prefix=f"{adder_prefix}_b", wires_list=[self.add_column_wire(column=col, bit=1) for col in range(1, len(self.columns))])
|
||||
final_adder = unsigned_adder_class_name(a=adder_a, b=adder_b, prefix=adder_prefix)
|
||||
self.add_component(final_adder)
|
||||
|
||||
[self.out.connect(o, final_adder.out.get_wire(o-1), inserted_wire_desired_index=o-1) for o in range(1, len(self.out.bus))]</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit">MultiplierCircuit</a></li>
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></li>
|
||||
</ul>
|
||||
<h3>Inherited members</h3>
|
||||
<ul class="hlist">
|
||||
<li><code><b><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit">MultiplierCircuit</a></b></code>:
|
||||
<ul class="hlist">
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wire" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wire">add_column_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wires" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_column_wires">add_column_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.add_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component">add_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_blif_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_flat">get_blif_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_blif_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier">get_blif_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_c_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat">get_c_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_c_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier">get_c_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_carry_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire">get_carry_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_cgp_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat">get_cgp_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_cgp_wires" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires">get_cgp_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif">get_circuit_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c">get_circuit_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_gates" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates">get_circuit_gates</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v">get_circuit_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_circuit_wire_index" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index">get_circuit_wire_index</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_height" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_height">get_column_height</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_wire" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_column_wire">get_column_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_component_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types">get_component_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_blif">get_declaration_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_flat">get_declaration_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_c_hier">get_declaration_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_flat">get_declaration_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declaration_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declaration_v_hier">get_declaration_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declarations_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier">get_declarations_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_declarations_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_v_hier">get_declarations_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blif_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blif_flat">get_function_blif_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_block_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_blif">get_function_block_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_block_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_c">get_function_block_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_block_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_block_v">get_function_block_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blocks_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif">get_function_blocks_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blocks_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c">get_function_blocks_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_blocks_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v">get_function_blocks_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif">get_function_out_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat">get_function_out_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_hier">get_function_out_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat">get_function_out_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_function_out_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier">get_function_out_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_includes_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c">get_includes_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_flat">get_init_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier">get_init_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_flat">get_init_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_init_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier">get_init_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_instance_num" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num">get_instance_num</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_invocation_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocation_blif_hier">get_invocation_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_invocations_blif_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_invocations_blif_hier">get_invocations_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_maximum_height" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_maximum_height">get_maximum_height</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_multi_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components">get_multi_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_one_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components">get_one_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_out_invocation_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_c">get_out_invocation_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_out_invocation_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_out_invocation_v">get_out_invocation_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_outputs_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp">get_outputs_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_parameters_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_parameters_cgp">get_parameters_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_previous_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component">get_previous_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_previous_partial_product" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_previous_partial_product">get_previous_partial_product</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_prototype_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif">get_prototype_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_prototype_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_c">get_prototype_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_prototype_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_v">get_prototype_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_sum_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire">get_sum_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_triplets_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp">get_triplets_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_unique_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types">get_unique_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_v_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_flat">get_v_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.get_v_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier">get_v_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.init_column_heights" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.init_column_heights">init_column_heights</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.save_wire_id" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id">save_wire_id</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_heights" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_heights">update_column_heights</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_wires" href="../../core/arithmetic_circuits/multiplier_circuit.html#ariths_gen.core.arithmetic_circuits.multiplier_circuit.MultiplierCircuit.update_column_wires">update_column_wires</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.multi_bit_circuits.multipliers" href="index.html">ariths_gen.multi_bit_circuits.multipliers</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="ariths_gen.multi_bit_circuits.multipliers.wallace_multiplier.SignedWallaceMultiplier" href="#ariths_gen.multi_bit_circuits.multipliers.wallace_multiplier.SignedWallaceMultiplier">SignedWallaceMultiplier</a></code></h4>
|
||||
</li>
|
||||
<li>
|
||||
<h4><code><a title="ariths_gen.multi_bit_circuits.multipliers.wallace_multiplier.UnsignedWallaceMultiplier" href="#ariths_gen.multi_bit_circuits.multipliers.wallace_multiplier.UnsignedWallaceMultiplier">UnsignedWallaceMultiplier</a></code></h4>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
70
ariths_gen/one_bit_circuits/index.html
Normal file
70
ariths_gen/one_bit_circuits/index.html
Normal file
@ -0,0 +1,70 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen.one_bit_circuits API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>ariths_gen.one_bit_circuits</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
|
||||
<dl>
|
||||
<dt><code class="name"><a title="ariths_gen.one_bit_circuits.logic_gates" href="logic_gates/index.html">ariths_gen.one_bit_circuits.logic_gates</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="ariths_gen.one_bit_circuits.one_bit_components" href="one_bit_components/index.html">ariths_gen.one_bit_circuits.one_bit_components</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen" href="../index.html">ariths_gen</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.one_bit_circuits.logic_gates" href="logic_gates/index.html">ariths_gen.one_bit_circuits.logic_gates</a></code></li>
|
||||
<li><code><a title="ariths_gen.one_bit_circuits.one_bit_components" href="one_bit_components/index.html">ariths_gen.one_bit_circuits.one_bit_components</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
79
ariths_gen/one_bit_circuits/logic_gates/index.html
Normal file
79
ariths_gen/one_bit_circuits/logic_gates/index.html
Normal file
@ -0,0 +1,79 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen.one_bit_circuits.logic_gates API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>ariths_gen.one_bit_circuits.logic_gates</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">from .logic_gates import (
|
||||
AndGate,
|
||||
NandGate,
|
||||
OrGate,
|
||||
NorGate,
|
||||
XorGate,
|
||||
XnorGate,
|
||||
NotGate
|
||||
)</code></pre>
|
||||
</details>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
|
||||
<dl>
|
||||
<dt><code class="name"><a title="ariths_gen.one_bit_circuits.logic_gates.logic_gates" href="logic_gates.html">ariths_gen.one_bit_circuits.logic_gates.logic_gates</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.one_bit_circuits" href="../index.html">ariths_gen.one_bit_circuits</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.one_bit_circuits.logic_gates.logic_gates" href="logic_gates.html">ariths_gen.one_bit_circuits.logic_gates.logic_gates</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
1678
ariths_gen/one_bit_circuits/logic_gates/logic_gates.html
Normal file
1678
ariths_gen/one_bit_circuits/logic_gates/logic_gates.html
Normal file
File diff suppressed because it is too large
Load Diff
87
ariths_gen/one_bit_circuits/one_bit_components/index.html
Normal file
87
ariths_gen/one_bit_circuits/one_bit_components/index.html
Normal file
@ -0,0 +1,87 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen.one_bit_circuits.one_bit_components API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>ariths_gen.one_bit_circuits.one_bit_components</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">from .two_input_one_bit_components import (
|
||||
HalfAdder,
|
||||
PGLogicBlock,
|
||||
HalfSubtractor
|
||||
)
|
||||
|
||||
from .three_input_one_bit_components import (
|
||||
FullAdder,
|
||||
FullAdderPG,
|
||||
TwoOneMultiplexer,
|
||||
FullSubtractor
|
||||
)</code></pre>
|
||||
</details>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
|
||||
<dl>
|
||||
<dt><code class="name"><a title="ariths_gen.one_bit_circuits.one_bit_components.three_input_one_bit_components" href="three_input_one_bit_components.html">ariths_gen.one_bit_circuits.one_bit_components.three_input_one_bit_components</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components" href="two_input_one_bit_components.html">ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.one_bit_circuits" href="../index.html">ariths_gen.one_bit_circuits</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.one_bit_circuits.one_bit_components.three_input_one_bit_components" href="three_input_one_bit_components.html">ariths_gen.one_bit_circuits.one_bit_components.three_input_one_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components" href="two_input_one_bit_components.html">ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,782 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">from ariths_gen.core.one_bit_circuits import TwoInputOneBitCircuit
|
||||
from ariths_gen.one_bit_circuits.logic_gates import AndGate, NandGate, OrGate, NorGate, XorGate, XnorGate, NotGate
|
||||
from ariths_gen.wire_components import Wire, Bus
|
||||
|
||||
|
||||
class HalfAdder(TwoInputOneBitCircuit):
|
||||
"""Class representing two input one bit half adder.
|
||||
|
||||
```
|
||||
┌──────┐
|
||||
───►│ ├─► Sum
|
||||
│ │
|
||||
───►│ ├─► Cout
|
||||
└──────┘
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Wire, optional): First input wire. Defaults to Wire(name="a").
|
||||
b (Wire, optional): Second input wire. Defaults to Wire(name="b").
|
||||
prefix (str, optional): Prefix name of half adder. Defaults to "ha".
|
||||
"""
|
||||
def __init__(self, a: Wire = Wire(name="a"), b: Wire = Wire(name="b"), prefix: str = "ha"):
|
||||
super().__init__(a, b, prefix)
|
||||
# 2 wires for component's bus output (sum, cout)
|
||||
self.out = Bus(self.prefix+"_out", 2)
|
||||
|
||||
# Sum
|
||||
# XOR gate for calculation of 1-bit sum
|
||||
obj_xor = XorGate(a, b, prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), outid=0, parent_component=self)
|
||||
self.add_component(obj_xor)
|
||||
self.out.connect(0, obj_xor.out)
|
||||
|
||||
# Cout
|
||||
# AND gate for calculation of 1-bit cout
|
||||
obj_and = AndGate(a, b, prefix=self.prefix+"_and"+str(self.get_instance_num(cls=AndGate)), outid=1, parent_component=self)
|
||||
self.add_component(obj_and)
|
||||
self.out.connect(1, obj_and.out)
|
||||
|
||||
|
||||
class PGLogicBlock(TwoInputOneBitCircuit):
|
||||
"""Class representing two input one bit propagate/generate logic block.
|
||||
|
||||
```
|
||||
┌──────┐
|
||||
───►│ ├─► P
|
||||
│ ├─► G
|
||||
───►│ ├─► S
|
||||
└──────┘
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Wire, optional): First input wire. Defaults to Wire(name="a").
|
||||
b (Wire, optional): Second input wire. Defaults to Wire(name="b").
|
||||
prefix (str, optional): Prefix name of pg logic block. Defaults to "pg_logic".
|
||||
"""
|
||||
def __init__(self, a: Wire = Wire(name="a"), b: Wire = Wire(name="b"), prefix: str = "pg_logic"):
|
||||
super().__init__(a, b, prefix)
|
||||
# 3 wires for component's bus output (propagate, generate, sum)
|
||||
self.out = Bus(self.prefix+"_out", 3)
|
||||
|
||||
# PG logic
|
||||
propagate_or = OrGate(a, b, prefix=self.prefix+"_or"+str(self.get_instance_num(cls=OrGate)), outid=0, parent_component=self)
|
||||
self.add_component(propagate_or)
|
||||
generate_and = AndGate(a, b, prefix=self.prefix+"_and"+str(self.get_instance_num(cls=AndGate)), outid=1, parent_component=self)
|
||||
self.add_component(generate_and)
|
||||
sum_xor = XorGate(a, b, prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), outid=2, parent_component=self)
|
||||
self.add_component(sum_xor)
|
||||
|
||||
self.out.connect(0, propagate_or.out)
|
||||
self.out.connect(1, generate_and.out)
|
||||
self.out.connect(2, sum_xor.out)
|
||||
|
||||
def get_propagate_wire(self):
|
||||
"""Get output wire carrying propagate signal value.
|
||||
|
||||
Returns:
|
||||
Wire: Return propagate wire.
|
||||
"""
|
||||
return self.out.get_wire(0)
|
||||
|
||||
def get_generate_wire(self):
|
||||
"""Get output wire carrying generate signal value.
|
||||
|
||||
Returns:
|
||||
Wire: Return generate wire.
|
||||
"""
|
||||
return self.out.get_wire(1)
|
||||
|
||||
def get_sum_wire(self):
|
||||
"""Get output wire carrying sum value.
|
||||
|
||||
Returns:
|
||||
Wire: Return sum wire.
|
||||
"""
|
||||
return self.out.get_wire(2)
|
||||
|
||||
|
||||
class HalfSubtractor(TwoInputOneBitCircuit):
|
||||
"""Class representing two input one bit half subtractor.
|
||||
|
||||
```
|
||||
┌──────┐
|
||||
───►│ ├─► Difference
|
||||
│ │
|
||||
───►│ ├─► Bout
|
||||
└──────┘
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Wire, optional): First input wire. Defaults to Wire(name="a").
|
||||
b (Wire, optional): Second input wire. Defaults to Wire(name="b").
|
||||
prefix (str, optional): Prefix name of half subtractor adder. Defaults to "hs".
|
||||
"""
|
||||
def __init__(self, a: Wire = Wire(name="a"), b: Wire = Wire(name="b"), prefix: str = "hs"):
|
||||
super().__init__(a, b, prefix)
|
||||
# 2 wires for component's bus output (difference, bout)
|
||||
self.out = Bus(self.prefix+"_out", 2)
|
||||
|
||||
# Difference
|
||||
# XOR gate for calculation of 1-bit difference
|
||||
difference_xor = XorGate(a=self.a, b=self.b, prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), outid=0, parent_component=self)
|
||||
self.add_component(difference_xor)
|
||||
self.out.connect(0, difference_xor.out)
|
||||
|
||||
# Bout
|
||||
# NOT and AND gates for calculation of 1-bit borrow out
|
||||
not_obj = NotGate(a=self.a, prefix=self.prefix+"_not"+str(self.get_instance_num(cls=NotGate)), parent_component=self)
|
||||
self.add_component(not_obj)
|
||||
|
||||
borrow_and = AndGate(a=not_obj.out, b=self.b, prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), outid=1, parent_component=self)
|
||||
self.add_component(borrow_and)
|
||||
self.out.connect(1, borrow_and.out)
|
||||
|
||||
def get_difference_wire(self):
|
||||
"""Get output wire carrying difference value.
|
||||
|
||||
Returns:
|
||||
Wire: Return difference wire.
|
||||
"""
|
||||
return self.out.get_wire(0)
|
||||
|
||||
def get_borrow_wire(self):
|
||||
"""Get output wire carrying borrow out value.
|
||||
|
||||
Returns:
|
||||
Wire: Return borrow out wire.
|
||||
"""
|
||||
return self.out.get_wire(1)</code></pre>
|
||||
</details>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components.HalfAdder"><code class="flex name class">
|
||||
<span>class <span class="ident">HalfAdder</span></span>
|
||||
<span>(</span><span>a: <a title="ariths_gen.wire_components.wires.Wire" href="../../wire_components/wires.html#ariths_gen.wire_components.wires.Wire">Wire</a> = <ariths_gen.wire_components.wires.Wire object>, b: <a title="ariths_gen.wire_components.wires.Wire" href="../../wire_components/wires.html#ariths_gen.wire_components.wires.Wire">Wire</a> = <ariths_gen.wire_components.wires.Wire object>, prefix: str = 'ha')</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Class representing two input one bit half adder.</p>
|
||||
<pre><code> ┌──────┐
|
||||
───►│ ├─► Sum
|
||||
│ │
|
||||
───►│ ├─► Cout
|
||||
└──────┘
|
||||
</code></pre>
|
||||
<p>Description of the <strong>init</strong> method.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>a</code></strong> : <code>Wire</code>, optional</dt>
|
||||
<dd>First input wire. Defaults to Wire(name="a").</dd>
|
||||
<dt><strong><code>b</code></strong> : <code>Wire</code>, optional</dt>
|
||||
<dd>Second input wire. Defaults to Wire(name="b").</dd>
|
||||
<dt><strong><code>prefix</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Prefix name of half adder. Defaults to "ha".</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class HalfAdder(TwoInputOneBitCircuit):
|
||||
"""Class representing two input one bit half adder.
|
||||
|
||||
```
|
||||
┌──────┐
|
||||
───►│ ├─► Sum
|
||||
│ │
|
||||
───►│ ├─► Cout
|
||||
└──────┘
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Wire, optional): First input wire. Defaults to Wire(name="a").
|
||||
b (Wire, optional): Second input wire. Defaults to Wire(name="b").
|
||||
prefix (str, optional): Prefix name of half adder. Defaults to "ha".
|
||||
"""
|
||||
def __init__(self, a: Wire = Wire(name="a"), b: Wire = Wire(name="b"), prefix: str = "ha"):
|
||||
super().__init__(a, b, prefix)
|
||||
# 2 wires for component's bus output (sum, cout)
|
||||
self.out = Bus(self.prefix+"_out", 2)
|
||||
|
||||
# Sum
|
||||
# XOR gate for calculation of 1-bit sum
|
||||
obj_xor = XorGate(a, b, prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), outid=0, parent_component=self)
|
||||
self.add_component(obj_xor)
|
||||
self.out.connect(0, obj_xor.out)
|
||||
|
||||
# Cout
|
||||
# AND gate for calculation of 1-bit cout
|
||||
obj_and = AndGate(a, b, prefix=self.prefix+"_and"+str(self.get_instance_num(cls=AndGate)), outid=1, parent_component=self)
|
||||
self.add_component(obj_and)
|
||||
self.out.connect(1, obj_and.out)</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit">TwoInputOneBitCircuit</a></li>
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></li>
|
||||
</ul>
|
||||
<h3>Inherited members</h3>
|
||||
<ul class="hlist">
|
||||
<li><code><b><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit">TwoInputOneBitCircuit</a></b></code>:
|
||||
<ul class="hlist">
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.add_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component">add_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_blif_code_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_blif_code_flat">get_blif_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_blif_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier">get_blif_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_c_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat">get_c_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_c_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier">get_c_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_carry_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire">get_carry_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_cgp_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat">get_cgp_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_cgp_wires" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires">get_cgp_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_circuit_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif">get_circuit_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_circuit_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c">get_circuit_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_circuit_gates" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates">get_circuit_gates</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_circuit_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v">get_circuit_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_circuit_wire_index" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index">get_circuit_wire_index</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_component_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types">get_component_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_blif" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_blif">get_declaration_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_c_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_c_flat">get_declaration_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_c_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_c_hier">get_declaration_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_v_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_v_flat">get_declaration_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_v_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_v_hier">get_declaration_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declarations_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier">get_declarations_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declarations_v_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declarations_v_flat">get_declarations_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declarations_v_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declarations_v_hier">get_declarations_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_blif_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_blif_flat">get_function_blif_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_blif" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_blif">get_function_block_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_c" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_c">get_function_block_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_v" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_v">get_function_block_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_blocks_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif">get_function_blocks_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_blocks_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c">get_function_blocks_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_blocks_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v">get_function_blocks_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif">get_function_out_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat">get_function_out_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_c_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_c_hier">get_function_out_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat">get_function_out_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier">get_function_out_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_includes_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c">get_includes_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_c_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_c_flat">get_init_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier">get_init_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_v_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_v_flat">get_init_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier">get_init_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_instance_num" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num">get_instance_num</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_invocation_blif_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_invocation_blif_hier">get_invocation_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_invocations_blif_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_invocations_blif_hier">get_invocations_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_multi_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components">get_multi_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_one_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components">get_one_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_out_invocation_c" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_out_invocation_c">get_out_invocation_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_out_invocation_v" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_out_invocation_v">get_out_invocation_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_outputs_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp">get_outputs_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_parameters_cgp" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_parameters_cgp">get_parameters_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_previous_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component">get_previous_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_prototype_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif">get_prototype_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_prototype_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_c">get_prototype_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_prototype_v" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_prototype_v">get_prototype_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_prototype_v_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_prototype_v_hier">get_prototype_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_self_init_v_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_self_init_v_flat">get_self_init_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_self_init_v_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_self_init_v_hier">get_self_init_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_sum_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire">get_sum_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_triplets_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp">get_triplets_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_unique_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types">get_unique_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_v_code_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_v_code_flat">get_v_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_v_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier">get_v_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.save_wire_id" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id">save_wire_id</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dt id="ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components.HalfSubtractor"><code class="flex name class">
|
||||
<span>class <span class="ident">HalfSubtractor</span></span>
|
||||
<span>(</span><span>a: <a title="ariths_gen.wire_components.wires.Wire" href="../../wire_components/wires.html#ariths_gen.wire_components.wires.Wire">Wire</a> = <ariths_gen.wire_components.wires.Wire object>, b: <a title="ariths_gen.wire_components.wires.Wire" href="../../wire_components/wires.html#ariths_gen.wire_components.wires.Wire">Wire</a> = <ariths_gen.wire_components.wires.Wire object>, prefix: str = 'hs')</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Class representing two input one bit half subtractor.</p>
|
||||
<pre><code> ┌──────┐
|
||||
───►│ ├─► Difference
|
||||
│ │
|
||||
───►│ ├─► Bout
|
||||
└──────┘
|
||||
</code></pre>
|
||||
<p>Description of the <strong>init</strong> method.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>a</code></strong> : <code>Wire</code>, optional</dt>
|
||||
<dd>First input wire. Defaults to Wire(name="a").</dd>
|
||||
<dt><strong><code>b</code></strong> : <code>Wire</code>, optional</dt>
|
||||
<dd>Second input wire. Defaults to Wire(name="b").</dd>
|
||||
<dt><strong><code>prefix</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Prefix name of half subtractor adder. Defaults to "hs".</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class HalfSubtractor(TwoInputOneBitCircuit):
|
||||
"""Class representing two input one bit half subtractor.
|
||||
|
||||
```
|
||||
┌──────┐
|
||||
───►│ ├─► Difference
|
||||
│ │
|
||||
───►│ ├─► Bout
|
||||
└──────┘
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Wire, optional): First input wire. Defaults to Wire(name="a").
|
||||
b (Wire, optional): Second input wire. Defaults to Wire(name="b").
|
||||
prefix (str, optional): Prefix name of half subtractor adder. Defaults to "hs".
|
||||
"""
|
||||
def __init__(self, a: Wire = Wire(name="a"), b: Wire = Wire(name="b"), prefix: str = "hs"):
|
||||
super().__init__(a, b, prefix)
|
||||
# 2 wires for component's bus output (difference, bout)
|
||||
self.out = Bus(self.prefix+"_out", 2)
|
||||
|
||||
# Difference
|
||||
# XOR gate for calculation of 1-bit difference
|
||||
difference_xor = XorGate(a=self.a, b=self.b, prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), outid=0, parent_component=self)
|
||||
self.add_component(difference_xor)
|
||||
self.out.connect(0, difference_xor.out)
|
||||
|
||||
# Bout
|
||||
# NOT and AND gates for calculation of 1-bit borrow out
|
||||
not_obj = NotGate(a=self.a, prefix=self.prefix+"_not"+str(self.get_instance_num(cls=NotGate)), parent_component=self)
|
||||
self.add_component(not_obj)
|
||||
|
||||
borrow_and = AndGate(a=not_obj.out, b=self.b, prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), outid=1, parent_component=self)
|
||||
self.add_component(borrow_and)
|
||||
self.out.connect(1, borrow_and.out)
|
||||
|
||||
def get_difference_wire(self):
|
||||
"""Get output wire carrying difference value.
|
||||
|
||||
Returns:
|
||||
Wire: Return difference wire.
|
||||
"""
|
||||
return self.out.get_wire(0)
|
||||
|
||||
def get_borrow_wire(self):
|
||||
"""Get output wire carrying borrow out value.
|
||||
|
||||
Returns:
|
||||
Wire: Return borrow out wire.
|
||||
"""
|
||||
return self.out.get_wire(1)</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit">TwoInputOneBitCircuit</a></li>
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></li>
|
||||
</ul>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components.HalfSubtractor.get_borrow_wire"><code class="name flex">
|
||||
<span>def <span class="ident">get_borrow_wire</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Get output wire carrying borrow out value.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>Wire</code></dt>
|
||||
<dd>Return borrow out wire.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def get_borrow_wire(self):
|
||||
"""Get output wire carrying borrow out value.
|
||||
|
||||
Returns:
|
||||
Wire: Return borrow out wire.
|
||||
"""
|
||||
return self.out.get_wire(1)</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components.HalfSubtractor.get_difference_wire"><code class="name flex">
|
||||
<span>def <span class="ident">get_difference_wire</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Get output wire carrying difference value.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>Wire</code></dt>
|
||||
<dd>Return difference wire.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def get_difference_wire(self):
|
||||
"""Get output wire carrying difference value.
|
||||
|
||||
Returns:
|
||||
Wire: Return difference wire.
|
||||
"""
|
||||
return self.out.get_wire(0)</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Inherited members</h3>
|
||||
<ul class="hlist">
|
||||
<li><code><b><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit">TwoInputOneBitCircuit</a></b></code>:
|
||||
<ul class="hlist">
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.add_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component">add_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_blif_code_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_blif_code_flat">get_blif_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_blif_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier">get_blif_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_c_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat">get_c_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_c_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier">get_c_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_carry_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire">get_carry_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_cgp_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat">get_cgp_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_cgp_wires" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires">get_cgp_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_circuit_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif">get_circuit_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_circuit_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c">get_circuit_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_circuit_gates" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates">get_circuit_gates</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_circuit_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v">get_circuit_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_circuit_wire_index" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index">get_circuit_wire_index</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_component_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types">get_component_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_blif" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_blif">get_declaration_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_c_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_c_flat">get_declaration_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_c_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_c_hier">get_declaration_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_v_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_v_flat">get_declaration_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_v_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_v_hier">get_declaration_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declarations_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier">get_declarations_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declarations_v_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declarations_v_flat">get_declarations_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declarations_v_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declarations_v_hier">get_declarations_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_blif_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_blif_flat">get_function_blif_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_blif" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_blif">get_function_block_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_c" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_c">get_function_block_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_v" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_v">get_function_block_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_blocks_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif">get_function_blocks_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_blocks_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c">get_function_blocks_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_blocks_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v">get_function_blocks_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif">get_function_out_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat">get_function_out_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_c_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_c_hier">get_function_out_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat">get_function_out_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier">get_function_out_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_includes_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c">get_includes_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_c_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_c_flat">get_init_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier">get_init_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_v_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_v_flat">get_init_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier">get_init_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_instance_num" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num">get_instance_num</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_invocation_blif_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_invocation_blif_hier">get_invocation_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_invocations_blif_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_invocations_blif_hier">get_invocations_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_multi_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components">get_multi_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_one_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components">get_one_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_out_invocation_c" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_out_invocation_c">get_out_invocation_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_out_invocation_v" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_out_invocation_v">get_out_invocation_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_outputs_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp">get_outputs_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_parameters_cgp" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_parameters_cgp">get_parameters_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_previous_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component">get_previous_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_prototype_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif">get_prototype_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_prototype_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_c">get_prototype_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_prototype_v" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_prototype_v">get_prototype_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_prototype_v_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_prototype_v_hier">get_prototype_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_self_init_v_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_self_init_v_flat">get_self_init_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_self_init_v_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_self_init_v_hier">get_self_init_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_sum_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire">get_sum_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_triplets_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp">get_triplets_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_unique_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types">get_unique_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_v_code_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_v_code_flat">get_v_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_v_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier">get_v_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.save_wire_id" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id">save_wire_id</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dt id="ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components.PGLogicBlock"><code class="flex name class">
|
||||
<span>class <span class="ident">PGLogicBlock</span></span>
|
||||
<span>(</span><span>a: <a title="ariths_gen.wire_components.wires.Wire" href="../../wire_components/wires.html#ariths_gen.wire_components.wires.Wire">Wire</a> = <ariths_gen.wire_components.wires.Wire object>, b: <a title="ariths_gen.wire_components.wires.Wire" href="../../wire_components/wires.html#ariths_gen.wire_components.wires.Wire">Wire</a> = <ariths_gen.wire_components.wires.Wire object>, prefix: str = 'pg_logic')</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Class representing two input one bit propagate/generate logic block.</p>
|
||||
<pre><code> ┌──────┐
|
||||
───►│ ├─► P
|
||||
│ ├─► G
|
||||
───►│ ├─► S
|
||||
└──────┘
|
||||
</code></pre>
|
||||
<p>Description of the <strong>init</strong> method.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>a</code></strong> : <code>Wire</code>, optional</dt>
|
||||
<dd>First input wire. Defaults to Wire(name="a").</dd>
|
||||
<dt><strong><code>b</code></strong> : <code>Wire</code>, optional</dt>
|
||||
<dd>Second input wire. Defaults to Wire(name="b").</dd>
|
||||
<dt><strong><code>prefix</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Prefix name of pg logic block. Defaults to "pg_logic".</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class PGLogicBlock(TwoInputOneBitCircuit):
|
||||
"""Class representing two input one bit propagate/generate logic block.
|
||||
|
||||
```
|
||||
┌──────┐
|
||||
───►│ ├─► P
|
||||
│ ├─► G
|
||||
───►│ ├─► S
|
||||
└──────┘
|
||||
```
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
a (Wire, optional): First input wire. Defaults to Wire(name="a").
|
||||
b (Wire, optional): Second input wire. Defaults to Wire(name="b").
|
||||
prefix (str, optional): Prefix name of pg logic block. Defaults to "pg_logic".
|
||||
"""
|
||||
def __init__(self, a: Wire = Wire(name="a"), b: Wire = Wire(name="b"), prefix: str = "pg_logic"):
|
||||
super().__init__(a, b, prefix)
|
||||
# 3 wires for component's bus output (propagate, generate, sum)
|
||||
self.out = Bus(self.prefix+"_out", 3)
|
||||
|
||||
# PG logic
|
||||
propagate_or = OrGate(a, b, prefix=self.prefix+"_or"+str(self.get_instance_num(cls=OrGate)), outid=0, parent_component=self)
|
||||
self.add_component(propagate_or)
|
||||
generate_and = AndGate(a, b, prefix=self.prefix+"_and"+str(self.get_instance_num(cls=AndGate)), outid=1, parent_component=self)
|
||||
self.add_component(generate_and)
|
||||
sum_xor = XorGate(a, b, prefix=self.prefix+"_xor"+str(self.get_instance_num(cls=XorGate)), outid=2, parent_component=self)
|
||||
self.add_component(sum_xor)
|
||||
|
||||
self.out.connect(0, propagate_or.out)
|
||||
self.out.connect(1, generate_and.out)
|
||||
self.out.connect(2, sum_xor.out)
|
||||
|
||||
def get_propagate_wire(self):
|
||||
"""Get output wire carrying propagate signal value.
|
||||
|
||||
Returns:
|
||||
Wire: Return propagate wire.
|
||||
"""
|
||||
return self.out.get_wire(0)
|
||||
|
||||
def get_generate_wire(self):
|
||||
"""Get output wire carrying generate signal value.
|
||||
|
||||
Returns:
|
||||
Wire: Return generate wire.
|
||||
"""
|
||||
return self.out.get_wire(1)
|
||||
|
||||
def get_sum_wire(self):
|
||||
"""Get output wire carrying sum value.
|
||||
|
||||
Returns:
|
||||
Wire: Return sum wire.
|
||||
"""
|
||||
return self.out.get_wire(2)</code></pre>
|
||||
</details>
|
||||
<h3>Ancestors</h3>
|
||||
<ul class="hlist">
|
||||
<li><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit">TwoInputOneBitCircuit</a></li>
|
||||
<li><a title="ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit">ArithmeticCircuit</a></li>
|
||||
</ul>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components.PGLogicBlock.get_generate_wire"><code class="name flex">
|
||||
<span>def <span class="ident">get_generate_wire</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Get output wire carrying generate signal value.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>Wire</code></dt>
|
||||
<dd>Return generate wire.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def get_generate_wire(self):
|
||||
"""Get output wire carrying generate signal value.
|
||||
|
||||
Returns:
|
||||
Wire: Return generate wire.
|
||||
"""
|
||||
return self.out.get_wire(1)</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components.PGLogicBlock.get_propagate_wire"><code class="name flex">
|
||||
<span>def <span class="ident">get_propagate_wire</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Get output wire carrying propagate signal value.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>Wire</code></dt>
|
||||
<dd>Return propagate wire.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def get_propagate_wire(self):
|
||||
"""Get output wire carrying propagate signal value.
|
||||
|
||||
Returns:
|
||||
Wire: Return propagate wire.
|
||||
"""
|
||||
return self.out.get_wire(0)</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Inherited members</h3>
|
||||
<ul class="hlist">
|
||||
<li><code><b><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit">TwoInputOneBitCircuit</a></b></code>:
|
||||
<ul class="hlist">
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.add_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.add_component">add_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_blif_code_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_blif_code_flat">get_blif_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_blif_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_blif_code_hier">get_blif_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_c_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_flat">get_c_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_c_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_c_code_hier">get_c_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_carry_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_carry_wire">get_carry_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_cgp_code_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_code_flat">get_cgp_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_cgp_wires" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_cgp_wires">get_cgp_wires</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_circuit_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_blif">get_circuit_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_circuit_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_c">get_circuit_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_circuit_gates" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_gates">get_circuit_gates</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_circuit_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_v">get_circuit_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_circuit_wire_index" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_circuit_wire_index">get_circuit_wire_index</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_component_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_component_types">get_component_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_blif" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_blif">get_declaration_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_c_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_c_flat">get_declaration_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_c_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_c_hier">get_declaration_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_v_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_v_flat">get_declaration_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_v_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declaration_v_hier">get_declaration_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declarations_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_declarations_c_hier">get_declarations_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declarations_v_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declarations_v_flat">get_declarations_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declarations_v_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_declarations_v_hier">get_declarations_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_blif_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_blif_flat">get_function_blif_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_blif" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_blif">get_function_block_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_c" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_c">get_function_block_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_v" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_block_v">get_function_block_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_blocks_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_blif">get_function_blocks_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_blocks_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_c">get_function_blocks_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_blocks_v" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_blocks_v">get_function_blocks_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_blif">get_function_out_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_c_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_c_flat">get_function_out_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_c_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_c_hier">get_function_out_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_v_flat" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_flat">get_function_out_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_function_out_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_function_out_v_hier">get_function_out_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_includes_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_includes_c">get_includes_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_c_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_c_flat">get_init_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_c_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_c_hier">get_init_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_v_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_v_flat">get_init_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_init_v_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_init_v_hier">get_init_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_instance_num" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_instance_num">get_instance_num</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_invocation_blif_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_invocation_blif_hier">get_invocation_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_invocations_blif_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_invocations_blif_hier">get_invocations_blif_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_multi_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_multi_bit_components">get_multi_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_one_bit_components" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_one_bit_components">get_one_bit_components</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_out_invocation_c" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_out_invocation_c">get_out_invocation_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_out_invocation_v" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_out_invocation_v">get_out_invocation_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_outputs_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_outputs_cgp">get_outputs_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_parameters_cgp" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_parameters_cgp">get_parameters_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_previous_component" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_previous_component">get_previous_component</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_prototype_blif" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_blif">get_prototype_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_prototype_c" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_prototype_c">get_prototype_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_prototype_v" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_prototype_v">get_prototype_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_prototype_v_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_prototype_v_hier">get_prototype_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_self_init_v_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_self_init_v_flat">get_self_init_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_self_init_v_hier" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_self_init_v_hier">get_self_init_v_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_sum_wire" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_sum_wire">get_sum_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_triplets_cgp" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_triplets_cgp">get_triplets_cgp</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_unique_types" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_unique_types">get_unique_types</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_v_code_flat" href="../../core/one_bit_circuits/two_input_one_bit_circuit.html#ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_v_code_flat">get_v_code_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.get_v_code_hier" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.get_v_code_hier">get_v_code_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.core.one_bit_circuits.two_input_one_bit_circuit.TwoInputOneBitCircuit.save_wire_id" href="../../core/arithmetic_circuits/arithmetic_circuit.html#ariths_gen.core.arithmetic_circuits.arithmetic_circuit.ArithmeticCircuit.save_wire_id">save_wire_id</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.one_bit_circuits.one_bit_components" href="index.html">ariths_gen.one_bit_circuits.one_bit_components</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components.HalfAdder" href="#ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components.HalfAdder">HalfAdder</a></code></h4>
|
||||
</li>
|
||||
<li>
|
||||
<h4><code><a title="ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components.HalfSubtractor" href="#ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components.HalfSubtractor">HalfSubtractor</a></code></h4>
|
||||
<ul class="">
|
||||
<li><code><a title="ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components.HalfSubtractor.get_borrow_wire" href="#ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components.HalfSubtractor.get_borrow_wire">get_borrow_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components.HalfSubtractor.get_difference_wire" href="#ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components.HalfSubtractor.get_difference_wire">get_difference_wire</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<h4><code><a title="ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components.PGLogicBlock" href="#ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components.PGLogicBlock">PGLogicBlock</a></code></h4>
|
||||
<ul class="">
|
||||
<li><code><a title="ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components.PGLogicBlock.get_generate_wire" href="#ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components.PGLogicBlock.get_generate_wire">get_generate_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components.PGLogicBlock.get_propagate_wire" href="#ariths_gen.one_bit_circuits.one_bit_components.two_input_one_bit_components.PGLogicBlock.get_propagate_wire">get_propagate_wire</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
781
ariths_gen/wire_components/buses.html
Normal file
781
ariths_gen/wire_components/buses.html
Normal file
@ -0,0 +1,781 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen.wire_components.buses API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>ariths_gen.wire_components.buses</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">from .wires import Wire
|
||||
|
||||
|
||||
class Bus():
|
||||
"""Class representing bus of wires used as inputs/outputs of bigger circuits.
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
prefix (str, optional): Prefix name of the bus. Defaults to "bus".
|
||||
N (int, optional): Number of wires in the bus. Defaults to 1.
|
||||
wires_list (list, optional): List of Wire objects used to clone one bus to another. Defaults to 0.
|
||||
"""
|
||||
def __init__(self, prefix: str = "bus", N: int = 1, wires_list: list = None):
|
||||
if wires_list is None:
|
||||
self.prefix = prefix
|
||||
# Adding wires into current bus's wires list (wire names are concatenated from bus prefix and their index position inside the bus in square brackets)
|
||||
self.bus = [Wire(name=prefix+f"[{i}]", prefix=prefix, index=i, parent_bus=self) for i in range(N)]
|
||||
self.N = N
|
||||
else:
|
||||
self.prefix = prefix
|
||||
self.bus = wires_list
|
||||
self.N = len(self.bus)
|
||||
|
||||
def bus_extend(self, N: int, prefix: str = "bus"):
|
||||
"""Provides bus extension to contain more wires.
|
||||
|
||||
Args:
|
||||
N (int): Number of wires in the bus. Defaults to 1.
|
||||
prefix (str, optional): Prefix name of the bus. Defaults to "bus".
|
||||
"""
|
||||
# Checks if any extension is neccesarry and if so, proceeds to wire extend the bus
|
||||
if self.N < N:
|
||||
# Adding wires into current bus's wires list (wire names are concatenated from bus prefix and their index position inside the bus in square brackets)
|
||||
self.bus += [Wire(name=prefix+f"[{i}]", prefix=prefix, index=i, parent_bus=self) for i in range(self.N, N)]
|
||||
self.N = N
|
||||
|
||||
def get_wire(self, wire_index: int = 0):
|
||||
"""Retrieves a wire from the bus by a given index.
|
||||
|
||||
Args:
|
||||
wire_index (int, optional): Index of wire to be retrieved from the bus. Defaults to 0.
|
||||
|
||||
Returns:
|
||||
Wire: Returning wire from the bus.
|
||||
"""
|
||||
return self.bus[wire_index]
|
||||
|
||||
# Connecting output wire of the inner circuit component to desired position in the described circuit's output bus
|
||||
def connect(self, bus_wire_index: int, inner_component_out_wire: Wire, inserted_wire_desired_index: int = -1):
|
||||
"""Connects given 'Wire' object to a 'bus_wire_index' within this bus.
|
||||
|
||||
Used for connection of output wire of the inner circuit component
|
||||
to the appropriate wire of the circuit's output bus.
|
||||
|
||||
Args:
|
||||
bus_wire_index (int): Index in bus to store given wire in.
|
||||
inner_component_out_wire (Wire): Wire of some other component (mostly its output) to store in the bus.
|
||||
inserted_wire_desired_index(int, optional): Optional desired explicit index, where 'inner_component_out_wire' value resides in the inner components's output bus. Otherwise 'inner_component_out_wire' self index value is used. Defaults to -1.
|
||||
"""
|
||||
inserted_wire_index = inserted_wire_desired_index if inserted_wire_desired_index != -1 else inner_component_out_wire.index
|
||||
# Used for connection of constant wire value into a bus
|
||||
if inner_component_out_wire.is_const():
|
||||
self.bus[bus_wire_index] = inner_component_out_wire
|
||||
# Proper connection of wires that themselves are not yet a member of any other bus and also those that could be part of some bus but do not have `inserted_wire_desired_index` defined
|
||||
elif inner_component_out_wire.parent_bus is None or inserted_wire_desired_index == -1:
|
||||
self.bus[bus_wire_index] = Wire(name=inner_component_out_wire.name, prefix=inner_component_out_wire.prefix, index=inserted_wire_index, value=inner_component_out_wire.value, parent_bus=self)
|
||||
# Proper connection of wires that are already a member of some other bus and are desired to connect value from their previous bus to this one at desired index position
|
||||
elif inserted_wire_desired_index != -1:
|
||||
self.bus[bus_wire_index] = Wire(name=inner_component_out_wire.name, prefix=inner_component_out_wire.parent_bus.prefix, index=inserted_wire_index, value=inner_component_out_wire.value, parent_bus=self)
|
||||
|
||||
""" C CODE GENERATION """
|
||||
def get_declaration_c(self):
|
||||
"""Bus declaration in C code.
|
||||
|
||||
Returns:
|
||||
str: C code for declaration and initialization of bus name.
|
||||
"""
|
||||
if self.N > 8:
|
||||
return f" uint64_t {self.prefix} = 0;\n"
|
||||
else:
|
||||
return f" uint8_t {self.prefix} = 0;\n"
|
||||
|
||||
def return_bus_wires_values_c_flat(self):
|
||||
"""Retrieves values from bus's wires and stores them in bus's corresponding C variable at proper offset bit position in the bus for flat generation.
|
||||
|
||||
Returns:
|
||||
str: C code for assigning wire values into bus represented in C code variable.
|
||||
"""
|
||||
return "".join([f" {self.prefix} |= {w.return_wire_value_c_flat(offset=self.bus.index(w))}" for w in self.bus])
|
||||
|
||||
def return_bus_wires_values_c_hier(self):
|
||||
"""Retrieves values from bus's wires and stores them in bus's corresponding C variable at proper offset bit position in the bus for hierarchical generation.
|
||||
|
||||
Returns:
|
||||
str: C code for assigning wire values into bus represented in C code variable.
|
||||
"""
|
||||
return "".join([f" {self.prefix} |= {w.return_wire_value_c_hier(offset=self.bus.index(w))}" for w in self.bus])
|
||||
|
||||
""" VERILOG CODE GENERATION """
|
||||
def return_bus_wires_values_v_flat(self):
|
||||
"""Retrieves values from bus's wires and stores them in bus's corresponding Verilog variable at proper offset bit position in the bus for flat generation.
|
||||
|
||||
Returns:
|
||||
str: Verilog code for assigning wire values into bus represented in Verilog code bus variable.
|
||||
"""
|
||||
return "".join([f" assign {self.prefix}[{self.bus.index(w)}] = {w.return_wire_value_v_flat()}" for w in self.bus])
|
||||
|
||||
def return_bus_wires_values_v_hier(self):
|
||||
"""Retrieves values from bus's wires and stores them in bus's corresponding Verilog variable at proper offset bit position in the bus for hierarchical generation.
|
||||
|
||||
Returns:
|
||||
str: Verilog code for assigning wire values into bus represented in Verilog code variable.
|
||||
"""
|
||||
return "".join([f" assign {self.prefix}[{self.bus.index(w)}] = {w.return_wire_value_v_hier()}" for w in self.bus])
|
||||
|
||||
def get_unique_assign_out_wires_v(self, circuit_block: object):
|
||||
"""Returns bus's wires used for hierarchical one bit subcomponent's function block invocation and output wires assignments.
|
||||
|
||||
Args:
|
||||
circuit_block (object): Object describing corresponding function block that is being invoked for proper output wires assignment during instantiation.
|
||||
|
||||
Returns:
|
||||
str: Verilog code unique bus wires for proper subcomponent's function block invocation.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(w.prefix) if w.prefix not in unique_out_wires else None for w in self.bus]
|
||||
return "".join([f", .{circuit_block.out.get_wire(self.bus.index(o)).prefix}({unique_out_wires.pop(unique_out_wires.index(o.prefix))})" if o.prefix in unique_out_wires else f", .{circuit_block.out.get_wire(self.bus.index(o)).prefix}()" for o in self.bus])
|
||||
|
||||
""" BLIF CODE GENERATION """
|
||||
def get_wire_declaration_blif(self, array: bool = True):
|
||||
"""Declare each wire from the bus independently in Blif code representation.
|
||||
|
||||
Args:
|
||||
array (bool, optional): Specifies whether to declare wires from bus by their offset e.g. out[0] or by their wire name e.g. out_0. Defaults to True.
|
||||
|
||||
Returns:
|
||||
str: Blif code for declaration of individual bus wires.
|
||||
"""
|
||||
return "".join([f" {w.get_declaration_blif(prefix=self.prefix, offset=self.bus.index(w), array=array)}" for w in self.bus])
|
||||
|
||||
def get_wire_assign_blif(self, output: bool = False):
|
||||
"""Assign all bits from the bus as each individual wires or assign wires into the corresponding output bus position in Blif code representation.
|
||||
|
||||
Args:
|
||||
output (bool, optional): Specifies whether bus wires are used as outputs (True, assigned to) or as inputs (False, assigned from). Defaults to False.
|
||||
|
||||
Returns:
|
||||
str: Blif code for bus wires assignments.
|
||||
"""
|
||||
return "".join([w.get_assign_blif(prefix=self.prefix+f"[{self.bus.index(w)}]", output=output) for w in self.bus])
|
||||
|
||||
def get_unique_assign_out_wires_blif(self, function_block_out_bus: object):
|
||||
"""Assigns unique output wires to their respective outputs of subcomponent's function block modul in hierarchical Blif subcomponent's invocation.
|
||||
|
||||
Args:
|
||||
function_block_out_bus (object): Specifies output bus of corresponding function block's outputs for proper subcomponent modul invocation.
|
||||
|
||||
Returns:
|
||||
str: Blif code for proper subcomponent's function block invocation with respective output wires assignment.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(w.prefix) if w.prefix not in unique_out_wires else None for w in self.bus]
|
||||
return "".join([f" {function_block_out_bus.get_wire(self.bus.index(o)).name}={unique_out_wires.pop(unique_out_wires.index(o.prefix))}" if o.prefix in unique_out_wires else "" for o in self.bus])</code></pre>
|
||||
</details>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-classes">Classes</h2>
|
||||
<dl>
|
||||
<dt id="ariths_gen.wire_components.buses.Bus"><code class="flex name class">
|
||||
<span>class <span class="ident">Bus</span></span>
|
||||
<span>(</span><span>prefix: str = 'bus', N: int = 1, wires_list: list = None)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Class representing bus of wires used as inputs/outputs of bigger circuits.</p>
|
||||
<p>Description of the <strong>init</strong> method.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>prefix</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Prefix name of the bus. Defaults to "bus".</dd>
|
||||
<dt><strong><code>N</code></strong> : <code>int</code>, optional</dt>
|
||||
<dd>Number of wires in the bus. Defaults to 1.</dd>
|
||||
<dt><strong><code>wires_list</code></strong> : <code>list</code>, optional</dt>
|
||||
<dd>List of Wire objects used to clone one bus to another. Defaults to 0.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">class Bus():
|
||||
"""Class representing bus of wires used as inputs/outputs of bigger circuits.
|
||||
|
||||
Description of the __init__ method.
|
||||
|
||||
Args:
|
||||
prefix (str, optional): Prefix name of the bus. Defaults to "bus".
|
||||
N (int, optional): Number of wires in the bus. Defaults to 1.
|
||||
wires_list (list, optional): List of Wire objects used to clone one bus to another. Defaults to 0.
|
||||
"""
|
||||
def __init__(self, prefix: str = "bus", N: int = 1, wires_list: list = None):
|
||||
if wires_list is None:
|
||||
self.prefix = prefix
|
||||
# Adding wires into current bus's wires list (wire names are concatenated from bus prefix and their index position inside the bus in square brackets)
|
||||
self.bus = [Wire(name=prefix+f"[{i}]", prefix=prefix, index=i, parent_bus=self) for i in range(N)]
|
||||
self.N = N
|
||||
else:
|
||||
self.prefix = prefix
|
||||
self.bus = wires_list
|
||||
self.N = len(self.bus)
|
||||
|
||||
def bus_extend(self, N: int, prefix: str = "bus"):
|
||||
"""Provides bus extension to contain more wires.
|
||||
|
||||
Args:
|
||||
N (int): Number of wires in the bus. Defaults to 1.
|
||||
prefix (str, optional): Prefix name of the bus. Defaults to "bus".
|
||||
"""
|
||||
# Checks if any extension is neccesarry and if so, proceeds to wire extend the bus
|
||||
if self.N < N:
|
||||
# Adding wires into current bus's wires list (wire names are concatenated from bus prefix and their index position inside the bus in square brackets)
|
||||
self.bus += [Wire(name=prefix+f"[{i}]", prefix=prefix, index=i, parent_bus=self) for i in range(self.N, N)]
|
||||
self.N = N
|
||||
|
||||
def get_wire(self, wire_index: int = 0):
|
||||
"""Retrieves a wire from the bus by a given index.
|
||||
|
||||
Args:
|
||||
wire_index (int, optional): Index of wire to be retrieved from the bus. Defaults to 0.
|
||||
|
||||
Returns:
|
||||
Wire: Returning wire from the bus.
|
||||
"""
|
||||
return self.bus[wire_index]
|
||||
|
||||
# Connecting output wire of the inner circuit component to desired position in the described circuit's output bus
|
||||
def connect(self, bus_wire_index: int, inner_component_out_wire: Wire, inserted_wire_desired_index: int = -1):
|
||||
"""Connects given 'Wire' object to a 'bus_wire_index' within this bus.
|
||||
|
||||
Used for connection of output wire of the inner circuit component
|
||||
to the appropriate wire of the circuit's output bus.
|
||||
|
||||
Args:
|
||||
bus_wire_index (int): Index in bus to store given wire in.
|
||||
inner_component_out_wire (Wire): Wire of some other component (mostly its output) to store in the bus.
|
||||
inserted_wire_desired_index(int, optional): Optional desired explicit index, where 'inner_component_out_wire' value resides in the inner components's output bus. Otherwise 'inner_component_out_wire' self index value is used. Defaults to -1.
|
||||
"""
|
||||
inserted_wire_index = inserted_wire_desired_index if inserted_wire_desired_index != -1 else inner_component_out_wire.index
|
||||
# Used for connection of constant wire value into a bus
|
||||
if inner_component_out_wire.is_const():
|
||||
self.bus[bus_wire_index] = inner_component_out_wire
|
||||
# Proper connection of wires that themselves are not yet a member of any other bus and also those that could be part of some bus but do not have `inserted_wire_desired_index` defined
|
||||
elif inner_component_out_wire.parent_bus is None or inserted_wire_desired_index == -1:
|
||||
self.bus[bus_wire_index] = Wire(name=inner_component_out_wire.name, prefix=inner_component_out_wire.prefix, index=inserted_wire_index, value=inner_component_out_wire.value, parent_bus=self)
|
||||
# Proper connection of wires that are already a member of some other bus and are desired to connect value from their previous bus to this one at desired index position
|
||||
elif inserted_wire_desired_index != -1:
|
||||
self.bus[bus_wire_index] = Wire(name=inner_component_out_wire.name, prefix=inner_component_out_wire.parent_bus.prefix, index=inserted_wire_index, value=inner_component_out_wire.value, parent_bus=self)
|
||||
|
||||
""" C CODE GENERATION """
|
||||
def get_declaration_c(self):
|
||||
"""Bus declaration in C code.
|
||||
|
||||
Returns:
|
||||
str: C code for declaration and initialization of bus name.
|
||||
"""
|
||||
if self.N > 8:
|
||||
return f" uint64_t {self.prefix} = 0;\n"
|
||||
else:
|
||||
return f" uint8_t {self.prefix} = 0;\n"
|
||||
|
||||
def return_bus_wires_values_c_flat(self):
|
||||
"""Retrieves values from bus's wires and stores them in bus's corresponding C variable at proper offset bit position in the bus for flat generation.
|
||||
|
||||
Returns:
|
||||
str: C code for assigning wire values into bus represented in C code variable.
|
||||
"""
|
||||
return "".join([f" {self.prefix} |= {w.return_wire_value_c_flat(offset=self.bus.index(w))}" for w in self.bus])
|
||||
|
||||
def return_bus_wires_values_c_hier(self):
|
||||
"""Retrieves values from bus's wires and stores them in bus's corresponding C variable at proper offset bit position in the bus for hierarchical generation.
|
||||
|
||||
Returns:
|
||||
str: C code for assigning wire values into bus represented in C code variable.
|
||||
"""
|
||||
return "".join([f" {self.prefix} |= {w.return_wire_value_c_hier(offset=self.bus.index(w))}" for w in self.bus])
|
||||
|
||||
""" VERILOG CODE GENERATION """
|
||||
def return_bus_wires_values_v_flat(self):
|
||||
"""Retrieves values from bus's wires and stores them in bus's corresponding Verilog variable at proper offset bit position in the bus for flat generation.
|
||||
|
||||
Returns:
|
||||
str: Verilog code for assigning wire values into bus represented in Verilog code bus variable.
|
||||
"""
|
||||
return "".join([f" assign {self.prefix}[{self.bus.index(w)}] = {w.return_wire_value_v_flat()}" for w in self.bus])
|
||||
|
||||
def return_bus_wires_values_v_hier(self):
|
||||
"""Retrieves values from bus's wires and stores them in bus's corresponding Verilog variable at proper offset bit position in the bus for hierarchical generation.
|
||||
|
||||
Returns:
|
||||
str: Verilog code for assigning wire values into bus represented in Verilog code variable.
|
||||
"""
|
||||
return "".join([f" assign {self.prefix}[{self.bus.index(w)}] = {w.return_wire_value_v_hier()}" for w in self.bus])
|
||||
|
||||
def get_unique_assign_out_wires_v(self, circuit_block: object):
|
||||
"""Returns bus's wires used for hierarchical one bit subcomponent's function block invocation and output wires assignments.
|
||||
|
||||
Args:
|
||||
circuit_block (object): Object describing corresponding function block that is being invoked for proper output wires assignment during instantiation.
|
||||
|
||||
Returns:
|
||||
str: Verilog code unique bus wires for proper subcomponent's function block invocation.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(w.prefix) if w.prefix not in unique_out_wires else None for w in self.bus]
|
||||
return "".join([f", .{circuit_block.out.get_wire(self.bus.index(o)).prefix}({unique_out_wires.pop(unique_out_wires.index(o.prefix))})" if o.prefix in unique_out_wires else f", .{circuit_block.out.get_wire(self.bus.index(o)).prefix}()" for o in self.bus])
|
||||
|
||||
""" BLIF CODE GENERATION """
|
||||
def get_wire_declaration_blif(self, array: bool = True):
|
||||
"""Declare each wire from the bus independently in Blif code representation.
|
||||
|
||||
Args:
|
||||
array (bool, optional): Specifies whether to declare wires from bus by their offset e.g. out[0] or by their wire name e.g. out_0. Defaults to True.
|
||||
|
||||
Returns:
|
||||
str: Blif code for declaration of individual bus wires.
|
||||
"""
|
||||
return "".join([f" {w.get_declaration_blif(prefix=self.prefix, offset=self.bus.index(w), array=array)}" for w in self.bus])
|
||||
|
||||
def get_wire_assign_blif(self, output: bool = False):
|
||||
"""Assign all bits from the bus as each individual wires or assign wires into the corresponding output bus position in Blif code representation.
|
||||
|
||||
Args:
|
||||
output (bool, optional): Specifies whether bus wires are used as outputs (True, assigned to) or as inputs (False, assigned from). Defaults to False.
|
||||
|
||||
Returns:
|
||||
str: Blif code for bus wires assignments.
|
||||
"""
|
||||
return "".join([w.get_assign_blif(prefix=self.prefix+f"[{self.bus.index(w)}]", output=output) for w in self.bus])
|
||||
|
||||
def get_unique_assign_out_wires_blif(self, function_block_out_bus: object):
|
||||
"""Assigns unique output wires to their respective outputs of subcomponent's function block modul in hierarchical Blif subcomponent's invocation.
|
||||
|
||||
Args:
|
||||
function_block_out_bus (object): Specifies output bus of corresponding function block's outputs for proper subcomponent modul invocation.
|
||||
|
||||
Returns:
|
||||
str: Blif code for proper subcomponent's function block invocation with respective output wires assignment.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(w.prefix) if w.prefix not in unique_out_wires else None for w in self.bus]
|
||||
return "".join([f" {function_block_out_bus.get_wire(self.bus.index(o)).name}={unique_out_wires.pop(unique_out_wires.index(o.prefix))}" if o.prefix in unique_out_wires else "" for o in self.bus])</code></pre>
|
||||
</details>
|
||||
<h3>Methods</h3>
|
||||
<dl>
|
||||
<dt id="ariths_gen.wire_components.buses.Bus.bus_extend"><code class="name flex">
|
||||
<span>def <span class="ident">bus_extend</span></span>(<span>self, N: int, prefix: str = 'bus')</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Provides bus extension to contain more wires.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>N</code></strong> : <code>int</code></dt>
|
||||
<dd>Number of wires in the bus. Defaults to 1.</dd>
|
||||
<dt><strong><code>prefix</code></strong> : <code>str</code>, optional</dt>
|
||||
<dd>Prefix name of the bus. Defaults to "bus".</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def bus_extend(self, N: int, prefix: str = "bus"):
|
||||
"""Provides bus extension to contain more wires.
|
||||
|
||||
Args:
|
||||
N (int): Number of wires in the bus. Defaults to 1.
|
||||
prefix (str, optional): Prefix name of the bus. Defaults to "bus".
|
||||
"""
|
||||
# Checks if any extension is neccesarry and if so, proceeds to wire extend the bus
|
||||
if self.N < N:
|
||||
# Adding wires into current bus's wires list (wire names are concatenated from bus prefix and their index position inside the bus in square brackets)
|
||||
self.bus += [Wire(name=prefix+f"[{i}]", prefix=prefix, index=i, parent_bus=self) for i in range(self.N, N)]
|
||||
self.N = N</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.wire_components.buses.Bus.connect"><code class="name flex">
|
||||
<span>def <span class="ident">connect</span></span>(<span>self, bus_wire_index: int, inner_component_out_wire: <a title="ariths_gen.wire_components.wires.Wire" href="wires.html#ariths_gen.wire_components.wires.Wire">Wire</a>, inserted_wire_desired_index: int = -1)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Connects given 'Wire' object to a 'bus_wire_index' within this bus.</p>
|
||||
<p>Used for connection of output wire of the inner circuit component
|
||||
to the appropriate wire of the circuit's output bus.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>bus_wire_index</code></strong> : <code>int</code></dt>
|
||||
<dd>Index in bus to store given wire in.</dd>
|
||||
<dt><strong><code>inner_component_out_wire</code></strong> : <code>Wire</code></dt>
|
||||
<dd>Wire of some other component (mostly its output) to store in the bus.</dd>
|
||||
</dl>
|
||||
<p>inserted_wire_desired_index(int, optional): Optional desired explicit index, where 'inner_component_out_wire' value resides in the inner components's output bus. Otherwise 'inner_component_out_wire' self index value is used. Defaults to -1.</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def connect(self, bus_wire_index: int, inner_component_out_wire: Wire, inserted_wire_desired_index: int = -1):
|
||||
"""Connects given 'Wire' object to a 'bus_wire_index' within this bus.
|
||||
|
||||
Used for connection of output wire of the inner circuit component
|
||||
to the appropriate wire of the circuit's output bus.
|
||||
|
||||
Args:
|
||||
bus_wire_index (int): Index in bus to store given wire in.
|
||||
inner_component_out_wire (Wire): Wire of some other component (mostly its output) to store in the bus.
|
||||
inserted_wire_desired_index(int, optional): Optional desired explicit index, where 'inner_component_out_wire' value resides in the inner components's output bus. Otherwise 'inner_component_out_wire' self index value is used. Defaults to -1.
|
||||
"""
|
||||
inserted_wire_index = inserted_wire_desired_index if inserted_wire_desired_index != -1 else inner_component_out_wire.index
|
||||
# Used for connection of constant wire value into a bus
|
||||
if inner_component_out_wire.is_const():
|
||||
self.bus[bus_wire_index] = inner_component_out_wire
|
||||
# Proper connection of wires that themselves are not yet a member of any other bus and also those that could be part of some bus but do not have `inserted_wire_desired_index` defined
|
||||
elif inner_component_out_wire.parent_bus is None or inserted_wire_desired_index == -1:
|
||||
self.bus[bus_wire_index] = Wire(name=inner_component_out_wire.name, prefix=inner_component_out_wire.prefix, index=inserted_wire_index, value=inner_component_out_wire.value, parent_bus=self)
|
||||
# Proper connection of wires that are already a member of some other bus and are desired to connect value from their previous bus to this one at desired index position
|
||||
elif inserted_wire_desired_index != -1:
|
||||
self.bus[bus_wire_index] = Wire(name=inner_component_out_wire.name, prefix=inner_component_out_wire.parent_bus.prefix, index=inserted_wire_index, value=inner_component_out_wire.value, parent_bus=self)</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.wire_components.buses.Bus.get_declaration_c"><code class="name flex">
|
||||
<span>def <span class="ident">get_declaration_c</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Bus declaration in C code.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>C code for declaration and initialization of bus name.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def get_declaration_c(self):
|
||||
"""Bus declaration in C code.
|
||||
|
||||
Returns:
|
||||
str: C code for declaration and initialization of bus name.
|
||||
"""
|
||||
if self.N > 8:
|
||||
return f" uint64_t {self.prefix} = 0;\n"
|
||||
else:
|
||||
return f" uint8_t {self.prefix} = 0;\n"</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.wire_components.buses.Bus.get_unique_assign_out_wires_blif"><code class="name flex">
|
||||
<span>def <span class="ident">get_unique_assign_out_wires_blif</span></span>(<span>self, function_block_out_bus: object)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Assigns unique output wires to their respective outputs of subcomponent's function block modul in hierarchical Blif subcomponent's invocation.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>function_block_out_bus</code></strong> : <code>object</code></dt>
|
||||
<dd>Specifies output bus of corresponding function block's outputs for proper subcomponent modul invocation.</dd>
|
||||
</dl>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>Blif code for proper subcomponent's function block invocation with respective output wires assignment.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def get_unique_assign_out_wires_blif(self, function_block_out_bus: object):
|
||||
"""Assigns unique output wires to their respective outputs of subcomponent's function block modul in hierarchical Blif subcomponent's invocation.
|
||||
|
||||
Args:
|
||||
function_block_out_bus (object): Specifies output bus of corresponding function block's outputs for proper subcomponent modul invocation.
|
||||
|
||||
Returns:
|
||||
str: Blif code for proper subcomponent's function block invocation with respective output wires assignment.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(w.prefix) if w.prefix not in unique_out_wires else None for w in self.bus]
|
||||
return "".join([f" {function_block_out_bus.get_wire(self.bus.index(o)).name}={unique_out_wires.pop(unique_out_wires.index(o.prefix))}" if o.prefix in unique_out_wires else "" for o in self.bus])</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.wire_components.buses.Bus.get_unique_assign_out_wires_v"><code class="name flex">
|
||||
<span>def <span class="ident">get_unique_assign_out_wires_v</span></span>(<span>self, circuit_block: object)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Returns bus's wires used for hierarchical one bit subcomponent's function block invocation and output wires assignments.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>circuit_block</code></strong> : <code>object</code></dt>
|
||||
<dd>Object describing corresponding function block that is being invoked for proper output wires assignment during instantiation.</dd>
|
||||
</dl>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>Verilog code unique bus wires for proper subcomponent's function block invocation.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def get_unique_assign_out_wires_v(self, circuit_block: object):
|
||||
"""Returns bus's wires used for hierarchical one bit subcomponent's function block invocation and output wires assignments.
|
||||
|
||||
Args:
|
||||
circuit_block (object): Object describing corresponding function block that is being invoked for proper output wires assignment during instantiation.
|
||||
|
||||
Returns:
|
||||
str: Verilog code unique bus wires for proper subcomponent's function block invocation.
|
||||
"""
|
||||
unique_out_wires = []
|
||||
[unique_out_wires.append(w.prefix) if w.prefix not in unique_out_wires else None for w in self.bus]
|
||||
return "".join([f", .{circuit_block.out.get_wire(self.bus.index(o)).prefix}({unique_out_wires.pop(unique_out_wires.index(o.prefix))})" if o.prefix in unique_out_wires else f", .{circuit_block.out.get_wire(self.bus.index(o)).prefix}()" for o in self.bus])</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.wire_components.buses.Bus.get_wire"><code class="name flex">
|
||||
<span>def <span class="ident">get_wire</span></span>(<span>self, wire_index: int = 0)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Retrieves a wire from the bus by a given index.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>wire_index</code></strong> : <code>int</code>, optional</dt>
|
||||
<dd>Index of wire to be retrieved from the bus. Defaults to 0.</dd>
|
||||
</dl>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>Wire</code></dt>
|
||||
<dd>Returning wire from the bus.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def get_wire(self, wire_index: int = 0):
|
||||
"""Retrieves a wire from the bus by a given index.
|
||||
|
||||
Args:
|
||||
wire_index (int, optional): Index of wire to be retrieved from the bus. Defaults to 0.
|
||||
|
||||
Returns:
|
||||
Wire: Returning wire from the bus.
|
||||
"""
|
||||
return self.bus[wire_index]</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.wire_components.buses.Bus.get_wire_assign_blif"><code class="name flex">
|
||||
<span>def <span class="ident">get_wire_assign_blif</span></span>(<span>self, output: bool = False)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Assign all bits from the bus as each individual wires or assign wires into the corresponding output bus position in Blif code representation.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>output</code></strong> : <code>bool</code>, optional</dt>
|
||||
<dd>Specifies whether bus wires are used as outputs (True, assigned to) or as inputs (False, assigned from). Defaults to False.</dd>
|
||||
</dl>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>Blif code for bus wires assignments.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def get_wire_assign_blif(self, output: bool = False):
|
||||
"""Assign all bits from the bus as each individual wires or assign wires into the corresponding output bus position in Blif code representation.
|
||||
|
||||
Args:
|
||||
output (bool, optional): Specifies whether bus wires are used as outputs (True, assigned to) or as inputs (False, assigned from). Defaults to False.
|
||||
|
||||
Returns:
|
||||
str: Blif code for bus wires assignments.
|
||||
"""
|
||||
return "".join([w.get_assign_blif(prefix=self.prefix+f"[{self.bus.index(w)}]", output=output) for w in self.bus])</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.wire_components.buses.Bus.get_wire_declaration_blif"><code class="name flex">
|
||||
<span>def <span class="ident">get_wire_declaration_blif</span></span>(<span>self, array: bool = True)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Declare each wire from the bus independently in Blif code representation.</p>
|
||||
<h2 id="args">Args</h2>
|
||||
<dl>
|
||||
<dt><strong><code>array</code></strong> : <code>bool</code>, optional</dt>
|
||||
<dd>Specifies whether to declare wires from bus by their offset e.g. out[0] or by their wire name e.g. out_0. Defaults to True.</dd>
|
||||
</dl>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>Blif code for declaration of individual bus wires.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def get_wire_declaration_blif(self, array: bool = True):
|
||||
"""Declare each wire from the bus independently in Blif code representation.
|
||||
|
||||
Args:
|
||||
array (bool, optional): Specifies whether to declare wires from bus by their offset e.g. out[0] or by their wire name e.g. out_0. Defaults to True.
|
||||
|
||||
Returns:
|
||||
str: Blif code for declaration of individual bus wires.
|
||||
"""
|
||||
return "".join([f" {w.get_declaration_blif(prefix=self.prefix, offset=self.bus.index(w), array=array)}" for w in self.bus])</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.wire_components.buses.Bus.return_bus_wires_values_c_flat"><code class="name flex">
|
||||
<span>def <span class="ident">return_bus_wires_values_c_flat</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Retrieves values from bus's wires and stores them in bus's corresponding C variable at proper offset bit position in the bus for flat generation.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>C code for assigning wire values into bus represented in C code variable.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def return_bus_wires_values_c_flat(self):
|
||||
"""Retrieves values from bus's wires and stores them in bus's corresponding C variable at proper offset bit position in the bus for flat generation.
|
||||
|
||||
Returns:
|
||||
str: C code for assigning wire values into bus represented in C code variable.
|
||||
"""
|
||||
return "".join([f" {self.prefix} |= {w.return_wire_value_c_flat(offset=self.bus.index(w))}" for w in self.bus])</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.wire_components.buses.Bus.return_bus_wires_values_c_hier"><code class="name flex">
|
||||
<span>def <span class="ident">return_bus_wires_values_c_hier</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Retrieves values from bus's wires and stores them in bus's corresponding C variable at proper offset bit position in the bus for hierarchical generation.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>C code for assigning wire values into bus represented in C code variable.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def return_bus_wires_values_c_hier(self):
|
||||
"""Retrieves values from bus's wires and stores them in bus's corresponding C variable at proper offset bit position in the bus for hierarchical generation.
|
||||
|
||||
Returns:
|
||||
str: C code for assigning wire values into bus represented in C code variable.
|
||||
"""
|
||||
return "".join([f" {self.prefix} |= {w.return_wire_value_c_hier(offset=self.bus.index(w))}" for w in self.bus])</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.wire_components.buses.Bus.return_bus_wires_values_v_flat"><code class="name flex">
|
||||
<span>def <span class="ident">return_bus_wires_values_v_flat</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Retrieves values from bus's wires and stores them in bus's corresponding Verilog variable at proper offset bit position in the bus for flat generation.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>Verilog code for assigning wire values into bus represented in Verilog code bus variable.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def return_bus_wires_values_v_flat(self):
|
||||
"""Retrieves values from bus's wires and stores them in bus's corresponding Verilog variable at proper offset bit position in the bus for flat generation.
|
||||
|
||||
Returns:
|
||||
str: Verilog code for assigning wire values into bus represented in Verilog code bus variable.
|
||||
"""
|
||||
return "".join([f" assign {self.prefix}[{self.bus.index(w)}] = {w.return_wire_value_v_flat()}" for w in self.bus])</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
<dt id="ariths_gen.wire_components.buses.Bus.return_bus_wires_values_v_hier"><code class="name flex">
|
||||
<span>def <span class="ident">return_bus_wires_values_v_hier</span></span>(<span>self)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>Retrieves values from bus's wires and stores them in bus's corresponding Verilog variable at proper offset bit position in the bus for hierarchical generation.</p>
|
||||
<h2 id="returns">Returns</h2>
|
||||
<dl>
|
||||
<dt><code>str</code></dt>
|
||||
<dd>Verilog code for assigning wire values into bus represented in Verilog code variable.</dd>
|
||||
</dl></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def return_bus_wires_values_v_hier(self):
|
||||
"""Retrieves values from bus's wires and stores them in bus's corresponding Verilog variable at proper offset bit position in the bus for hierarchical generation.
|
||||
|
||||
Returns:
|
||||
str: Verilog code for assigning wire values into bus represented in Verilog code variable.
|
||||
"""
|
||||
return "".join([f" assign {self.prefix}[{self.bus.index(w)}] = {w.return_wire_value_v_hier()}" for w in self.bus])</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.wire_components" href="index.html">ariths_gen.wire_components</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<h4><code><a title="ariths_gen.wire_components.buses.Bus" href="#ariths_gen.wire_components.buses.Bus">Bus</a></code></h4>
|
||||
<ul class="">
|
||||
<li><code><a title="ariths_gen.wire_components.buses.Bus.bus_extend" href="#ariths_gen.wire_components.buses.Bus.bus_extend">bus_extend</a></code></li>
|
||||
<li><code><a title="ariths_gen.wire_components.buses.Bus.connect" href="#ariths_gen.wire_components.buses.Bus.connect">connect</a></code></li>
|
||||
<li><code><a title="ariths_gen.wire_components.buses.Bus.get_declaration_c" href="#ariths_gen.wire_components.buses.Bus.get_declaration_c">get_declaration_c</a></code></li>
|
||||
<li><code><a title="ariths_gen.wire_components.buses.Bus.get_unique_assign_out_wires_blif" href="#ariths_gen.wire_components.buses.Bus.get_unique_assign_out_wires_blif">get_unique_assign_out_wires_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.wire_components.buses.Bus.get_unique_assign_out_wires_v" href="#ariths_gen.wire_components.buses.Bus.get_unique_assign_out_wires_v">get_unique_assign_out_wires_v</a></code></li>
|
||||
<li><code><a title="ariths_gen.wire_components.buses.Bus.get_wire" href="#ariths_gen.wire_components.buses.Bus.get_wire">get_wire</a></code></li>
|
||||
<li><code><a title="ariths_gen.wire_components.buses.Bus.get_wire_assign_blif" href="#ariths_gen.wire_components.buses.Bus.get_wire_assign_blif">get_wire_assign_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.wire_components.buses.Bus.get_wire_declaration_blif" href="#ariths_gen.wire_components.buses.Bus.get_wire_declaration_blif">get_wire_declaration_blif</a></code></li>
|
||||
<li><code><a title="ariths_gen.wire_components.buses.Bus.return_bus_wires_values_c_flat" href="#ariths_gen.wire_components.buses.Bus.return_bus_wires_values_c_flat">return_bus_wires_values_c_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.wire_components.buses.Bus.return_bus_wires_values_c_hier" href="#ariths_gen.wire_components.buses.Bus.return_bus_wires_values_c_hier">return_bus_wires_values_c_hier</a></code></li>
|
||||
<li><code><a title="ariths_gen.wire_components.buses.Bus.return_bus_wires_values_v_flat" href="#ariths_gen.wire_components.buses.Bus.return_bus_wires_values_v_flat">return_bus_wires_values_v_flat</a></code></li>
|
||||
<li><code><a title="ariths_gen.wire_components.buses.Bus.return_bus_wires_values_v_hier" href="#ariths_gen.wire_components.buses.Bus.return_bus_wires_values_v_hier">return_bus_wires_values_v_hier</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
77
ariths_gen/wire_components/index.html
Normal file
77
ariths_gen/wire_components/index.html
Normal file
@ -0,0 +1,77 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
|
||||
<meta name="generator" content="pdoc 0.9.2" />
|
||||
<title>ariths_gen.wire_components API documentation</title>
|
||||
<meta name="description" content="" />
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
|
||||
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
|
||||
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
|
||||
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
|
||||
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
|
||||
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
|
||||
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<article id="content">
|
||||
<header>
|
||||
<h1 class="title">Module <code>ariths_gen.wire_components</code></h1>
|
||||
</header>
|
||||
<section id="section-intro">
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">from .wires import Wire, ConstantWireValue0, ConstantWireValue1
|
||||
from .buses import Bus</code></pre>
|
||||
</details>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
|
||||
<dl>
|
||||
<dt><code class="name"><a title="ariths_gen.wire_components.buses" href="buses.html">ariths_gen.wire_components.buses</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
<dt><code class="name"><a title="ariths_gen.wire_components.wires" href="wires.html">ariths_gen.wire_components.wires</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
</article>
|
||||
<nav id="sidebar">
|
||||
<h1>Index</h1>
|
||||
<div class="toc">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3>Super-module</h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen" href="../index.html">ariths_gen</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
|
||||
<ul>
|
||||
<li><code><a title="ariths_gen.wire_components.buses" href="buses.html">ariths_gen.wire_components.buses</a></code></li>
|
||||
<li><code><a title="ariths_gen.wire_components.wires" href="wires.html">ariths_gen.wire_components.wires</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
1313
ariths_gen/wire_components/wires.html
Normal file
1313
ariths_gen/wire_components/wires.html
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user