<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://strudel.pld.ttu.ee/wiki/e/index.php?action=history&amp;feed=atom&amp;title=Non-Pipelined_Version</id>
		<title>Non-Pipelined Version - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://strudel.pld.ttu.ee/wiki/e/index.php?action=history&amp;feed=atom&amp;title=Non-Pipelined_Version"/>
		<link rel="alternate" type="text/html" href="https://strudel.pld.ttu.ee/wiki/e/index.php?title=Non-Pipelined_Version&amp;action=history"/>
		<updated>2026-04-17T07:13:20Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.4</generator>

	<entry>
		<id>https://strudel.pld.ttu.ee/wiki/e/index.php?title=Non-Pipelined_Version&amp;diff=2063&amp;oldid=prev</id>
		<title>Siavoosh: /* The User Constraint File (UCF) */</title>
		<link rel="alternate" type="text/html" href="https://strudel.pld.ttu.ee/wiki/e/index.php?title=Non-Pipelined_Version&amp;diff=2063&amp;oldid=prev"/>
				<updated>2015-02-28T16:52:40Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;The User Constraint File (UCF)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 16:52, 28 February 2015&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-l222&quot; &gt;Line 222:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 222:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Important note''': Make sure you set the &amp;quot;FPGA Start-Up Clock&amp;quot; to &amp;quot;JTAG Clock&amp;quot;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Important note''': Make sure you set the &amp;quot;FPGA Start-Up Clock&amp;quot; to &amp;quot;JTAG Clock&amp;quot;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==The User Constraint File (UCF)==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==The User Constraint File (UCF)==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;The following is the user constraints file for the project:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;The following is the user constraints file for the project &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(for Nexys-3 boards)&lt;/ins&gt;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;javascript&amp;quot; collapse=&amp;quot;true&amp;quot; first-line=&amp;quot;1&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;javascript&amp;quot; collapse=&amp;quot;true&amp;quot; first-line=&amp;quot;1&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;NET clk LOC = V10;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;NET clk LOC = V10;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Siavoosh</name></author>	</entry>

	<entry>
		<id>https://strudel.pld.ttu.ee/wiki/e/index.php?title=Non-Pipelined_Version&amp;diff=2062&amp;oldid=prev</id>
		<title>Siavoosh: /* VHDL complete versions */</title>
		<link rel="alternate" type="text/html" href="https://strudel.pld.ttu.ee/wiki/e/index.php?title=Non-Pipelined_Version&amp;diff=2062&amp;oldid=prev"/>
				<updated>2015-02-28T16:38:53Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;VHDL complete versions&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 16:38, 28 February 2015&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-l161&quot; &gt;Line 161:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 161:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== VHDL complete versions===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== VHDL complete versions===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[:File:PicoCPU_VHDL_8Bit.zip|8-bit Version]]&amp;#160; (17 dec 2014)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[:File:PicoCPU_VHDL_8Bit.zip|8-bit Version]]&amp;#160; (17 dec 2014)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;* 16-bit Version&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;* 32-bit Version&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Functional Testing=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Functional Testing=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Siavoosh</name></author>	</entry>

	<entry>
		<id>https://strudel.pld.ttu.ee/wiki/e/index.php?title=Non-Pipelined_Version&amp;diff=2061&amp;oldid=prev</id>
		<title>Siavoosh: Created page with &quot; Fig 1: System Architecture The Non-pipelined version is the simplest version of PicoCPU. The architecture of this  Imp...&quot;</title>
		<link rel="alternate" type="text/html" href="https://strudel.pld.ttu.ee/wiki/e/index.php?title=Non-Pipelined_Version&amp;diff=2061&amp;oldid=prev"/>
				<updated>2015-02-28T12:07:23Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&lt;a href=&quot;/wiki/e/index.php/File:System_Diagram.png&quot; title=&quot;File:System Diagram.png&quot;&gt; Fig 1: System Architecture&lt;/a&gt; The Non-pipelined version is the simplest version of PicoCPU. The architecture of this  Imp...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[File:System_Diagram.png|400px|thumb|right|alt= text| Fig 1: System Architecture]]&lt;br /&gt;
