<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://old.hacdc.org/index.php?action=history&amp;feed=atom&amp;title=FPGAExercise3</id>
	<title>FPGAExercise3 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://old.hacdc.org/index.php?action=history&amp;feed=atom&amp;title=FPGAExercise3"/>
	<link rel="alternate" type="text/html" href="https://old.hacdc.org/index.php?title=FPGAExercise3&amp;action=history"/>
	<updated>2026-05-07T18:55:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://old.hacdc.org/index.php?title=FPGAExercise3&amp;diff=2402&amp;oldid=prev</id>
		<title>Williamgibb at 00:48, 29 October 2009</title>
		<link rel="alternate" type="text/html" href="https://old.hacdc.org/index.php?title=FPGAExercise3&amp;diff=2402&amp;oldid=prev"/>
		<updated>2009-10-29T00:48:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:48, 29 October 2009&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-l65&quot;&gt;Line 65:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 65:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;give it a module name different than the name of the provided module.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;give it a module name different than the name of the provided module.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&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;6) &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Write &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;behavioral description of a full adder from examples in the slides&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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;6) &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Take &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;break if you feel needed.&lt;/ins&gt;..&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;or keep on coding&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&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;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Give this full adder module a different module name than other model names&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;7) Write a 4 bit full adder module using the new 1 bit full adder from step 6.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;7) Write a 4 bit full adder module using the new 1 bit full adder from step 6.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Williamgibb</name></author>
	</entry>
	<entry>
		<id>https://old.hacdc.org/index.php?title=FPGAExercise3&amp;diff=2400&amp;oldid=prev</id>
		<title>Obscurite at 21:46, 28 October 2009</title>
		<link rel="alternate" type="text/html" href="https://old.hacdc.org/index.php?title=FPGAExercise3&amp;diff=2400&amp;oldid=prev"/>
		<updated>2009-10-28T21:46:29Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:46, 28 October 2009&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-l137&quot;&gt;Line 137:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 137:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;        // instantiate 1-bit adders&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;        // instantiate 1-bit adders&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&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;        &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;full_adderFA0&lt;/del&gt;(a[0],b[0], cin, sum[0], c1);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;full_adder FA0&lt;/ins&gt;(a[0],b[0], cin, sum[0], c1);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&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;        &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;full_adderFA1&lt;/del&gt;(a[1],b[1], c1, sum[1], c2);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;full_adder FA1&lt;/ins&gt;(a[1],b[1], c1, sum[1], c2);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&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;        &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;full_adderFA2&lt;/del&gt;(a[2],b[2], c2, sum[2], c3);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;full_adder FA2&lt;/ins&gt;(a[2],b[2], c2, sum[2], c3);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&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;        &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;full_adderFA3&lt;/del&gt;(a[3],b[3], c3, sum[3], cout);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;full_adder FA3&lt;/ins&gt;(a[3],b[3], c3, sum[3], cout);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;endmodule&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;endmodule&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Obscurite</name></author>
	</entry>
	<entry>
		<id>https://old.hacdc.org/index.php?title=FPGAExercise3&amp;diff=2393&amp;oldid=prev</id>
		<title>Williamgibb at 01:21, 28 October 2009</title>
		<link rel="alternate" type="text/html" href="https://old.hacdc.org/index.php?title=FPGAExercise3&amp;diff=2393&amp;oldid=prev"/>
		<updated>2009-10-28T01:21:33Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 01:21, 28 October 2009&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-l46&quot;&gt;Line 46:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 46:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;0) Copy the full adder codes below to files in your working directory.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;0) Copy the full adder codes below to files in your working directory.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;Be sure to copy a makefile to the directory.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;Be sure to copy a makefile to the directory.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;0.a) mkdir a new directory for this example.  name it something useful, such as &quot;adder_exercise&quot;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;0.b) create a new file for each verilog module, in the form modulename.v where module name is the name of the module. We&#039;ll need full_adder.v, full_adder_4bit.v, add test_adder.v.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;0.c) copy and paste the code for each module into the file.  be sure that anything in the file that isn&#039;t verilog code is commented out.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;0.d) if your in the vm, type copymake.sh into the command line to copy a makefile into your working directory&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;1) Change the values of the makefile to test the full adder.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;1) Change the values of the makefile to test the full adder.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;1.a) Change the line SRC and TESTBENCH to include only the .v files created earlier.  if you need to add a new source to a project, add it to your makefile as well.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;2) Verify the full adder works by simulation.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;2) Verify the full adder works by simulation.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Williamgibb</name></author>
	</entry>
	<entry>
		<id>https://old.hacdc.org/index.php?title=FPGAExercise3&amp;diff=2385&amp;oldid=prev</id>
		<title>Williamgibb at 05:55, 25 October 2009</title>
		<link rel="alternate" type="text/html" href="https://old.hacdc.org/index.php?title=FPGAExercise3&amp;diff=2385&amp;oldid=prev"/>
		<updated>2009-10-25T05:55:02Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 05:55, 25 October 2009&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-l246&quot;&gt;Line 246:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 246:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;endmodule&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;endmodule&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:FPGAWorkshop]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Williamgibb</name></author>
	</entry>
	<entry>
		<id>https://old.hacdc.org/index.php?title=FPGAExercise3&amp;diff=2371&amp;oldid=prev</id>
		<title>Obscurite at 01:39, 22 October 2009</title>
		<link rel="alternate" type="text/html" href="https://old.hacdc.org/index.php?title=FPGAExercise3&amp;diff=2371&amp;oldid=prev"/>
		<updated>2009-10-22T01:39:15Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 01:39, 22 October 2009&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-l170&quot;&gt;Line 170:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 170:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;                // sum = 1000, cout= 0&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;                // sum = 1000, cout= 0&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;        end // initial begin&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;        end // initial begin&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        initial&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        begin&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;                $dumpfile (&quot;waves.lxt&quot;);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;                $dumpvars(0,test_adder);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;endmodule// test_adder&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;endmodule// test_adder&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Obscurite</name></author>
	</entry>
	<entry>
		<id>https://old.hacdc.org/index.php?title=FPGAExercise3&amp;diff=2369&amp;oldid=prev</id>
		<title>Williamgibb: Page created</title>
		<link rel="alternate" type="text/html" href="https://old.hacdc.org/index.php?title=FPGAExercise3&amp;diff=2369&amp;oldid=prev"/>
		<updated>2009-10-21T22:46:10Z</updated>

		<summary type="html">&lt;p&gt;Page created&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;
