next up previous contents

[ENGN3213 Home]

Creating a New VHDL Source File

Next, open the HDL editor and select use HDL wizard, and click OK. Then use the wizard to create a skeleton file for a VHDL circuit with three inputs (A, B, C), and one output (X):


  
Figure 25: HDL Editor Wizard.
\begin{figure}
\begin{center}
\epsfig{file=images/andor-v2.eps}\end{center}\end{figure}


  
Figure 26: VHDL module inputs and outputs.
\begin{figure}
\begin{center}
\epsfig{file=images/andor-v3.eps}\end{center}\end{figure}

The following VHDL code skeleton should now appear in your HDL editor window:

library IEEE;
use IEEE.std_logic_1164.all;

entity andorv is
    port (
        A: in STD_LOGIC;
        B: in STD_LOGIC;
        C: in STD_LOGIC;
        X: out STD_LOGIC
    );
end andorv;

architecture andorv_arch of andorv is
begin
  -- <<enter your statements here>>
end andorv_arch;

Replace the comment with the VHDL code for X=AB+C as follows:

library IEEE;
use IEEE.std_logic_1164.all;

entity andorv is
    port (
        A: in STD_LOGIC;
        B: in STD_LOGIC;
        C: in STD_LOGIC;
        X: out STD_LOGIC
    );
end andorv;

architecture andorv_arch of andorv is
begin
  X <= (A and B) or C;
end andorv_arch;
Check the syntax:
Synthesis $\to$ Check Syntax

Next, in the HDL editor:


  
Figure 27: VHDL source file in project.
\begin{figure}
\begin{center}
\epsfig{file=images/andor-v4.eps}\end{center}\end{figure}


next up previous contents

[ENGN3213 Home]

ANU Engineering - ENGN3213