Describing Sequential Circuits in VHDL

$24.99 $18.99

1 Introduction In this lab you will learn how to describe sequential logic circuits in VHDL. You will design a stopwatch measuring time every 10 milliseconds. Also, you will use pushbuttons and 7-segment LEDs to control the stopwatch when running on the Altera DE1-SoC board. 2 Learning Outcomes After completing this lab you should know…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Categorys:

Description

5/5 – (2 votes)

1 Introduction

In this lab you will learn how to describe sequential logic circuits in VHDL. You will design a stopwatch measuring time every 10 milliseconds. Also, you will use pushbuttons and 7-segment LEDs to control the stopwatch when running on the Altera DE1-SoC board.

2 Learning Outcomes

After completing this lab you should know how to:

  • Design a counter in VHDL

  • Perform functional simulation of the counter using ModelSim

  • Design a stopwatch measuring time at every 10 milliseconds

  • Test the stopwatch on the Altera board

3 Counters

A counter is a special sequential circuit. When counting up (by one), we require a circuit capable of “remembering” the current count and adding 1 the next time we request a count. When counting down (by one), we require a circuit capable of “remembering” the current count and subtracting 1 the next time we request a count. Counters use a clock signal to keep track of time. In fact, each increment occurs (or decrement) occurs when one clock period has passed. Since counters are the main building blocks of stopwatches, we will first design an 4-bit up-counter with an asynchronous reset (which should be active low) and an enable signal. The counter counts up when the enable signal is high. Otherwise, the counter holds its previous values. Use the following entity declaration for your VHDL description of the counter:

l i b r a r y I E E E ;

u s e

IEEE . STD_LOGIC_1164 .ALL;

u s e

IEEE .NUMERIC_STD. ALL ;

e n t i t y g N N _ c o u n t e r i s

P o r t ( enable

: i n

s t d _ l o g i c ;

reset

: i n

s t d _ l o g i c ;

clk

: i n

s t d _ l o g i c ;

count

: o u t

s t d _ l o g i c _ v e c t o r (3 d o w n t o 0) ) ;

end g N N _ c o u n t e r ;

Note that the up-counter that you have designed in this section will be used later in Section 5 to build a stopwatch. Once you have your circuit described in VHDL, you should simulate it. Write a testbench code and perform a functional simulation for your VHDL description of the counter.

Lab Assignment #2

4

You will now test your stopwatch circuit using the DE1-SoC board. Compile the circuit in the Quartus software. Once you have compiled the stopwatch circuit, it is time to map it on the Altera DE1-SoC board. Perform the pin assignment for both HEX displays and pushbuttons according to the aforementioned instruction. Make sure that you connect the clock signal of your design to 50 MHz clock frequency (see the DE1 user’s manual for the pin location of 50 MHz clock frequency). Program the board and demonstrate your stopwatch to the TA. You should be able stop, start and reset your stopwatch circuit using the pushbuttons.

Lab Assignment #2

5

6 Deliverables and Grading

6.1 Demo

Once completed, you will demo your project to the TA. You will be expected to:

  • fully explain how the HDL code works,

  • perform functional simulation using ModelSim, and

  • demonstrate that the stopwatch circuit is functioning properly using the pushbuttons and 7-segment LEDs on the DE1-SoC board.

6.2 Written report

You are also required to submit a written report and your code on myCourses. Your report must include:

  • A description of the counter and clock divider circuits. Explain why these two circuits are considered as sequential designs.

  • Explain why even though we could build a clock divider using an up-counter it is easier to build the divider using a down-counter.

  • A discussion of how the counter and clock divider circuits were tested, showing representative simulation plots. How do you know that these circuits work correctly?

  • A description of the stopwatch circuit. Explain why you created six instances of the counter circuit in your design and why?

  • A discussion of how the stopwatch circuit was tested.

  • A summary of the FPGA resource utilization (from the Compilation Report’s Flow Summary) and the RTL schematic diagram for the stopwatch circuit. Clearly specify which part of your code maps to which part of the schematic diagram.

Finally, when you prepare your report have in mind the following:

  • The title page must include the lab number, name and student ID of the students, as well as the group number.

  • All figures and tables must be clearly visible.

  • The report should be submitted in PDF format.

  • It should document every design choice clearly.

  • The grader should not have to struggle to understand your design. That is,

Everything should be organized for the grader to easily reproduce your results by running your code through the tools.

The code should be well-documented and easy to read.

McGill

Grading Sheet

Group Number:

University

Name 1:

Name 2:

Task

Grade

/Total

TA Signature

VHDL code for the counter circuit

/15

Creating testbench code for the counter circuit

/5

Functional simulation of the counter circuit

/5

VHDL code for the clock divider circuit

/15

Creating testbench code for the clock divider circuit

/5

Functional simulation of the clock divider circuit

/5

VHDL code for the stopwatch circuit

/25

Testing the adder circuit on the DE1-SoC board

/25

Total

/100

ECSE 222 – Digital Logic (Winter 2019)

Lab Assignment #2

6

Describing Sequential Circuits in VHDL
$24.99 $18.99