The Non-pipelined version is the simplest version of PicoCPU. The architecture of this &lt;br /&gt;
Implementation is shown in the fig. 1.&lt;br /&gt;
=System Components=&lt;br /&gt;
=== DataPath unit===&lt;br /&gt;
[[File:DPU.jpg|350px|thumb|right|alt= text| Fig 2: DPU block diagram]]&lt;br /&gt;
Datapath unit includes an Arithmetic Logical Unit (ALU), one Accumulator(ACC) and one general purpose register(Register B) and 2 multiplexers along with the flags (see Fig. 2).  &lt;br /&gt;
The DPU command is formed as following:&lt;br /&gt;
&lt;br /&gt;
[[File:DPUCommand.png|400px]]&lt;br /&gt;
&lt;br /&gt;
====ALU Multiplexer====&lt;br /&gt;
The ALU multiplexer chooses the inputs according to the table 1.&lt;br /&gt;
 &lt;br /&gt;
{| class=&amp;quot;wikitable floatright&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|+ Table 1: ALU Mux &lt;br /&gt;
! !! command !! output&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||  00   || MemDATA&lt;br /&gt;
|-&lt;br /&gt;
| 2 ||  01   || ControlDATa&lt;br /&gt;
|-&lt;br /&gt;
| 3 ||  10   || B&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||  11   || 1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Register File====&lt;br /&gt;
[[File:RegisterSet.png|250px|thumb|right|alt= text| Fig 3: Register File Schematic]]&lt;br /&gt;
The schematic of register file is show in figure 3. The Input multiplexer chooses the inputs according to the table 2.&lt;br /&gt;
Each register has a small 2 to 1 multiplexer that chooses whether the input is coming from the outside or keeping the old value.&lt;br /&gt;
The control for 2 to 1 multiplexers is one hot code that comes from the first 8 bits of operand (this will be used only during &lt;br /&gt;
writing to Reg-file). &lt;br /&gt;
The control signals for output registers are binary encoded and are the first three bits of the operand (in case of any operation &lt;br /&gt;
involving a register). &lt;br /&gt;
R0 is the only register that can be loaded directly by user from memory or operand since this operation needs source and destination address&lt;br /&gt;
and our instruction format can not support it. The other registers can be only loaded via Acc.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable floatright&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|+ Table 2: Register file input Mux &lt;br /&gt;
! !! command !! output&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||  00   || (others=&amp;gt;'0')&lt;br /&gt;
|-&lt;br /&gt;
| 2 ||  01   || ControlDATA&lt;br /&gt;
|-&lt;br /&gt;
| 3 ||  10   || ALUResult&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||  11   || MemDATA&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable floatright&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|+ Table 3: Register file input select&lt;br /&gt;
! !! command !! selected register&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||  00000001   || R0&lt;br /&gt;
|-&lt;br /&gt;
| 2 ||  00000010   || R1&lt;br /&gt;
|-&lt;br /&gt;
| 3 ||  00000100   || R2&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||  00001000   || R3&lt;br /&gt;
|-&lt;br /&gt;
| 5 ||  00010000   || R4&lt;br /&gt;
|-&lt;br /&gt;
| 6 ||  00100000   || R5&lt;br /&gt;
|-&lt;br /&gt;
| 7 ||  01000000   || R6&lt;br /&gt;
|-&lt;br /&gt;
| 8 ||  10000000   || R6&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====ALU====&lt;br /&gt;
The ALU covers the following operations:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|+ Table 4: ALU commands&lt;br /&gt;
! !! Command !! Operation !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||  0000   || A + B || Addition&lt;br /&gt;
|-&lt;br /&gt;
| 2 ||  0001   || A - B || subtraction&lt;br /&gt;
|-&lt;br /&gt;
| 3 ||  0010  || A || Bypass A&lt;br /&gt;
|-&lt;br /&gt;
| 4 ||  0011  || B || Bypass B&lt;br /&gt;
|-&lt;br /&gt;
| 5 ||  0100  || A AND B || bitwise And &lt;br /&gt;
|-&lt;br /&gt;
| 6 ||  0101  || A OR B || bitwise OR&lt;br /&gt;
|-&lt;br /&gt;
| 7 ||  0110  || A XOR B || bitwise XOR&lt;br /&gt;
|-&lt;br /&gt;
| 8 ||  0111  || '0' &amp;amp; A(BITWIDTH-1 DOWNTO 1) || Logical Shift Right&lt;br /&gt;
|-&lt;br /&gt;
| 9 ||  1000  || A(BITWIDTH-2 DOWNTO 0) &amp;amp; '0' || Logical Shift Left&lt;br /&gt;
|-&lt;br /&gt;
| 10 ||  1001  || NOT(A) + 1 || Negation&lt;br /&gt;
|-&lt;br /&gt;
| 11 ||  1010  || A(BITWIDTH-1) &amp;amp; A(BITWIDTH-1 DOWNTO 1) || Arithmetic Shift Right&lt;br /&gt;
|-&lt;br /&gt;
| 12 ||  1011  || A(BITWIDTH-1) &amp;amp; A(BITWIDTH-3 downto 0)&amp;amp; A(0) || Arithmetic Shift Left&lt;br /&gt;
|-&lt;br /&gt;
| 13 ||  1100  || NOT(A) || Flip&lt;br /&gt;
|-&lt;br /&gt;
| 14 ||  1101  || 0 || Clear A&lt;br /&gt;
|-&lt;br /&gt;
| 15 ||  1110  || Cflag  &amp;amp; A(BITWIDTH-1 downto 1) || Rotate Right Through Carry&lt;br /&gt;
|-&lt;br /&gt;
| 16 ||  1111  || A(BITWIDTH-2 downto 0)&amp;amp; Cflag || Rotate Left Through Carry&lt;br /&gt;
|}&lt;br /&gt;
For addition/subtraction a ripple carry model is made out of chain of full adders. &lt;br /&gt;
&lt;br /&gt;
====Flags====&lt;br /&gt;
{| class=&amp;quot;wikitable floatright&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|+ Table 5: DPU Flag &lt;br /&gt;
! !! command !! FlagToClear&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||  001   || Clear Z&lt;br /&gt;
|-&lt;br /&gt;
| 2 ||  010   || Clear OV&lt;br /&gt;
|-&lt;br /&gt;
| 3 ||  100   || Clear C&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
In DPU has the following flags:&lt;br /&gt;
* '''Zero Flag (Z)''': will be set if the result of the operation is zero&lt;br /&gt;
* '''Overflow Flag (OV)''': will be set if an overflow happens in signed operations (as an example if we have 8 bit addition of 82+91 the answer we expect is 173 but the result would be interpreted as -45). Overflow flag can be realized in the following way:&lt;br /&gt;
* '''Carry Flag (C)''': will be set if the unsigned addition or subtraction results in a carry. &lt;br /&gt;
* '''Equal Flag (EQ)''': will be set if ACC value is equal to the operand&lt;br /&gt;
&lt;br /&gt;
To clear flags,the SetFlag commands are used in DPU command (see table 5).&lt;br /&gt;
&lt;br /&gt;
=== Instruction Memory (ROM) ===&lt;br /&gt;
Instruction memory is a read only memory that user will fill in the beginning.&lt;br /&gt;
  &lt;br /&gt;
=== Data Memory ===&lt;br /&gt;
[[File:DataMem.png|300px|thumb|right|alt= text| Fig 3: Data Memory block diagram]]&lt;br /&gt;
Data memory is made out of blocks of 1024 registers. If user wants bigger size memory, it would be necessary to add more blocks. &lt;br /&gt;
Writing into data memory takes one clock cycle but reading from it can be done instantly(or in relatively shorter time). So we can assume that if we issue address in one clock cycle, we can get the data in the same clock cycle. &lt;br /&gt;
There is a stack is at the top of data memory and its size is not restricted. Behavioural VHDL description of one instance of data memory is shown in the code below.&lt;br /&gt;
&lt;br /&gt;
=== Control unit===&lt;br /&gt;
[[File:ControllerFSM.png|300px|thumb|right|alt= text| Fig 4: Control unit FSM]]&lt;br /&gt;
 &lt;br /&gt;
Control unit has four states:&lt;br /&gt;
* '''Fetch''': fetches the instructions from instruction memory and loads it in Instruction Register (IR). DPU is IDLE. No Read from data memory. &lt;br /&gt;
* '''Decode''': decodes the information in IR. DPU is IDLE. No Read from data memory. &lt;br /&gt;
* '''Execute''': if execution on DPU is needed the proper control signals would be provided, otherwise DPU will stay IDLE. Read from data memory performed if needed. &lt;br /&gt;
* '''WriteBack''': in case there is a need to write a data into memory it will happen in this stage. All changes in Program Counter(PC) is happening here so all conditional and unconditional branching would be decided in this state. in case the instruction is HALT the PC would be frozen.&lt;br /&gt;
&lt;br /&gt;
=== VHDL complete versions===&lt;br /&gt;
* [[:File:PicoCPU_VHDL_8Bit.zip|8-bit Version]]  (17 dec 2014)&lt;br /&gt;
* 16-bit Version&lt;br /&gt;
* 32-bit Version&lt;br /&gt;
&lt;br /&gt;
=Functional Testing=&lt;br /&gt;
Following machine code program has been made to test functionality of all instructions. The test program doesn’t cover all the cases but run through all the instructions.&lt;br /&gt;
(at the moment not all the instructions are covered-12% missing)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot; collapse=&amp;quot;true&amp;quot; first-line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
Load_R0_Dir &amp;quot;00011000&amp;quot; &lt;br /&gt;
OR_A_R  &amp;quot;00000000&amp;quot;&lt;br /&gt;
IncA&lt;br /&gt;
Sub_A_R &amp;quot;00000000&amp;quot;&lt;br /&gt;
NOP&lt;br /&gt;
JmpC &amp;quot;00001000&amp;quot;     &lt;br /&gt;
NOP&lt;br /&gt;
NOP&lt;br /&gt;
RRC&lt;br /&gt;
RLC&lt;br /&gt;
NOP&lt;br /&gt;
ClearC&lt;br /&gt;
Store_A_Mem  &amp;quot;00010000&amp;quot;&lt;br /&gt;
PUSH&lt;br /&gt;
SavePC&lt;br /&gt;
PUSH&lt;br /&gt;
Jump &amp;quot;00010101&amp;quot;&lt;br /&gt;
POP&lt;br /&gt;
ShiftArithL&lt;br /&gt;
DecA&lt;br /&gt;
HALT&lt;br /&gt;
Load_A_Mem &amp;quot;00010000&amp;quot;&lt;br /&gt;
And_A_R &amp;quot;00000000&amp;quot;&lt;br /&gt;
JmpZ &amp;quot;00011001&amp;quot;&lt;br /&gt;
NOP&lt;br /&gt;
ClearZ&lt;br /&gt;
Add_A_Mem &amp;quot;00010000&amp;quot;&lt;br /&gt;
Sub_A_Mem &amp;quot;00010000&amp;quot;&lt;br /&gt;
Add_A_R &amp;quot;00000000&amp;quot;  &lt;br /&gt;
Sub_A_Dir &amp;quot;00001100&amp;quot;&lt;br /&gt;
FlipA&lt;br /&gt;
XOR_A_R &amp;quot;00000000&amp;quot; &lt;br /&gt;
NegA&lt;br /&gt;
ShiftArithR&lt;br /&gt;
ShiftA_L&lt;br /&gt;
ShiftA_R&lt;br /&gt;
ClearACC&lt;br /&gt;
POP&lt;br /&gt;
Add_A_Dir  &amp;quot;00000011&amp;quot;&lt;br /&gt;
LoadPC&lt;br /&gt;
HALT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Synthesizing and implementation on FPGA =&lt;br /&gt;
One of the parts of this project is to synthesize 8-bit version of CPU on an FPGA board. &amp;quot;Nexsys 3&amp;quot; board from Digilent has been chosen for implementation. &lt;br /&gt;
Clock source is controllable via a switch on the board. ClK would be either the 100MHz on-board oscillator or generated signal from one push button (for debugging).&lt;br /&gt;
The Accumulator value will be displayed on Seven-Segments and the flag values will be displayed on the LEDs. &lt;br /&gt;
&lt;br /&gt;
You need the following files along the CPU VHDL files for synthesis on and implementation on FPGA:&lt;br /&gt;
* Top-level Entity:  [[:File:TopLevel.vhd|TopLevel.vhd]]&lt;br /&gt;
* Denouncing circuit: [[:File:Debouncer.vhd|Debouncer.vhd]]&lt;br /&gt;
* Seven-segment Decoder: [[:File:VectorToSevenSeg.vhd|SevenSegment.vhd]]&lt;br /&gt;
&lt;br /&gt;
'''Important note''': Make sure you set the &amp;quot;FPGA Start-Up Clock&amp;quot; to &amp;quot;JTAG Clock&amp;quot;.&lt;br /&gt;
==The User Constraint File (UCF)==&lt;br /&gt;
The following is the user constraints file for the project:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot; collapse=&amp;quot;true&amp;quot; first-line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
NET clk LOC = V10;&lt;br /&gt;
NET rst LOC = C4;&lt;br /&gt;
NET ClkBttn LOC = D9;&lt;br /&gt;
NET ClockSrc LOC = T10;&lt;br /&gt;
&lt;br /&gt;
NET FlagOutput&amp;lt;0&amp;gt; LOC = U16;&lt;br /&gt;
NET FlagOutput&amp;lt;1&amp;gt; LOC = V16;&lt;br /&gt;
NET FlagOutput&amp;lt;2&amp;gt; LOC = U15;&lt;br /&gt;
NET FlagOutput&amp;lt;3&amp;gt; LOC = V15;&lt;br /&gt;
&lt;br /&gt;
NET SevenSeg&amp;lt;6&amp;gt; LOC = T17;&lt;br /&gt;
NET SevenSeg&amp;lt;5&amp;gt; LOC = T18;&lt;br /&gt;
NET SevenSeg&amp;lt;4&amp;gt; LOC = U17;&lt;br /&gt;
NET SevenSeg&amp;lt;3&amp;gt; LOC = U18;&lt;br /&gt;
NET SevenSeg&amp;lt;2&amp;gt; LOC = M14;&lt;br /&gt;
NET SevenSeg&amp;lt;1&amp;gt; LOC = N14;&lt;br /&gt;
NET SevenSeg&amp;lt;0&amp;gt; LOC = L14;&lt;br /&gt;
&lt;br /&gt;
NET AN&amp;lt;3&amp;gt; LOC = P17;&lt;br /&gt;
NET AN&amp;lt;2&amp;gt; LOC = P18;&lt;br /&gt;
NET AN&amp;lt;1&amp;gt; LOC = N15;&lt;br /&gt;
NET AN&amp;lt;0&amp;gt; LOC = N16;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Siavoosh</name></author>	</entry>

	</feed>