Digital Design and FPPGA Workshop&lt;br /&gt;
HacDC&lt;br /&gt;
William Gibb (teachmeFPGA@gmail.com)&lt;br /&gt;
Week 3 - Introduction to Combinatorial Verilog&lt;br /&gt;
Full adder and ALU exercise&lt;br /&gt;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;
&lt;br /&gt;
For our exercises this week, we&amp;#039;ll be working with a few different modeling&lt;br /&gt;
styles, focused around a 4-bit full adder.  We&amp;#039;ll be working with a model&lt;br /&gt;
where the 1 bit full adder circuit is explicitly defined, and break that down&lt;br /&gt;
into half adders, behavioral and structural models.&lt;br /&gt;
&lt;br /&gt;
The full adder circuit can be constructed from 1-bit half adder circuits.&lt;br /&gt;
The truth table for the half adder is as follows.&lt;br /&gt;
A B | S Cout&lt;br /&gt;
=========&lt;br /&gt;
0 0 | 0 0&lt;br /&gt;
0 1 | 1 0&lt;br /&gt;
1 0 | 1 0&lt;br /&gt;
1 1 | 0 1&lt;br /&gt;
=========&lt;br /&gt;
S = A xor B&lt;br /&gt;
Cout = A and B&lt;br /&gt;
&lt;br /&gt;
Two of these cells, plus an additional OR gate, can be used to implement a&lt;br /&gt;
full adder.  The S output of the first half adder cell is connected to the&lt;br /&gt;
input of the second cell, as is the Cin.  The S output of the second cell is&lt;br /&gt;
the sum S.  The Cout is computed by ORing the Cout of both cells.&lt;br /&gt;
&lt;br /&gt;
Likewise, the truth table for the Full Adder is as follows, for reference.&lt;br /&gt;
Cin A B | S Cout&lt;br /&gt;
===============&lt;br /&gt;
 0 0 0 | 0 0&lt;br /&gt;
 0 0 1 | 1 0&lt;br /&gt;
 0 1 0 | 1 0&lt;br /&gt;
 0 1 1 | 0 1&lt;br /&gt;
 1 0 0 | 1 0&lt;br /&gt;
 1 0 1 | 0 1&lt;br /&gt;
 1 1 0 | 0 1&lt;br /&gt;
 1 1 1 | 1 1&lt;br /&gt;
