Exp#8: Designing a Programmable Sequence Detector

Similar documents
Lab Manual for COE 203: Digital Design Lab

Homework deadline extended to next friday

Recommended Design Techniques for ECE241 Project Franjo Plavec Department of Electrical and Computer Engineering University of Toronto

CSE140 L. Instructor: Thomas Y. P. Lee. March 1, Agenda. Computer System Design. Computer Architecture. Instruction Memory design.

Topics. Midterm Finish Chapter 7

M A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE

Lab #1: Introduction to Design Methodology with FPGAs part 1 (80 pts)

TOPIC : Verilog Synthesis examples. Module 4.3 : Verilog synthesis

EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013

ECE 551: Digital System *

Lecture #1: Introduction

ECE 2300 Digital Logic & Computer Organization. More Verilog Finite State Machines

: : (91-44) (Office) (91-44) (Residence)

In this lecture, we will focus on two very important digital building blocks: counters which can either count events or keep time information, and

ELEC 4200 Lab#10 Interrupting SPI Receiver for use with a Processor Core

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Sciences. Spring 2010 May 10, 2010

Laboratory Exercise 7

Digital Design Using Digilent FPGA Boards -- Verilog / Active-HDL Edition

Verilog Sequential Logic. Verilog for Synthesis Rev C (module 3 and 4)

Lab 3 Sequential Logic for Synthesis. FPGA Design Flow.

Outline. EECS Components and Design Techniques for Digital Systems. Lec 11 Putting it all together Where are we now?

Control in Digital Systems

Digital Circuit Design and Language. Datapath Design. Chang, Ik Joon Kyunghee University

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

Cpr E 281 FINAL PROJECT ELECTRICAL AND COMPUTER ENGINEERING IOWA STATE UNIVERSITY. FINAL Project. Objectives. Project Selection

structure syntax different levels of abstraction

Here is a list of lecture objectives. They are provided for you to reflect on what you are supposed to learn, rather than an introduction to this

EECS150 - Digital Design Lecture 20 - Finite State Machines Revisited

KING FAHD UNIVERSITY OF PETROLEUM & MINERALS COMPUTER ENGINEERING DEPARTMENT

ECE 2300 Digital Logic & Computer Organization. More Finite State Machines

Sequential Circuits. inputs Comb FFs. Outputs. Comb CLK. Sequential logic examples. ! Another way to understand setup/hold/propagation time

Elec 326: Digital Logic Design

To design a 4-bit ALU To experimentally check the operation of the ALU

Topics. Midterm Finish Chapter 7

ECE 574: Modeling and Synthesis of Digital Systems using Verilog and VHDL. Fall 2017 Final Exam (6.00 to 8.30pm) Verilog SOLUTIONS

Hardware Design Environments. Dr. Mahdi Abbasi Computer Engineering Department Bu-Ali Sina University

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

a, b sum module add32 sum vector bus sum[31:0] sum[0] sum[31]. sum[7:0] sum sum overflow module add32_carry assign

Digital System Design with SystemVerilog

In the previous lecture, we examined how to analyse a FSM using state table, state diagram and waveforms. In this lecture we will learn how to design

In the previous lecture, we examined how to analyse a FSM using state table, state diagram and waveforms. In this lecture we will learn how to design

Verilog for High Performance

Luleå University of Technology Kurskod SMD098 Datum Skrivtid

EGC221: Digital Logic Lab

PRELAB! Read the entire lab, and complete the prelab questions (Q1-Q3) on the answer sheet before coming to the laboratory.

ELEC 326: Class project

2015 Paper E2.1: Digital Electronics II

This Lecture. Some components (useful for the homework) Verilog HDL (will continue next lecture)

Debouncing a Switch. A Design Example. Page 1

One and a half hours. Section A is COMPULSORY UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE

ECE 2300 Digital Logic & Computer Organization. More Sequential Logic Verilog

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science

CSE140L: Components and Design Techniques for Digital Systems Lab

General FSM design procedure

General FSM design procedure

ECEU530. Schedule. ECE U530 Digital Hardware Synthesis. Datapath for the Calculator (HW 5) HW 5 Datapath Entity

problem maximum score 1 10pts 2 8pts 3 10pts 4 12pts 5 7pts 6 7pts 7 7pts 8 17pts 9 22pts total 100pts

Verilog Module 1 Introduction and Combinational Logic

ECE 2300 Digital Logic & Computer Organization. More Verilog Finite State Machines

Tutorial on VHDL and Verilog Applications

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

CSE140L: Components and Design

CS 151 Final. Q1 Q2 Q3 Q4 Q5 Total Credit Score. Instructions: Student ID. (Last Name) (First Name) Signature

