CPE 329: Programmable Logic and Microprocessor-Based System Design

Similar documents
COMPUTER ENGINEERING PROGRAM

Programmable Logic Design I

FPGA Laboratory Assignment 4. Due Date: 06/11/2012

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

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

Lab 4: Hex Calculator

1. Synopsis: 2. Description of the Circuit:

VHDL Design and Implementation of FPGA Based Logic Analyzer: Work in Progress

HDL & High Level Synthesize (EEET 2035) Laboratory II Sequential Circuits with VHDL: DFF, Counter, TFF and Timer

EEM Digital Systems II

Faculty of Electrical & Electronics Engineering BEE3233 Electronics System Design. Laboratory 3: Finite State Machine (FSM)

ELEC 204 Digital System Design LABORATORY MANUAL

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)

Field Programmable Gate Array (FPGA) Based Trigger System for the Klystron Department. Darius Gray

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

Lab Assignment 2 Simulation and Image Processing

Laboratory Exercise 7

VID_OVERLAY. Digital Video Overlay Module Rev Key Design Features. Block Diagram. Applications. Pin-out Description

Experiment # 12. Traffic Light Controller

California State University, Bakersfield Computer & Electrical Engineering & Computer Science ECE 3220: Digital Design with VHDL Laboratory 7

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

Lab 2: Hardware/Software Co-design with the Wimp51

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

Digilent Nexys-3 Cellular RAM Controller Reference Design Overview

Ryerson University Department of Electrical and Computer Engineering EES508 Digital Systems

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

Modeling Latches and Flip-flops

FPGA-BASED EDUCATIONAL LAB PLATFORM

You will be first asked to demonstrate regular operation with default values. You will be asked to reprogram your time values and continue operation

CSCB58 - Lab 4. Prelab /3 Part I (in-lab) /1 Part II (in-lab) /1 Part III (in-lab) /2 TOTAL /8

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

AbhijeetKhandale. H R Bhagyalakshmi

Experiment: FPGA Design with Verilog (Part 4)

Design and Implementation of an AHB VGA Peripheral

COE328 Course Outline. Fall 2007

Lab #5: Design Example: Keypad Scanner and Encoder - Part 1 (120 pts)

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

Task 4_B. Decoder for DCF-77 Radio Clock Receiver

Serial FIR Filter. A Brief Study in DSP. ECE448 Spring 2011 Tuesday Section 15 points 3/8/2011 GEORGE MASON UNIVERSITY.

Lab #6: Combinational Circuits Design

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

Lab #11: Register Files

LAB #6 State Machine, Decoder, Buffer/Driver and Seven Segment Display

Spartan-II Development System

Design of VGA Controller using VHDL for LCD Display using FPGA

EE 209 Lab 7 A Walk-Off

AC : DIGITAL DESIGN MEETS DSP

Field Programmable Gate Arrays (FPGAs)

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

EE 101 Lab 7 Crosswalk

OF AN ADVANCED LUT METHODOLOGY BASED FIR FILTER DESIGN PROCESS

Laboratory Exercise 7

Spartan-II Development System

Design and analysis of microcontroller system using AMBA- Lite bus

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

Implementation of Low Power and Area Efficient Carry Select Adder

The Nexys 4 Number Cruncher. Electrical and Computer Engineering Department

Modeling Latches and Flip-flops

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

Microprocessor Design

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

Level and edge-sensitive behaviour

The Calculative Calculator

Design Problem 4 Solutions

ECE337 Lab 4 Introduction to State Machines in VHDL

IMPLEMENTATION OF A BINARY SELECTION SYSTEM CREATED IN XILINX USING FPGA

Lab 3: VGA Bouncing Ball I

Lab 6: Video Game PONG

LAB 3 Verilog for Combinatorial Circuits

Digital Systems Laboratory 1 IE5 / WS 2001

Rensselaer Polytechnic Institute Computer Hardware Design ECSE Report. Lab Three Xilinx Richards Controller and Logic Analyzer Laboratory

SPI Serial Communication and Nokia 5110 LCD Screen

Lab 17: Building a 4-Digit 7-Segment LED Decoder

Eng. Mohammed Samara. Fall The Islamic University of Gaza. Faculty of Engineering. Computer Engineering Department

