DLDLAB3 Spring1404
DLDLAB3 Spring1404
College of Engineering
School of Electrical & Computer Engineering
Experiment 3
Sessions 5, 6, 7
Sequential Synthesis and FPGA Programming
Digital Logic Laboratory
ECE 045, ECE 895
Laboratory Manual
Spring 1404
DLDLab Sequential Synthesis and FPGA Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Contents
Contents 1
Introduction 2
2 RTL Design 3
2.1 Onepulser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Finite State Machine and the counters . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3 Shift Registers and Demultiplexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.4 Seven Segment Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3 MSSD Implementation 5
Appendices 6
A Using Quartus II 6
A.1 Create the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
A.2 Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
A.3 Pin Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
A.4 Program the Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
A.5 Examine the Timing and Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Acknowledgment 7
Introduction
The first goal of this experiment is to introduce the concepts of state machines that are mostly used
for controllers. The second goal is to get familiar with FPGA devices and implementation.
By the end of this experiment, you will learn:
• Design simulation
• Synthesis
• FPGA programming and implementation
no other information. The two bits that follow are the port number, p, MSB first in time. The next
5 bits are the number of bits, n, MSB comes first in time. With 1 + 2 + 5 + n clock cycles after
serIn becomes 0, it will return to 1 and another transmission begins with another start-bit. Data
on serIn are synchronized with the MSSD clock, clk. This demultiplexer extracts the destination
port and the number of bits that will go to the destination port. Following this, the next n bits will
be transmitted to the destination port. Four output ports, px, will be used to transfer the data of
each destination and one output port will be used to show the destination port’s data count on the
seven-segments (pDcnt).
In addition to these output ports, a done signal, and a serOutvalid signal are the outputs of MSSD.
The done signal becomes 1 when the data transmission to the specified port is completed.
2 RTL Design
figure 2 shows the RTL design of this experiment. As shown six main components are needed for
describing this design.
2.1 Onepulser
The one-pulser module provides a clock-enable input for the controller of this design. This input
(clkEn) is used for controlling the clock when the circuit is implemented on an FPGA board. The
one-pulser connects to a push-button on your board (clkPB) and when pressed it creates a single
pulse that is synchronized with the system clock. The output of this circuit connects to the clock
enable input (clkEn) of the sequence detector, shift registers, and counters.
3. As mentioned, three counters are required: one for counting the port detection clock cycles,
another for counting five clock cycles to determine the number of data bits (n), and the last
one for counting cycles for transferring data bits. These counters are referred to as the port
counter, data number counter, and data transfer counter, respectively. Please write the Verilog
description of the counter modules.
Appendices
Appendix A Using Quartus II
A.1 Create the Project
1. Click on File ▷ New Project Wizard
2. Create an appropriate directory for your project and complete the form
3. Select the FPGA device as Cyclone EP2C20F484C7 and then click Finish
A.2 Compilation
• Select Processing ▷ Start Compilation
• Click on quick shortcut ▶
There may be lots of warnings and some errors after compilation. The warnings are not so
important while the errors should be completely removed.
From Assignments ▷ Pin Planner, Pin Planner window will appear and you can select the
corresponding locations from the list. When you are done with this, recompile your project.
Acknowledgment
This lab manual was prepared and developed by Katayoon Basharkhah, Ph.D. student of Digital
Systems at the University of Tehran, under the supervision of Professor Zain Navabi.
This manual has been revised and edited by Zahra Mahdavi Ph.D. student of Digital Systems
at the University of Tehran, Zahra Hojati, and Iman Rasouli undergraduate students of Electrical
Engineering at the University of Tehran.