CSE140L: Components and Design Techniques for Digital Systems Lab. FSMs. Instructor: Mohsen Imani. Slides from Tajana Simunic Rosing

ESE 150 Lab 07: Digital Logic

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

EEL 4783: HDL in Digital System Design

ECE2029: Introduction to Digital Circuit Design Lab 4 Building a Sequential Logic Circuit A Four Digit 7-Segment Display Driver

ENSC E-123: HW D3: Counter Applications; Counter in Verilog

CSE 140L Final Exam. Prof. Tajana Simunic Rosing. Spring 2008

EECS Components and Design Techniques for Digital Systems. Lec 07 PLAs and FSMs 9/ Big Idea: boolean functions <> gates.

General FSM design procedure

Lab 6 Debugging. Objective. Introduction. Prelab

Verilog Lecture Gandhi Puvvada, USC always statements, Coding a Flip-Flop. blocking and non-blocking assignments. Copyright 2008 Gandhi Puvvada 1

ELCT 501: Digital System Design

EE 231 Fall Lab 1: Introduction to Verilog HDL and Altera IDE

CSE140: Components and Design Techniques for Digital Systems

Synthesis vs. Compilation Descriptions mapped to hardware Verilog design patterns for best synthesis. Spring 2007 Lec #8 -- HW Synthesis 1

LABORATORY # 6 * L A B M A N U A L. Datapath Components - Adders

CSE 141L Computer Architecture Lab Fall Lecture 3

A3 A2 A1 A0 Sum4 Sum3 Sum2 Sum1 Sum

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Sciences

CSE 591: Advanced Hardware Design and Verification (2012 Spring) LAB #0

Midterm Exam ECE 448 Spring 2019 Wednesday, March 6 15 points

CPEN 230L: Introduction to Digital Logic Laboratory Lab #6: Verilog and ModelSim

University of California, Davis Department of Electrical and Computer Engineering. Lab 1: Implementing Combinational Logic in the MAX10 FPGA

VHDL Sample Slides Rev Sample Slides from the 2-day and 4-day VHDL Training Courses

Digital Design with FPGAs. By Neeraj Kulkarni

Two HDLs used today VHDL. Why VHDL? Introduction to Structured VLSI Design

Two hours - online EXAM PAPER MUST NOT BE REMOVED FROM THE EXAM ROOM UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE

CprE 583 Reconfigurable Computing

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1

L11: Major/Minor FSMs

Graduate Institute of Electronics Engineering, NTU. Lecturer: Chihhao Chao Date:

EECS 151/251A: SRPING 2017 MIDTERM 1

EECS Components and Design Techniques for Digital Systems. Lec 20 RTL Design Optimization 11/6/2007

CS2204 DIGITAL LOGIC & STATE MACHINE DESIGN FALL 2005

Laboratory Exercise 3

EECS150 - Digital Design Lecture 6 - Field Programmable Gate Arrays (FPGAs)

CSE 140L Final Exam. Prof. Tajana Simunic Rosing. Spring 2008

Transcription:

Exp#8: Designing a Programmable Sequence Detector Objectives Learning how to partition a system into data-path and control unit. Integrating Schematics and Verilog code together Overview In this lab you will design a programmable sequence detector. We will begin by partitioning the system into two blocks: a data-path unit and a control unit. The datapath contains blocks that only deal with data. They do not provide control to any other blocks and they themselves need to be controlled by the Control Unit. These blocks can be viewed as workers that can perform certain tasks (on the data) but need to be managed by someone. The manager in this case is the Control Unit that tells every worker what to do. Examples of data-path blocks include registers, counters, comparators, multiplexers, adders etc. Each of these blocks have control signals like load, count, enable, clear etc. which have to be controlled through the control unit. The general structure of a digital system is shown in Figure 1. Figure 1: General Structure of a Digital System. Arrows indicate the direction of the signals (input or output). External Control Signals specify the task required from the whole circuit (e.g. calculate the average of some integers). External Status Signals indicate the status of the whole circuit (finished processing, overflow, error etc.) External Data Inputs/Outputs contain the data going into or coming out of the circuit (e.g. integers to be averaged and the result of the average) 1