================&lt;br /&gt;
&lt;br /&gt;
To do&lt;br /&gt;
0) Copy the full adder codes below to files in your working directory.&lt;br /&gt;
Be sure to copy a makefile to the directory.&lt;br /&gt;
&lt;br /&gt;
1) Change the values of the makefile to test the full adder.&lt;br /&gt;
&lt;br /&gt;
2) Verify the full adder works by simulation.&lt;br /&gt;
&lt;br /&gt;
3) Write a description of the half adder, at gate level&lt;br /&gt;
&lt;br /&gt;
4) Write a full adder description, using the half adders you wrote in step&lt;br /&gt;
3.  Give this full adder module a different module name than the provided&lt;br /&gt;
model.&lt;br /&gt;
&lt;br /&gt;
5) Write a 4 bit full adder module using the new 1 bit full adder.  Be sure to&lt;br /&gt;
give it a module name different than the name of the provided module.&lt;br /&gt;
&lt;br /&gt;
6) Write a behavioral description of a full adder from examples in the slides.&lt;br /&gt;
Give this full adder module a different module name than other model names.&lt;br /&gt;
&lt;br /&gt;
7) Write a 4 bit full adder module using the new 1 bit full adder from step 6.&lt;br /&gt;
Be sure to give it a module name different than the name of the provided&lt;br /&gt;
 module.&lt;br /&gt;
&lt;br /&gt;
8) One last adder - Write a 4 bit behavioral adder module.  Use 4 bit inputs&lt;br /&gt;
and outputs in this module.  Again, give it a new name.&lt;br /&gt;
&lt;br /&gt;
9) Add the new models to the makefile.&lt;br /&gt;
       -half adder&lt;br /&gt;
       -full adder from half adders&lt;br /&gt;
       -4 bit full adder from step 5&lt;br /&gt;
       -full adder from step 6&lt;br /&gt;
       -4 bit full adder from step 7&lt;br /&gt;
       -4 bit full adder from step 8&lt;br /&gt;