Vending Machine. Keywords FSM, Vending Machine, FPGA, VHDL

Block Diagram. dw*3 pixin (RGB) pixin_vsync pixin_hsync pixin_val pixin_rdy. clk_a. clk_b. h_s, h_bp, h_fp, h_disp, h_line

ECE 270 Lab Verification / Evaluation Form. Experiment 9

DE2-115/FGPA README. 1. Running the DE2-115 for basic operation. 2. The code/project files. Project Files

CHAPTER 4 RESULTS & DISCUSSION

Radar Signal Processing Final Report Spring Semester 2017

Digital Electronics II 2016 Imperial College London Page 1 of 8

VGA Port. Chapter 5. Pin 5 Pin 10. Pin 1. Pin 6. Pin 11. Pin 15. DB15 VGA Connector (front view) DB15 Connector. Red (R12) Green (T12) Blue (R11)

LAB 3 Verilog for Combinational Circuits

ET398 LAB 4. Concurrent Statements, Selection and Process

DEDICATED TO EMBEDDED SOLUTIONS

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

PHYS 3322 Modern Laboratory Methods I Digital Devices

Risk Risk Title Severity (1-10) Probability (0-100%) I FPGA Area II Timing III Input Distortion IV Synchronization 9 60

Why FPGAs? FPGA Overview. Why FPGAs?

Using HERON modules with FPGAs to connect to FPDP

Figure 1 Block diagram of a 4-bit binary counter

Fixed-Point Calculator

LogiCORE IP Spartan-6 FPGA Triple-Rate SDI v1.0

SingMai Electronics SM06. Advanced Composite Video Interface: HD-SDI to acvi converter module. User Manual. Revision 0.

Design and Implementation of Timer, GPIO, and 7-segment Peripherals

The Design of Efficient Viterbi Decoder and Realization by FPGA

SOC Implementation for Christmas Lighting with Pattern Display Indication RAMANDEEP SINGH 1, AKANKSHA SHARMA 2, ANKUR AGGARWAL 3, ANKIT SATIJA 4 1

Testing Results for a Video Poker System on a Chip

Review : 2 Release Date : 2019 Last Amendment : 2013 Course Code : SKEE 2742 Procedure Number : PK-UTM-FKE-(0)-10

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

Transcription:

COMPUTER ENGINEERING PROGRAM California Polytechnic State University CPE 329: Programmable Logic and Microprocessor-Based System Design Laboratory 1 Revised 4/7/08 Digital Clock Design Using Programmable Logic and VHDL Learning Objectives To gain experience with the Nexys development board To gain further experience with a top-down approach to digital system design To gain further experience designing synchronous digital systems using VHDL To gain a further understanding of the flexibility of FPGAs WARNING: The eight switches on the Nexys board (SW7:SW0) should be placed and remain in the down position when using the LCD display; these eight signal lines also are contained in the 16-pin header that connects the LCD accessory. Because of this fact, the switches on the Nexys board will not be used when the LCD display is used. The Nexys 2 allows for the switches and LCD to be used simultaneously. If a PmodCLP is used with a Nexys 2 (using JA1 and JB1), make sure that both JP1 AND JP2 are set to VSWT before powering on. Failure to do so can cause irreparable damage to the Nexys 2 board. Introduction and Overview Lab 1 involves the design, simulation, and implementation of a digital clock on the Nexys development board. The time-keeping functions of the clock are designed using VHDL structural modeling and downloaded to the Nexys board. The time data is output and the time is displayed on the Nexys LCD module display. Two VHDL modules, arbiter and hex2bcd, are provided to the students for use in their VHDL design to interface with the LCD display. Digital Clock Requirements 1. The clock should display the current time in one of the formats shown in Figure 1 (dependent upon the actual time). The time output is displayed in a 12-hour display mode; the proper time of day is indicated by using the am/pm portion of the display. hh:mm:ss am hh:mm:ss pm Figure 1: Output display format for digital clock. 2. Upon power-up, the clock output should be 12:00:01 am and begin keeping time. 2008 by A. A. Liddicoat and L. A. Slivovsky - 1 -

