ENGG2410: Digital Design Lab 5: Modular Designs and Hierarchy Using VHDL

Similar documents
COMPUTER ENGINEERING PROGRAM

1. a) For the circuit shown in figure 1.1, draw a truth table showing the output Q for all combinations of inputs A, B and C. [4] Figure 1.

Microprocessor Design

Lab #10 Hexadecimal-to-Seven-Segment Decoder, 4-bit Adder-Subtractor and Shift Register. Fall 2017

ELEC 204 Digital System Design LABORATORY MANUAL

Combinational Logic Design

DALHOUSIE UNIVERSITY Department of Electrical & Computer Engineering Digital Circuits - ECED 2200

Contents Circuits... 1

COE328 Course Outline. Fall 2007

DALHOUSIE UNIVERSITY Department of Electrical & Computer Engineering Digital Circuits - ECED Experiment 2 - Arithmetic Elements

University of Pennsylvania Department of Electrical and Systems Engineering. Digital Design Laboratory. Lab8 Calculator

FPGA-BASED EDUCATIONAL LAB PLATFORM

Inside Digital Design Accompany Lab Manual

Altera s Max+plus II Tutorial

Main Design Project. The Counter. Introduction. Macros. Procedure

IMPLEMENTATION OF A BINARY SELECTION SYSTEM CREATED IN XILINX USING FPGA

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Electrical and Telecommunications Engineering Technology_TCET3122/TC520. NEW YORK CITY COLLEGE OF TECHNOLOGY The City University of New York

Main Design Project. The Counter. Introduction. Macros. Procedure

NORTHWESTERN UNIVERSITY TECHNOLOGICAL INSTITUTE

EEM Digital Systems II

CHAPTER 4 RESULTS & DISCUSSION

EE 210. LOGIC DESIGN LAB.

Objectives. Combinational logics Sequential logics Finite state machine Arithmetic circuits Datapath

ECE Lab 5. MSI Circuits - Four-Bit Adder/Subtractor with Decimal Output

Digital Logic. ECE 206, Fall 2001: Lab 1. Learning Objectives. The Logic Simulator

LAB 3 Verilog for Combinatorial Circuits

TSIU03, SYSTEM DESIGN. How to Describe a HW Circuit

1. True/False Questions (10 x 1p each = 10p) (a) I forgot to write down my name and student ID number.

Lab #12: 4-Bit Arithmetic Logic Unit (ALU)

Lab 4: Hex Calculator

Midterm Exam 15 points total. March 28, 2011

Subject : EE6301 DIGITAL LOGIC CIRCUITS

University of Victoria Electrical and Computer Engineering CENG 241 Digital Design I Laboratory Manual

North Shore Community College

DIGITAL SYSTEM DESIGN UNIT I (2 MARKS)

Digital Electronic Circuits Design & Laboratory Guideline

Programmable Logic Design I

Ryerson University Department of Electrical and Computer Engineering COE/BME 328 Digital Systems

Introduction to Digital Electronics

LAB 3 Verilog for Combinational Circuits

ET398 LAB 4. Concurrent Statements, Selection and Process

Laboratory 1 - Introduction to Digital Electronics and Lab Equipment (Logic Analyzers, Digital Oscilloscope, and FPGA-based Labkit)

CSE221- Logic Design, Spring 2003

1. Convert the decimal number to binary, octal, and hexadecimal.

EEE130 Digital Electronics I Lecture #1_2. Dr. Shahrel A. Suandi

Design of a Binary Number Lock (using schematic entry method) 1. Synopsis: 2. Description of the Circuit:

Hardware Modeling of Binary Coded Decimal Adder in Field Programmable Gate Array

Digital Systems Design

1. Synopsis: 2. Description of the Circuit:

MODULAR DIGITAL ELECTRONICS TRAINING SYSTEM

The Nexys 4 Number Cruncher. Electrical and Computer Engineering Department

Digital Electronics II 2016 Imperial College London Page 1 of 8

LUT Optimization for Memory Based Computation using Modified OMS Technique

MODULE 3. Combinational & Sequential logic

EE292: Fundamentals of ECE

Engineering College. Electrical Engineering Department. Digital Electronics Lab

R13 SET - 1 '' ''' '' ' '''' Code No: RT21053

ECT 224: Digital Computer Fundamentals Digital Circuit Simulation & Timing Analysis

gate symbols will appear in schematic Dierent of a circuit. Standard gate symbols have been diagram Figures 5-3 and 5-4 show standard shapes introduce

Chapter 4: Table of Contents. Decoders