DP Control Signals are generated by the Control Unit to control different blocks in the data-path (t e.g. enable inputs in counters, shift inputs in registers) DP Status Signals indicate the status of some blocks in the data-path (e.g. when a counter reaches its maximum value or adder generates an overflow) Design Specifications You are asked to design a programmable sequence detector circuit. The circuit receives a continuous serial input. If at any time the input sequence matches a 4-bit stored pattern, it asserts a 1 at the output for 1 clock cycle. The user should be able to store a new pattern that is, he should be able to re-program the circuit. In addition to the clock signal, the circuit has 3 inputs; Prog (Program control), Sin (serial data in) and Reset (the global asynchronous reset). It has one output, Match that is asserted (i.e. set to 1) when a match is found. The circuit is programmed by asserting the Prog input and then entering 4 bits serially. When Prog is de-asserted the circuit operates normally (i.e. detecting the stored sequence in the input data). Figure 2 illustrate the block diagram of the circuit. Clock Sin Prog Match Reset Figure 2: Block Diagram of the programmable sequence detector circuit. Design Steps The block diagram of the design is shown in Figure 3. The SERIAL input provided by the user is given to the Data-path unit. The data-path generates two status signals, MATCH (which is also the circuit s output) and COUNTDONE. The input PROG is given to the Control Unit which generates four control signals for the data-path. These are SHIFT-A, SHIFT-B, ENABLE, and CLR. The data path consists of several registers, a counter and a magnitude comparator. The required components include: A-Register: A four 4-bit shift register which holds the serial input given by the user B-Register: Another four 4-bit shift register which holds the stored pattern. Comparator: This can be designed using XOR gates or the standard magnitude comparator given in the library. Its function is to compare the magnitudes of A-Register and B-Register. Its output is the MATCH signal. Counter3: A 3-bit counter used to count the number of bits entered. It generates an output COUNTDONE which is equal to 1, when the count reaches 4. 2

PROG CONTROL UNIT Match Sin DATA-PATH Figure 3: A Block Diagram of the Circuit Design. A block diagram of the data-path is shown in Figure 4. SERIAL 4-BIT SHIFT REG SHIFT-A SHIFT-B REGISTER-A 4-BIT SHIFT REG Magnitude Comparator 3-BIT COUNTER MATCH COUNTDONE Q2 Q1 Q0 ENABLE CLR REGISTER-B Figure 4: A Block Diagram of the Data-path Controllers in general need status information to decide on the next proper actions. In this circuit, the controller uses the signal COUNTDONE to determine when to do the magnitude comparison. A Block diagram of the Control Unit is given in Figure 5. SHIFT-A PROG COUNTDONE CLK RESET CONTROL UNIT SHIFT-B ENABLE CLR Figure 5: A Block Diagram of the Control Unit 3

The state diagram of the controller is shown in Figure 6. The controller FSM has only 2 states (STATE0 and STATE1). The RESET signal resets the system to the first state S0 and clears all the FF components. If the Prog input is 1, the FSM moves to the second state, and the B-Register is loaded with the Serial input provided by the user. Otherwise the serial data is loaded into the A register. Prog='0' RESET STATE0 shifta='1' Prog='1' clr3='1' COUNTDONE='1' STATE1 Enable3='1', ShiftB='1' COUNTDONE='0' Figure 6: The State Diagram for Control Unit Pre-Lab 1. Make sure to understand the design requirements 2. Identify the following signals: External Control Signals External Status Signals Data Input/Output Signals Data-path Control Signals Data-path Status Signals In-Lab 1. Model a shift register in Verilog and simulate it to verify its correct operation. 2. Model a 4-bit counter in Verilog and simulate it to verify its correct operation. 3. Model a magnitude comparator in Verilog and simulate it to verify its correct operation. 4. Model the data-path based on instantiation of your designed components. Simulate the data-path to verify its correct operation. 5. Model the control unit in Verilog and simulate it to verify its correct operation. 6. Create a Schematic Symbol of the Control Unit and Data Path Unit from the Project Manager. 7. Import it as a symbol in your top-level schematic and perform functional simulation of the Control Unit. 4

8. Import the control unit and data-path unit in the top-level schematic. Simulate the design to verify its correct operation. 9. Add Schematic Symbol of the debouncing circuit and add it to your schematic. 10. Implement your design on the FPGA board and verify its functionality. a. Constrain the Prog signal to a switch. The output should be constrained to an LED. b. Both the clock and reset signals should be constrained to push buttons. c. Make sure to connect the internal FPGA clock to T9. 11. The following three steps must be shown to the instructor during the lab: Complete Design, simulation of the circuits and verification on the board. 12. Complete the lab report and submit it before the next lab. Post-Lab Questions 1. Instead of using mixed design, design the whole circuit using Verilog. Refer to the introduction to Verilog presentation and the lab guide. Do you need to change the top-level module in this case? Grading Sheet There are 100 points awarded for this laboratory as follows: Points Possible Points Awarded Topics Addressed 10 /10 Pre-Lab Understanding of Design Requirements Identifying the signals(5) 65 /65 Lab Work Simulation (30) Verifying on the board (35) 25 /25 Lab Report Contents (15) Post lab and conclusions (5) Spelling, Grammar, and Style (5) 100 /100 Total 5