3. The clock s hours and minutes setting should have the ability to be changed by the user in order to set the clock s output to the appropriate time. 4. Use the minimum number of FPGA programmable logic resources (slices). Digital Clock Specification The time output is manually changeable using the buttons on the Nexys board. Setting the time manually is referred to as the time-set mode. The signals used for the time-set mode and their function are listed in Table 1. These signals are used to put the digital clock into a time-set mode and to manually configure the data associated with the minutes and hours outputs. The minutes and hours display can only be manually changed when the digital clock is in the time-set mode. Name SET MN_SET HR_SET Function Puts digital clock in time-set mode; disables seconds incrementing Increments the minutes output Increments the hours output Table 1: Display control functions of digital clock. Time-set mode: The time-set mode is entered by asserting the SET input. When in time-set mode the seconds should not increment. Setting the minutes: to modify the minutes display, the SET input should be asserted simultaneously with the MN_SET input which causes the minutes display to increment at 1/2 second intervals. The minutes display should increment from 59 to 00 without changing the hours display value. Setting the hours: to modify the hours display, the SET input should be asserted simultaneously with the HR_SET input which causes the hours display to increment at 1/2 second intervals. The hours display should increment until reaching 12 and then roll over to 1 and continues incrementing. The am/pm indicator should change appropriately with the hours display value. Digital Clock Architecture A partial diagram of the digital clock architecture is shown in Figure 2. A brief description of the main modules in the architecture is provided below. 2008 by A. A. Liddicoat and L. A. Slivovsky - 2 -

clock hours minutes seconds pm_notam 8 8 8 Arbiter lcd_data lcd_rs lcd_rw lcd_r 16-pin Header 8 8 LCD Figure 2: Digital clock system architecture. Arbiter Module: The interface requirements for communication with the LCD display are not trivial. The LCD characters are written using appropriate address, data, and control signals. The Arbiter module function is to hide most of the low-level interface details from the designer. The Arbiter module converts the BCD information associated with the time display into ASCII characters which are then sent to the LCD controller module for display on the LCD. The VHDL code for the Arbiter module is provided on the class website. The digital clock inputs and outputs required to interface with the Arbiter module are listed in Table 2. Note that the system clock for the design is the CLK signal used by the Arbiter module. Signal Mode Description seconds IN seconds count in BCD form (two 4-bit BCD numbers) minutes IN minutes count in BCD form (two 4-bit BCD numbers) hours IN hours count in BCD form (two 4-bit BCD numbers) PM_notAM IN indicates PM or AM ( 1 or 0, respectively) CLK IN 50MHz system clock Table 2: Signals of particular interest on the Arbiter module. Digital Clock Module (not shown in Figure 2): The digital clock module interfaces with the Arbiter module which handles the I/O to the LCD. The primary functions of the digital clock module are listed below. 1-Second clock Generation: The system clock on the Nexys board is to run at 50MHz. This frequency must be divided down and used to drive the various modules that require a 1-second clock. Time Data Generation: The digital clock module keeps time while the Arbiter module expects three BCD inputs for the seconds, minutes, and hours data. There are several viable approaches to storing time data. Be sure to check out the HEX2BCD module (described below) before you decide on a design. PM_notAM Generation: The PM_notAM signal tells the Arbiter module whether the hours data is in the first or final twelve hours of the day. As the signal name implies, the convention PM_notAM is low for am and high for pm. 2008 by A. A. Liddicoat and L. A. Slivovsky - 3 -