&lt;br /&gt;
9) Modify the testbench to instantiate the new modules.  You&amp;#039;ll need to&lt;br /&gt;
instantiate the 4 bit full adder from step 5, step 7 and step 8.  This is why&lt;br /&gt;
they all need to have unique module names.  You&amp;#039;ll need to add three 4 bit&lt;br /&gt;
wires for connecting the sum output of these new adders, as well as&lt;br /&gt;
three 1 bit wires for connecting the cout output of these new adders.&lt;br /&gt;
&lt;br /&gt;
10) Simulate and verify all of the models behave the same way.&lt;br /&gt;
&lt;br /&gt;
Once this is done, and you have simulated the adders and shown that they all&lt;br /&gt;
behave the same way, you&amp;#039;ll have built the following types of modules&lt;br /&gt;
- Structural Model (step 5)&lt;br /&gt;
- Behavioral &amp;amp; Hierarchical Model (step 7)&lt;br /&gt;
- Behavioral Model (step 8)&lt;br /&gt;
&lt;br /&gt;
After that is done, people are encouraged to take the ALU presented in the&lt;br /&gt;
slides and are encouraged to expand the functionality of the ALU to 8 total&lt;br /&gt;
functions.  The functions that should be added to the ALU are as follows:&lt;br /&gt;
- r = ~A (R equals the complement of A)&lt;br /&gt;
- r = A ^ B (R equals A xor B)&lt;br /&gt;
- r = A &amp;lt;&amp;lt; B (R equals A left shifted B bits)&lt;br /&gt;
&lt;br /&gt;
After this functionality has been added to the ALU model, the test bench used&lt;br /&gt;
for the 4 bit full adder can be modified to simulate the ALU.&lt;br /&gt;
Steps to do this&lt;br /&gt;
0) Copy the test bench and makefile to your working directory&lt;br /&gt;
1) Add/remove wires and regs as needed&lt;br /&gt;
2) Replace the DUT with the ALU&lt;br /&gt;
3) Expand the inputs in order to test all of the ALU functions.&lt;br /&gt;
&lt;br /&gt;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;
Full Adder Code&lt;br /&gt;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;
module full_adder(a, b, cin, sum, cout);&lt;br /&gt;
       input    a, b, cin;&lt;br /&gt;
       output  sum, cout;&lt;br /&gt;
&lt;br /&gt;
       reg sum, cout;&lt;br /&gt;
&lt;br /&gt;
       always @(a or b or cin)&lt;br /&gt;
       begin&lt;br /&gt;
               sum = a ^ b ^ cin;&lt;br /&gt;
               cout= (a &amp;amp; b) | (a &amp;amp; cin) | (b &amp;amp; cin);&lt;br /&gt;
       end&lt;br /&gt;
endmodule&lt;br /&gt;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;
module full_adder_4bit (a, b, cin, sum, cout);&lt;br /&gt;
       input[3:0]    a, b;&lt;br /&gt;
       input           cin;&lt;br /&gt;
       output [3:0] sum;&lt;br /&gt;
       output cout;&lt;br /&gt;
&lt;br /&gt;
       wire            c1, c2, c3;&lt;br /&gt;
&lt;br /&gt;
       // instantiate 1-bit adders&lt;br /&gt;
       full_adderFA0(a[0],b[0], cin, sum[0], c1);&lt;br /&gt;
       full_adderFA1(a[1],b[1], c1, sum[1], c2);&lt;br /&gt;
       full_adderFA2(a[2],b[2], c2, sum[2], c3);&lt;br /&gt;
       full_adderFA3(a[3],b[3], c3, sum[3], cout);&lt;br /&gt;
&lt;br /&gt;
endmodule&lt;br /&gt;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;
module test_adder;&lt;br /&gt;
       reg[3:0]  a, b;&lt;br /&gt;
       reg cin;&lt;br /&gt;
       wire [3:0] sum;&lt;br /&gt;
       wire         cout;&lt;br /&gt;
&lt;br /&gt;
       full_adder_4bit dut(a, b, cin,&lt;br /&gt;
       sum, cout);&lt;br /&gt;
&lt;br /&gt;
       initial&lt;br /&gt;
       begin&lt;br /&gt;
               a = 4&amp;#039;b0000;&lt;br /&gt;
               b = 4&amp;#039;b0000;&lt;br /&gt;
               cin= 1&amp;#039;b0;&lt;br /&gt;
               #50;&lt;br /&gt;
               a = 4&amp;#039;b0101;&lt;br /&gt;
               b = 4&amp;#039;b1010;&lt;br /&gt;
               // sum = 1111, cout= 0&lt;br /&gt;
               #50;&lt;br /&gt;
               a = 4&amp;#039;b1111;&lt;br /&gt;
               b = 4&amp;#039;b0001;&lt;br /&gt;
               // sum = 0000, cout= 1&lt;br /&gt;
               #50;a = 4&amp;#039;b0000;&lt;br /&gt;
               b = 4&amp;#039;b1111;&lt;br /&gt;
               cin= 1&amp;#039;b1;&lt;br /&gt;
               // sum = 0000, cout= 1&lt;br /&gt;
               #50;&lt;br /&gt;
               a = 4&amp;#039;b0110;&lt;br /&gt;
               b = 4&amp;#039;b0001;&lt;br /&gt;
               // sum = 1000, cout= 0&lt;br /&gt;
       end // initial begin&lt;br /&gt;
