<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ro">
	<id>http://wiki.dcae.pub.ro/index.php?action=history&amp;feed=atom&amp;title=CID_Aplicatii_5</id>
	<title>CID Aplicatii 5 - Revizia istoricului</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.dcae.pub.ro/index.php?action=history&amp;feed=atom&amp;title=CID_Aplicatii_5"/>
	<link rel="alternate" type="text/html" href="http://wiki.dcae.pub.ro/index.php?title=CID_Aplicatii_5&amp;action=history"/>
	<updated>2026-05-14T06:22:56Z</updated>
	<subtitle>Istoricul versiunilor pentru această pagină din wiki</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>http://wiki.dcae.pub.ro/index.php?title=CID_Aplicatii_5&amp;diff=6909&amp;oldid=prev</id>
		<title>Gvpopescu la 27 martie 2021 10:10</title>
		<link rel="alternate" type="text/html" href="http://wiki.dcae.pub.ro/index.php?title=CID_Aplicatii_5&amp;diff=6909&amp;oldid=prev"/>
		<updated>2021-03-27T10:10:20Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;http://wiki.dcae.pub.ro/index.php?title=CID_Aplicatii_5&amp;amp;diff=6909&amp;amp;oldid=6905&quot;&gt;Afișare diferențe&lt;/a&gt;</summary>
		<author><name>Gvpopescu</name></author>
	</entry>
	<entry>
		<id>http://wiki.dcae.pub.ro/index.php?title=CID_Aplicatii_5&amp;diff=6905&amp;oldid=prev</id>
		<title>Gvpopescu la 26 martie 2021 12:55</title>
		<link rel="alternate" type="text/html" href="http://wiki.dcae.pub.ro/index.php?title=CID_Aplicatii_5&amp;diff=6905&amp;oldid=prev"/>
		<updated>2021-03-26T12:55:57Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ro&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Versiunea anterioară&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Versiunea de la data 26 martie 2021 12:55&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Linia 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Tri-State buffer==&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;1. &lt;/ins&gt;Tri-State buffer==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Tri-State Buffer&amp;#039;&amp;#039;&amp;#039; este un circuit care, prin intermediul unui semnal de enable, controleaza daca intrarea sa va fi conectata la iesire sau nu. In cazul in care semnalul de enable este activ, la iesire va fi conectat semnalul de intrare (se comporta ca un buffer obisnuit). Daca enable nu este activ, iesirea sa va fi pusa in stare de high-Z (high-impendance sau open-circuit), deconectand iesirea de la circuitul la care este conectat.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Tri-State Buffer&amp;#039;&amp;#039;&amp;#039; este un circuit care, prin intermediul unui semnal de enable, controleaza daca intrarea sa va fi conectata la iesire sau nu. In cazul in care semnalul de enable este activ, la iesire va fi conectat semnalul de intrare (se comporta ca un buffer obisnuit). Daca enable nu este activ, iesirea sa va fi pusa in stare de high-Z (high-impendance sau open-circuit), deconectand iesirea de la circuitul la care este conectat.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l74&quot; &gt;Linia 74:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 74:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Realizarea unei unitati de adunare ce are capacitatea de a selecta intre mai multi operanzi==&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;2. &lt;/ins&gt;Realizarea unei unitati de adunare ce are capacitatea de a selecta intre mai multi operanzi==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Fișier:Adder 4 inputs.png]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Fișier:Adder 4 inputs.png]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Gvpopescu</name></author>
	</entry>
	<entry>
		<id>http://wiki.dcae.pub.ro/index.php?title=CID_Aplicatii_5&amp;diff=6904&amp;oldid=prev</id>
		<title>Gvpopescu: Pagină nouă: ==Tri-State buffer== &#039;&#039;&#039;Tri-State Buffer&#039;&#039;&#039; este un circuit care, prin intermediul unui semnal de enable, controleaza daca intrarea sa va fi conectata la iesire sau nu. In cazul in...</title>
		<link rel="alternate" type="text/html" href="http://wiki.dcae.pub.ro/index.php?title=CID_Aplicatii_5&amp;diff=6904&amp;oldid=prev"/>
		<updated>2021-03-26T12:54:47Z</updated>

		<summary type="html">&lt;p&gt;Pagină nouă: ==Tri-State buffer== &amp;#039;&amp;#039;&amp;#039;Tri-State Buffer&amp;#039;&amp;#039;&amp;#039; este un circuit care, prin intermediul unui semnal de enable, controleaza daca intrarea sa va fi conectata la iesire sau nu. In cazul in...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Pagină nouă&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Tri-State buffer==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Tri-State Buffer&amp;#039;&amp;#039;&amp;#039; este un circuit care, prin intermediul unui semnal de enable, controleaza daca intrarea sa va fi conectata la iesire sau nu. In cazul in care semnalul de enable este activ, la iesire va fi conectat semnalul de intrare (se comporta ca un buffer obisnuit). Daca enable nu este activ, iesirea sa va fi pusa in stare de high-Z (high-impendance sau open-circuit), deconectand iesirea de la circuitul la care este conectat.&lt;br /&gt;