Find the equivalent decimal value for the given value Other number system to decimal ( Sample)

EXPERIMENT: 1. Graphic Symbol: OR: The output of OR gate is true when one of the inputs A and B or both the inputs are true.

Lab 5 FPGA Design Flow Based on Aldec Active-HDL. Fast Reflex Game.

Clock Gating Aware Low Power ALU Design and Implementation on FPGA

A Review on Hybrid Adders in VHDL Payal V. Mawale #1, Swapnil Jain *2, Pravin W. Jaronde #3

Theory Lecture Day Topic Practical Day. Week. number systems and their inter-conversion Decimal, Binary. 3rd. 1st. 1st

R13. II B. Tech I Semester Regular Examinations, Jan DIGITAL LOGIC DESIGN (Com. to CSE, IT) PART-A

Modeling Latches and Flip-flops

Bell. Program of Study. Accelerated Digital Electronics. Dave Bell TJHSST

Encoders and Decoders: Details and Design Issues

CS6201 UNIT I PART-A. Develop or build the following Boolean function with NAND gate F(x,y,z)=(1,2,3,5,7).

Tutorial 11 ChipscopePro, ISE 10.1 and Xilinx Simulator on the Digilent Spartan-3E board

FPGA Based Implementation of Convolutional Encoder- Viterbi Decoder Using Multiple Booting Technique

Performance Evolution of 16 Bit Processor in FPGA using State Encoding Techniques

A Review of logic design

Design and implementation (in VHDL) of a VGA Display and Light Sensor to run on the Nexys4DDR board Report and Signoff due Week 6 (October 4)

Individual Project Report

EECS 140 Laboratory Exercise 7 PLD Programming

University of Maiduguri Faculty of Engineering Seminar Series Volume 6, december 2015

Lab 13: FPGA Circuit Realization Ian Callahan

CPE 329: Programmable Logic and Microprocessor-Based System Design

Minnesota State College Southeast

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Introductory Digital Systems Laboratory

ECSE-323 Digital System Design. Datapath/Controller Lecture #1

Section 6.8 Synthesis of Sequential Logic Page 1 of 8

CS302 Digital Logic Design Solved Objective Midterm Papers For Preparation of Midterm Exam

CPE 200L LABORATORY 3: SEQUENTIAL LOGIC CIRCUITS UNIVERSITY OF NEVADA, LAS VEGAS GOALS: BACKGROUND: SR FLIP-FLOP/LATCH

Chapter 5 Sequential Circuits

SEMESTER ONE EXAMINATIONS 2002

Lab Assignment 5 I. THE 4-BIT CPU AND CONTROL

Department of Electrical Engineering University of Hail Ha il - Saudi Arabia

ISSN:

CS 110 Computer Architecture. Finite State Machines, Functional Units. Instructor: Sören Schwertfeger.

Figure 1 Block diagram of a 4-bit binary counter

Experiment (6) 2- to 4 Decoder. Figure 8.1 Block Diagram of 2-to-4 Decoder 0 X X

Combinational / Sequential Logic

MODEL QUESTIONS WITH ANSWERS THIRD SEMESTER B.TECH DEGREE EXAMINATION DECEMBER CS 203: Switching Theory and Logic Design. Time: 3 Hrs Marks: 100

Why FPGAs? FPGA Overview. Why FPGAs?

Introduction to Digital Logic Missouri S&T University CPE 2210 Exam 3 Logistics

Transcription:

ENGG2410: Digital Design Lab 5: Modular Designs and Hierarchy Using VHDL School of Engineering, University of Guelph Fall 2017 1 Objectives: Start Date: Week #7 2017 Report Due Date: Week #8 2017, in the lab Understand the advantages of using Hardware Descriptive Languages and Schematic Capture (i.e., mixed) for design entry. Build several more complex logic circuits and gain increased familiarity with the Xilinx ISE Foundation Tools and VHDL language. Circuits include a 7-segment decoder, an adder/subtractor and 7-segment display. Show how to describe logic modules and interconnect them in a hierarchical fashion using VHDL. 2 Introduction By now, you have built combinatorial logic circuits and tested them by using the simulator and by downloading them into the NEXYS 3 Board. It has all been so simple!. So simple, in fact, that you might be asking the question, Since the computer can figure out the logic design from just the truth table, what do you need me for? Well, maybe we don t!. On the other hand, we have calculators but we still have accountants. The important fact is that the tedious calculations have been automated, leaving us with the more challenging tasks to perform that computers do not yet do so well. For example, accountants now spend less time adding numbers and more time figuring out neat ways to reduce tax obligations. Likewise, you can spend more time thinking up neat circuits and less time mechanically grinding out the details. CAD Limitations However, the computer-aided design programs will always have limitations, so you cannot completely ignore the details of how the gates are connected to build a design. Having knowledge of how logic is transformed and minimized allows you to check the output from the programs and determine if some terrible mistake is being made. More detailed specifications are also needed if you are pushing the limits of your devices. For example, you may be trying to build a circuit that performs some operation very quickly, so you need to reduce the number of gates the signals must pass through on their way from the inputs to the outputs. The CAD programs you are using may not handle this situation, so you may be required to do more work. So, for now, you have not been completely automated out of the picture. 1