endmodule// test_adder&lt;br /&gt;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;
ALU Code&lt;br /&gt;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;
module mul16(i0,i1,prod);&lt;br /&gt;
       input [15:0] i0,i1;&lt;br /&gt;
       output [31:0] prod;&lt;br /&gt;
       // this is a magnitude multiplier&lt;br /&gt;
       // signed arithmetic later&lt;br /&gt;
       assign prod = i0 * i1;&lt;br /&gt;
endmodule&lt;br /&gt;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;
module add32(i0,i1,sum);&lt;br /&gt;
       input [31:0] i0,i1;&lt;br /&gt;
       output [31:0] sum;&lt;br /&gt;
       assign sum = i0 + i1;&lt;br /&gt;
endmodule&lt;br /&gt;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;
module sub32(i0,i1,diff);&lt;br /&gt;
       input [31:0] i0,i1;&lt;br /&gt;
       output [31:0] diff;&lt;br /&gt;
       assign diff = i0 - i1;&lt;br /&gt;
endmodule&lt;br /&gt;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;
module mux32two(i0,i1,sel,out);&lt;br /&gt;
       input [31:0] i0,i1;&lt;br /&gt;
       input sel;&lt;br /&gt;
       output [31:0] out;&lt;br /&gt;
&lt;br /&gt;
       assign out = sel? i1 : i0;&lt;br /&gt;
endmodule&lt;br /&gt;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;
module mux32three(i0,i1,i2,sel,out);&lt;br /&gt;
       input [31:0] i0,i1,i2;&lt;br /&gt;
       input [1:0] sel;&lt;br /&gt;
       output [31:0] out;&lt;br /&gt;
&lt;br /&gt;
       reg[31:0] out;&lt;br /&gt;
&lt;br /&gt;
       always @ (i0 or i1 or i2 or sel)&lt;br /&gt;
       begin&lt;br /&gt;
               case (sel)&lt;br /&gt;
               2’b00: out = i0;&lt;br /&gt;
               2’b01: out = i1;&lt;br /&gt;
               2’b10: out = i2;&lt;br /&gt;
               default: out = 32’bx;&lt;br /&gt;
               endcase&lt;br /&gt;
       end&lt;br /&gt;
endmodule&lt;br /&gt;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;
module alu(a, b, f, r);&lt;br /&gt;
       input [31:0] a, b;&lt;br /&gt;
       input [2:0] f;&lt;br /&gt;
       output [31:0] r;&lt;br /&gt;
&lt;br /&gt;
       // wire declarations&lt;br /&gt;
       wire [31:0] addmux_out, submux_out;&lt;br /&gt;
       wire [31:0] add_out, sub_out, mul_out;&lt;br /&gt;
&lt;br /&gt;
       // module declarations&lt;br /&gt;
       mux32two   adder_mux(b, 32&amp;#039;d1, f[0], addmux_out);&lt;br /&gt;
       mux32two   sub_mux(b, 32&amp;#039;d1, f[0], submux_out);&lt;br /&gt;
       add32      our_adder(a, addmux_out, add_out);&lt;br /&gt;
       sub32      our_subtracter(a, submux_out, sub_out);&lt;br /&gt;
       mul16      our_multiplier(a[15:0], b[15:0], mul_out);&lt;br /&gt;
       mux32three output_mux(add_out, sub_out, mul_out, f[2:1], r);&lt;br /&gt;
&lt;br /&gt;
endmodule&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Williamgibb</name></author>
	</entry>
</feed>