&lt;br /&gt;
[[Fișier:Tri-State buffer.png]]&lt;br /&gt;
&lt;br /&gt;
Acest tip de buffer permite mai multor circuite sa foloseasca aceeasi linie de iesire.&lt;br /&gt;
O aplicatie comuna a acestui tip de buffer este conectarea unui circuit la o magistrala bidirectionala. Modalitatea de conectare a unui circuitului la o astfel de magistrala este descrisa in figura urmatoare:&lt;br /&gt;
&lt;br /&gt;
[[Fișier:Connecting Tri-State buffer.png|300px]]&lt;br /&gt;
&lt;br /&gt;
n schema de mai sus, &amp;#039;&amp;#039;&amp;#039;TX&amp;#039;&amp;#039;&amp;#039; reprezinta data ce trebuie transmisa, &amp;#039;&amp;#039;&amp;#039;RX&amp;#039;&amp;#039;&amp;#039; data ce se receptioneaza, &amp;#039;&amp;#039;&amp;#039;data&amp;#039;&amp;#039;&amp;#039; este magistrala bidirectionala, iar &amp;#039;&amp;#039;&amp;#039;direction&amp;#039;&amp;#039;&amp;#039; controleaza directia datelor (circuitul transmite sau receptioneaza). Transmisia si receptia nu se pot face in acelasi timp.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Implementarea Verilog a circuitului de conectare (magistrala pe 8 biti)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Verilog&amp;quot;&amp;gt;&lt;br /&gt;
module Bidirectional(&lt;br /&gt;
    input [7:0] TX,&lt;br /&gt;
    input direction,&lt;br /&gt;
    output [7:0] RX,&lt;br /&gt;
    inout [7:0] data&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
//RX buffer&lt;br /&gt;
assign RX = data;&lt;br /&gt;
//TX Tri-State buffer&lt;br /&gt;
assign data = (direction == 1) ? TX : 8&amp;#039;bZ;&lt;br /&gt;
&lt;br /&gt;
endmodule&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Implementarea Verilog a modulului de test&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Pentru a putea testa un circuit care contine un Tri-State buffer (un semnal de tip inout), trebuie sa procedam astfel: In modulul de test, pentru fiecare intrare se defineste un reg si pentru fiecare iesire se defineste un wire. Pentru fiecare semnal de tip inout se definesc doua semnale: un wire (aici, &amp;#039;&amp;#039;&amp;#039;data_t&amp;#039;&amp;#039;&amp;#039;), ce va fi conectat la modulul testat, si un reg (aici, &amp;#039;&amp;#039;&amp;#039;data_in_t&amp;#039;&amp;#039;&amp;#039;), ce va fi conectat printr-un Tri-State buffer (enable inversat fata de cel din modulul testat) la semnalul de tip wire (aici, &amp;#039;&amp;#039;&amp;#039;data_t&amp;#039;&amp;#039;&amp;#039;). Vom folosi acest reg pentru a genera stimuli in timpul simularii unei receptii.&lt;br /&gt;
&lt;br /&gt;
[[Fișier:Tri-State buffer TB.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Verilog&amp;quot;&amp;gt;&lt;br /&gt;
`timescale 1ns/1ps&lt;br /&gt;
&lt;br /&gt;
module Bidirectional_TB();&lt;br /&gt;
&lt;br /&gt;
reg [7:0] TX_t;&lt;br /&gt;
reg direction_t;&lt;br /&gt;
wire [7:0] RX_t;&lt;br /&gt;
wire [7:0] data_t;&lt;br /&gt;
reg [7:0] data_in_t;&lt;br /&gt;
&lt;br /&gt;
assign data_t = (direction_t == 0) ? data_in_t : 8&amp;#039;dZ;&lt;br /&gt;
&lt;br /&gt;
initial begin&lt;br /&gt;
       data_in_t = 8&amp;#039;d0;&lt;br /&gt;
       TX_t = 8&amp;#039;d1;&lt;br /&gt;
       direction_t = 1; //transmitere&lt;br /&gt;
    #2 data_in_t = 8&amp;#039;d7;&lt;br /&gt;
       direction_t = 0; //receptie&lt;br /&gt;
    #2 TX_t = 8&amp;#039;d3;&lt;br /&gt;
       direction_t = 1; //transmitere&lt;br /&gt;
    #5 $stop();&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Bidirectional DUT(&lt;br /&gt;
    .TX(TX_t),&lt;br /&gt;
    .direction(direction_t),&lt;br /&gt;
    .RX(RX_t),&lt;br /&gt;
    .data(data_t)&lt;br /&gt;
);&lt;br /&gt;
endmodule&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Observatii&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;1. &amp;#039;&amp;#039;&amp;#039;Semnalul &amp;#039;&amp;#039;&amp;#039;data&amp;#039;&amp;#039;&amp;#039; ia valoarea lui &amp;#039;&amp;#039;&amp;#039;TX&amp;#039;&amp;#039;&amp;#039; atunci cand &amp;#039;&amp;#039;&amp;#039;direction&amp;#039;&amp;#039;&amp;#039; este 1. De asemenea, &amp;#039;&amp;#039;&amp;#039;RX&amp;#039;&amp;#039;&amp;#039; ia valoarea lui TX deoarece este conectat la data printr-un buffer simplu. Valoarea lui &amp;#039;&amp;#039;&amp;#039;RX&amp;#039;&amp;#039;&amp;#039; va trebui sa fie ignorata de circuit atunci cand &amp;#039;&amp;#039;&amp;#039;direction&amp;#039;&amp;#039;&amp;#039; este 1 (transmisie). &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;2.&amp;#039;&amp;#039;&amp;#039; Atunci cand &amp;#039;&amp;#039;&amp;#039;direction&amp;#039;&amp;#039;&amp;#039; este 0 avem o receptie, &amp;#039;&amp;#039;&amp;#039;data&amp;#039;&amp;#039;&amp;#039; si &amp;#039;&amp;#039;&amp;#039;RX&amp;#039;&amp;#039;&amp;#039; actualizandu-se cu valoarea lui &amp;#039;&amp;#039;&amp;#039;data_in_t&amp;#039;&amp;#039;&amp;#039;, care simuleaza un alt modul ce transmite catre circuitul testat. &amp;#039;&amp;#039;&amp;#039;TX&amp;#039;&amp;#039;&amp;#039; nu se modifica in acest caz deoarece este deconectat de catre Tri-State buffer de la magistrala &amp;#039;&amp;#039;&amp;#039;data&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Realizarea unei unitati de adunare ce are capacitatea de a selecta intre mai multi operanzi==&lt;br /&gt;
&lt;br /&gt;
[[Fișier:Adder 4 inputs.png]]&lt;br /&gt;
&lt;br /&gt;
Circuitul ALU este format din trei module: doua multiplexoare identice (&amp;#039;&amp;#039;&amp;#039;M1&amp;#039;&amp;#039;&amp;#039; si &amp;#039;&amp;#039;&amp;#039;M2&amp;#039;&amp;#039;&amp;#039;) si un modul de adunare (&amp;#039;&amp;#039;&amp;#039;ADD&amp;#039;&amp;#039;&amp;#039;).&lt;br /&gt;
Modulul &amp;#039;&amp;#039;&amp;#039;MUX&amp;#039;&amp;#039;&amp;#039; are doua intrari pe 8 biti, selectand la iesire una dintre acestea pe baza intrarii de selectie (&amp;#039;&amp;#039;&amp;#039;SEL&amp;#039;&amp;#039;&amp;#039;). De exemplu, daca &amp;#039;&amp;#039;&amp;#039;SEL&amp;#039;&amp;#039;&amp;#039; este 0, iesirea multiplexorului va fi &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;. Daca &amp;#039;&amp;#039;&amp;#039;SEL&amp;#039;&amp;#039;&amp;#039; este 1, iesirea multiplexorului este &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Sumatorul &amp;#039;&amp;#039;&amp;#039;ADD&amp;#039;&amp;#039;&amp;#039; va folosi ca operanzi cele doua iesiri ale multiplexoarelor. Daca &amp;#039;&amp;#039;&amp;#039;SEL&amp;#039;&amp;#039;&amp;#039; este 0, &amp;#039;&amp;#039;&amp;#039;M1&amp;#039;&amp;#039;&amp;#039; va avea la iesire &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;, iar &amp;#039;&amp;#039;&amp;#039;M2&amp;#039;&amp;#039;&amp;#039; va avea la iesire &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;. Asadar, operanzii sumatorului vor fi &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039; si &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;, iar iesirea modulului &amp;#039;&amp;#039;&amp;#039;ALU&amp;#039;&amp;#039;&amp;#039; va fi &amp;#039;&amp;#039;&amp;#039;A + C&amp;#039;&amp;#039;&amp;#039;. Daca &amp;#039;&amp;#039;&amp;#039;SEL&amp;#039;&amp;#039;&amp;#039; este 1, &amp;#039;&amp;#039;&amp;#039;M1&amp;#039;&amp;#039;&amp;#039; va avea la iesire &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;, iar &amp;#039;&amp;#039;&amp;#039;M2&amp;#039;&amp;#039;&amp;#039; va avea la iesire &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;. Asadar, operanzii sumatorului vor fi &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039; si &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;, iar iesirea modulului &amp;#039;&amp;#039;&amp;#039;ALU&amp;#039;&amp;#039;&amp;#039; va fi &amp;#039;&amp;#039;&amp;#039;B + D&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Implementarea Verilog a modulului MUX&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Verilog&amp;quot;&amp;gt;&lt;br /&gt;
module MUX(&lt;br /&gt;
    input [7:0] in0,&lt;br /&gt;
    input [7:0] in1,&lt;br /&gt;
    input sel,&lt;br /&gt;
    output [7:0] out&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
assign out = (sel == 0) ? in0 : in1;&lt;br /&gt;
&lt;br /&gt;
endmodule&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Implementarea Verilog a modulului Adder&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Verilog&amp;quot;&amp;gt;&lt;br /&gt;
module Adder(&lt;br /&gt;
    input [7:0] in0,&lt;br /&gt;
    input [7:0] in1,&lt;br /&gt;
    output [7:0] sum&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
assign sum = in0 + in1;&lt;br /&gt;
&lt;br /&gt;
endmodule&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Implementarea Verilog a modulului ALU&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Verilog&amp;quot;&amp;gt;&lt;br /&gt;
module ALU(&lt;br /&gt;
    input [7:0] A,&lt;br /&gt;
    input [7:0] B,&lt;br /&gt;
    input [7:0] C,&lt;br /&gt;
    input [7:0] D,&lt;br /&gt;
    input SEL,&lt;br /&gt;
    output [7:0] OUT&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
wire [7:0] w1, w2;&lt;br /&gt;
&lt;br /&gt;
MUX M1(&lt;br /&gt;
    .in0(A),&lt;br /&gt;
    .in1(B),&lt;br /&gt;
    .sel(SEL),&lt;br /&gt;
    .out(w1)&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
MUX M2(&lt;br /&gt;
    .in0(C),&lt;br /&gt;
    .in1(D),&lt;br /&gt;
    .sel(SEL),&lt;br /&gt;
    .out(w2)&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
Adder ADD(&lt;br /&gt;
    .in0(w1),&lt;br /&gt;
    .in1(w2),&lt;br /&gt;
    .sum(OUT)&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
endmodule&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Implementarea Verilog a modulului de test&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Verilog&amp;quot;&amp;gt;&lt;br /&gt;
module ALU_TB();&lt;br /&gt;
&lt;br /&gt;
reg [7:0] A_t, B_t, C_t, D_t;&lt;br /&gt;
reg SEL_t;&lt;br /&gt;
wire OUT_t;&lt;br /&gt;
&lt;br /&gt;
initial begin&lt;br /&gt;
      A_t = 8&amp;#039;b00000001;&lt;br /&gt;
      B_t = 8&amp;#039;b00000101;&lt;br /&gt;
      C_t = 8&amp;#039;b00001111;&lt;br /&gt;
      D_t = 8&amp;#039;b00001101;&lt;br /&gt;
      SEL_t = 0;&lt;br /&gt;
   #1 SEL_t = 1;&lt;br /&gt;
   #1 B_t = 8&amp;#039;b00000000;&lt;br /&gt;
      A_t = 8&amp;#039;b00000011;&lt;br /&gt;
   #1 SEL_t = 0;&lt;br /&gt;
   #1 $stop();&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
ALU DUT(&lt;br /&gt;
    .A(A_t),&lt;br /&gt;
    .B(B_t),&lt;br /&gt;
    .C(C_t),&lt;br /&gt;
    .D(D_t),&lt;br /&gt;
    .SEL(SEL_t),&lt;br /&gt;
    .OUT(OUT_t)&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gvpopescu</name></author>
	</entry>
</feed>