Hierarchical and Modular Design There is another case where you have to be more involved in the design of the gate-level logic. This occurs when a truth table representation for a design is theoretically possible but impractical. For example, an adder that adds two 8-bit numbers could be specified by a truth table having 2 16 = 65,538 entries, Design Entry Using VHDL In the 1980 s rapid advances in integrated circuit technology lead to efforts to develop standard design practices for digital circuits. VHDL was developed as a part of that effort. VHDL was originally intended to serve two main purposes. First, it was used as documentation language for describing the structure of complex digital circuits. As an official IEEE standard, VHDL provided a common way of documenting circuits designed by numerous designers. Second, VHDL provided features for modeling the behavior of a digital circuit, which allowed it use as input to software programs that were then used to simulate the circuit s operation. In recent years, in addition to its use for documentation and simulation, VHDL has also become popular for use in design entry in CAD systems. The CAD tools are used to synthesize the VHDL code into a hardware implementation of the described circuit. In this lab our main use of VHDL will be for synthesis. The tutorials and technical report provided to you with this lab will help you synthesize the required design. 3 Preparation In the section of lab5 on the web page you will find the following links: 1. VHDL Tutorial Tech Report VHDL For Digital Design. 2. Design Entry Using VHDL (SOE). 3. Mixing VHDL with Schematics (SOE). 4. ISE 13.3 VHDL Tutorial (By Digilent). 5. ISE 13.3 In Depth Tutorial (By Xilinx). 6. Controlling NEXYS 3 Display (VHDL CODE). 7. Controlling NEXYS 3 Display (UCF File). 8. VHDL OnLine (Tutorials, Courses, News) You will use the VHDL Tutorial Tech Report as a reference to VHDL programming. I assume that you have already read the document Design Entry Using VHDL in the previous lab. You should read the next VHDL Tutorial Mixing VHDL with Schematics to understand how a VHDL code can be synthesized into a component which can be used in your schematics. Finally you may want to use item (6) and (7) to explore how the LEDs and 7-segment displays are controlled using a VHDL code (i.e complete VHDL code to test the switches, LEDs and Seven Segment Displays). 3.1 Displaying Switch Settings on the Digilent NEXYS 3 Board LEDs/7-Seg Display This example creates a circuit that displays the settings of the DIP switches on the LEDs and LED digits of the Digilent NEXYS 3 board. The particular set of LEDs, which is activated, is selected by the Push Buttons. The VHDL code for this example is given on the web site i.e item (6) above. The steps for compiling and testing the design using the Digilent NEXYS 3 board are as follows: 2

Open a new project with Foundation tools and choose VHDL entry. Synthesize the VHDL code (item 6) in the nexys3 slideswitch.vhd file for a NEXYS 3 (Spartan 6 FPGA) board. Compile the synthesized netlist using the nexys3 slideswitch.ucf constraint file (item 7). Down-load the nexys3 slideswitch.bit file into the NEXYS 3 board with the impact utility. Set the DIP switches and press the push-buttons. Depending on the push buttons pressed observe the results on the LEDs or 7-Segment Display (Please read the VHDL Code carefully to understand the functionality!). 3.2 Binary to 7-Segment Decoder A seven-segment display is often used on computers, watches, VCRs and many electronic devices to display numbers and some characters. It consists of seven independent lights (light emitting diodes (LEDs)) in an 8 configuration as shown below in Figure 1. By turning on different segments, you can display different numbers and some letters. a LED e f g b c d Decimal Point Figure 1: Seven Segment Display. You are to create a logic circuit to drive one of the seven-segment displays on the NEXYS 3 board. Design a circuit that takes a four bit (X 3, X 2, X 1, X 0 ) Binary input from the DIP switches and drives any 7-Segment Digit Display on the NEXYS 3 board as described in Table 1. Note that for the letters, some are capitalized and some are not. (The reason is that a capital B, for example, would come out the same as an 8 on a 7-segment display, so we will display a lower-case b instead). Determine the equations for the 7-segment display segments, and minimize them using the Karnaugh-map method described in class. Write VHDL code to represent the logic function for each segment as a Boolean equation (with AND, OR, NOT, etc.). Simulate and test your equation 1 using the Xilinx Foundation functional simulator. Transform the VHDL code that you have created into a symbol that can be used later on with your schematics. 3.3 4-bit Adder/subtractor The tutorial of lab4 illustrated a hierarchical design of a 4-bit full adder. In this lab you will extend the idea of a full adder to design a binary adder-subtractor. Using either the 2 s or 1 s complement, you can eliminate the subtraction operation and all you will need is the appropriate complementer and an adder (see section 4-4 in your text book). The circuit for subtracting A - B consists of a parallel adder with inverters placed between each B terminal and the corresponding full-adder input. The input carry C 0 must be equal to 1. The operation that is performed becomes A plus the 1 s complement of B plus 1. This is equivalent to A plus the 2 s complement of B. For unsigned numbers, it gives A - B if A B 1 See section 3-1 in the text book and in particular example 3-2 for designing a BCD-to-Seven-Segment decoder. 3