Button Input: The buttons on the Nexys board set the time on the digital clock module. The input device assignments are listed in Table 3. Input Device BTN0 BTN2 BTN3 Signal Name SET MN_SET HR_SET Table 3: Mapping assignment between input devices and system signals. HEX2BCD Module: This module converts a single 6-bit binary number into two representative BCD numbers. The use of this module is optional so you must examine the VHDL code for interface specifications if you decide to use it. The VHDL code for this module is found on the class website. Digital Clock Components The three basic components of the digital clock are the provided Arbiter and HEX2BCD VHDL code and the student designed Digital Clock VHDL code. There are no software components for this design. Proper component development should include the following: 1. Testing each module you design by simulating the output using the ModelSim simulator. The component input vectors should provide adequate testing for each of the components. 2. Simulation results from the ModelSim simulator. These waveforms should be output from the ModelSim software. Screen capture (using Alternate-Print Screen ) can be used in the ModelSim waveform window to place a copy of the simulation waveform into the editor buffer. Then you can just paste a copy into your lab report (for MS word paste with Control-V ). The ModelSim waveforms should be annotated in order to draw attention and describe the important portions of the waveforms. Digital Clock System Integration Each of the modules you design should be tested before they are integrated into the final design. Each of the components in the digital clock design should be integrated using VHDL structural modeling. Other Implementation Details: Once you ve created and synthesized the required modules for the digital clock design, the design must be downloaded to the Nexys board. This requires an implementation constraints file that maps the required inputs and outputs to the pin assignments that exist on the Nexys board. The pin assignments for the Nexys board are listed in Table 5. These pin assignments are fixed on the board so you need to map the top level entity inputs and outputs to the correct pin assignments. Some additional information associated with mapping your design to the FPGA is listed below. The on board 50MHz system clock drives FPGA pin A8 ( B8 on the Nexys 2). The clock input to the top level entity must be assigned to pin A8 ( B8 on the Nexys 2). The signal names associated with the Arbiter interface and the pins for the LCD signals identified in Figure 2 are shown in Table 4 below. The pin assignments for the buttons on the Nexys board (BTN3:BTN0) can be found in Table 5 or Figure 3 below. 2008 by A. A. Liddicoat and L. A. Slivovsky - 4 -

Figure 2 Signal Name Nexys Pin Nexys 2 Pin lcd_data<0> N15 L15 lcd_data<1> J16 K12 lcd_data<2> K16 L17 lcd_data<3> K15 M15 lcd_data<4> L15 K13 lcd_data<5> M16 L16 lcd_data<6> M15 M14 lcd_data<7> N16 M16 lcd_rs P15 P17 lcd_rw T7 R16 lcd_e R5 T18 Table 4: Arbiter signal name mapping. Figure 3: Digilent Nexys Board FPGA to I/O Schematic Diagram. 2008 by A. A. Liddicoat and L. A. Slivovsky - 5 -

Figure 4: Digilent Nexys 2 Board FPGA to I/O Schematic Diagram. The Nexys board contains a Spartan 3 FPGA. The Project Properties listed in Table must be set when programming the Nexys board. Property Name Value (Nexys) Value (Nexys 2) Device Family spartan3 spartan3e Device xc3s200 xc3s500e Speed Grade -4-4 Package ft256 fg320 Table 5: Project Properties setting for Nexys and Nexys 2 boards. 2008 by A. A. Liddicoat and L. A. Slivovsky - 6 -

Project Demonstration and Lab Report Submission When your project is working properly and your lab report is ready to submit, zip up the project in a.zip file, and with the lab report in a word.doc file, submit it electronically to Blackboard as an Assignment. Include in your lab report the following design sections that describe the stages of the top-down design process: (For more information on lab reports reference the A note regarding lab reports link on the CPE 329 website.) 1. System Requirements 2. Specification 3. Architecture 4. Components 5. System Integration Include all VHDL code you wrote for your design with your report. Your report should be clear and concise in its description of the digital clock design. Remember, diagrams are a viable method to conveying important design information; consider using them in conjunction with written descriptions of your design. Your lab report should also include a Conclusions section. This section should not be a summary of the procedures or a description of what was done in the experiment. This section should include an analysis of the final system and may include topics such as: were the system requirements met? Is there any error in the final system and if so estimate it? Could you have met the system requirements with a better design or an alternate approach? If so how? What tradeoffs were made in the areas of cost, performance, accuracy, power consumption or reliability (if any of these are appropriate)? Grading Successful completion of the system requirements and a well written lab report will earn a maximum grade of 9 out of 10 points. In order to achieve a grade above 9 on this lab, you need to demonstrate a complete understanding of the lab by adding additional features/functionality to it. Some suggested lab enhancement ideas are listed below. Higher complexity will earn a higher grade. Adding other features/functionality is permitted as long as they are approved by an instructor and documented in an Added Features section following the conclusion of your report. Any changes made to the original specification due to added features must be listed along with an explanation of why the enhancement was made. Suggested added features: Ability to switch between standard and 24-hour time representation Minute and hour decrement buttons 2008 by A. A. Liddicoat and L. A. Slivovsky - 7 -