TCC EGR 270 - Combinational Logic Circuits

Unformatted text preview:

1 EGR 270 Fundamentals of Computer Engineering Filename: Aldec9-1Ex1 Combinational Logic Circuits using Aldec Active-HDL 9.2 and Xilinx ISE 14.2 Aldec Active-HDL software can be used to generate and simulate designs using VHDL. Aldec is not targeted to any one specific manufacturer of programmable logic devices (PLDs) or Field Programmable Gate Arrays (FPGAs), but produces a vhd file that can be implemented (or “synthesized”) into various devices using various synthesis tools. We will use Xilinx ISE WebPack 14 to synthesize our design into the Xilinx Spartan-3E FPGA. This FPGA is conveniently mounted on an FPGA board called by BASYS2 by Digilent. The BASYS2 provides easy access to input and output pins; slide switches and pushbutton switches for inputs; LEDs and 7-segment displays for outputs; USB2, video and PS2 ports; and PMOD connectors for interfacing with other devices. Aldec Active-HDL • Define inputs and outputs • Describe functional operation • Create testbench and test design • Generate truth tables and waveforms • Compile and produce vhd file Xilinx ISE • Specify FPGA Package (Xilinx Spartan 3E, etc) • Assign signals to pins • Implement design • Generate reports • Produce bit file vhd file (e.g., MyFile.vhd) bit file (e.g., MyFile.bit) USB2 cable Digilent Adept • Program to download bit files into Digilent devices • Identify FPGA board: BASYS2 • Identify bit file •Download (Program the FPGA Digilent BASYS2 FPGA Board2 This tutorial will guide you through: • Using Aldec Active-HDL software to: o Enter and compileVHDL code for a simple combinational logic circuit o Generate a testbench and simulate the design o Produce truth tables and waveforms verifying proper operation • Using Xilinx ISE software to: o Specify the type of FPGA to be programmed o Assign input and output signals to FPGA pins o Implement the design (producing a bit file) o Generate reports • Using Digilent Adept software to: o Select the board to be programmed: Digilent BASYS2 FPGA board o Select the bit file to be used o Program the FPGA board • Testing the design on the BASYS2 board. 1. Creating a Project with Aldec Active-HDL • Launch Aldec Active-HDL 9.2 • The screen below should appear. Select Next.3 • Select Create new workspace as shown below and then select OK. • Enter a name for the workspace (Ex1 was entered below), change the location of the workspace folder (or use the default as below), and select OK. Note that the name for the project workspace, VHDL entity (to be entered later), and architecture (to be entered later) should be the same. Use letters, numbers and underscores only for filenames.4 • Select Create an Empty Design with Design Flow as shown below and select Next. • The next window that appears shows information about synthesis tools and implementation tools that might be configured to launch automatically from Aldec Active-HDL. Synthesis tools can also be launched separately rather than integrating them into Aldec. We will launch Xilinx ISE separately, so you can ignore most settings shown. Select VHDL for the Default HDL Language and then select Next.5 • Enter the design name. Note that it should match the workspace name used earlier (Ex1 for this example). Enter the name and select Next. Select Finish on the final screen shown below. 2. Adding VHDL code to your design • Before adding VHDL code to the design, recall that VHDL designs typically have three parts: o Entity – basically defines the inputs and outputs to a black box o Architecture – defines the function of the black box o Testbench - defines stimulus signals as inputs to the design and allows us to observe the outputs (typically in the form of truth tables or timing diagrams). • The diagram below illustrates the relationship between the entity, architecture, and testbench.6 • The Design Flow Manager screen should appear next. • The Design Browser should appear on the left of the screen. If it does not appear, it can be toggled on and off using Alt + 1. • Double-click on Add New File under the Design Browser and the Add New File window should appear. • Note that there are several types of files that can be specified (VHDL Source Code, Block Diagram, etc). Additionally, some wizards are available to allow for easier entry of design information. • Select the Wizards tab under Add New File. • After selecting the Wizards tab, select VHDL Source Code and then select OK.7 The VHDL Source File Wizard is used to specify the inputs and outputs that will be used in the entity and architecture sections of the VHDL file to be created (Ex1.vhd). If the function to be implemented is F(A,B,C,D) = Σ(0,1,4,5,7,8,10,14) = A’C’ + A’BD + ACD’ + B’C’D’, then we will need 4 inputs (A, B, C, D) and one output (F). • Select Next when the screen below on the left appears. • Enter the source file name (Ex1) in the window shown below on the right and select Next. • Select New in the window below on the left to add a new port. Name it A with direction in. • Also add input ports B, C, and D and output port F as shown below and then select Finish. The diagram should clearly illustrate your inputs and outputs.8 Completed architecture description • Note that a VHDL file (Ex1.vhd) has now been generated with a complete entity section and the shell of the architecture section. Only the architecture description (Boolean equation for F in this example) needs to be entered. • The VHDL file is complete after entering the architecture description as shown below. Enter architecture description here Note that the entity portion of the VHDL files was completed by the wizard.9 • Select the Compile button to compile the design. If there were any errors, correct them and recompile the design. Compile button Successfully compiled10 3. Simulating VHDL Code • We have already defined the entity and the architecture for the design. Now we need to define the testbench to simulate the design to see if it works correctly. • Selecting the following option will make later printing of truth tables and waveforms easier. Select Tools – Preferences and the Preferences window below should appear as shown below. Select Waveform Viewer/Editor and change the default waveform viewer/editor to Standard Waveform Viewer/Editor and then select Apply and then OK.


View Full Document
Download Combinational Logic Circuits
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Combinational Logic Circuits and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Combinational Logic Circuits 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?