X 3 X 2 X 1 X 0 Display (note Capitalization) 0000 0 0001 1 0010 2 0011 3 0100 4 0101 5 0110 6 0111 7 1000 8 1001 9 1010 A 1011 b 1100 C 1101 d 1110 E 1111 F Table 1: Truth Table for 7-Segment Display or the 2 s complement of B - A if A < B. You should have a control input to the adder-subtractor to control the operation to be used. A 4-bit adder-subtractor circuit is shown in Figure 2. Input S controls the operation. 1. When S = 0 the circuit is an adder. 2. When S = 1 the circuit becomes a subtractor. Each exclusive-or gate receives input S and one of the inputs of B, B i. When S = 0, we have B i 0 = B i. If the full adders receive the value of B, and the input carry is 0, the circuit performs A plus B. When S = 1, we have B i 1 = B i and C 0 = 1. The circuit performs the operation A plus the 2 s complement of B. B 3 B 2 B1 B 0 S A 3 A 2 A1 A0 C3 C2 C1 C 0 C4 S3 S2 S1 S0 Figure 2: 4-Bit Adder/Subtractor Figure 3 shows the complete design that integrates the 4-bit adder/subtractor, the seven segment decoder and seven-segment display. 4

Switch Switch 4-Bit Adder Subtractor 7-Segment Decoder a LED e f g b c d Decimal Point Figure 3: Adder Subtractor Design with Input Switches and 7-Segment Display. 4 Requirements Before you start the lab you need to be well prepared since this lab is quite lengthy and requires lots of time. First, check (make sure) that the 7-segment display on the NEXYS-3 board is working, by copying the VHDL file mentioned in Section 3.1. You can then go through the VHDL Tutorial using Xilinx tools to get a better understanding of using the VHDL editor and wizard for entering your designs, synthesizing and compiling them. Design the 7-segment decoder as explained in Section 3.2. Write the VHDL code for the 7-segment decoder, build it and test it. Transform the design into a symbol so that you can use it later as a component in your final schematics. Design the 4-bit adder-subtractor (by simply extending the 1-bit adder that is explained in the lecture notes, tutorial and lab4 tutorial). You will first design the 4-bit adder using VHDL. Transform the adder into a symbol. Use schematic capture to add xor gates to transform the 4-bit adder into an adder-subtractor. Interface the 4-bit adder/subtractor to the 7-segment decoder built earlier and connect the overall design to the 7-segment display as seen in Figure 3 using Schematic Capture. Demonstrate your lab to the TA. Important Issues: Since you have two operands (4-bits each), you will be using all the available switches on the NEXYS-3 board. Therefore, you can map the S control line to a push button. We are assuming that we will be using Binary Numbers in 2 s Complement representation. The output of the adder/subtractor should be connected to the decoder which will be connected to a single 7-segment display. 5

4.1 Report Below is the general format of the report required: 1. Title Page. 2. Printed schematic and block diagram of your design. 3. Your VHDL code. 4. Printed simulation waveform data, showing that the simulation coincides with the expected truth table of your function. 5. The final written report should describe the following: Derivation of your truth tables. Schematic of your design. Advantages of using Computer Aided Design in the form of Xilinx ISE Foundation Tools to enter your design and simulate it for verification. Results and the procedures used to test your circuit. Any problems you encountered during the lab. Any future recommendations Make sure you adhere with the format and requirements for the Report listed in the lab manual. 6