Sir Syed CASE Institute of Technology, Islamabad: Digital System Design Lab
Sir Syed CASE Institute of Technology, Islamabad: Digital System Design Lab
Remarks: ……………………………………………
Objectives:
1. Learn how to implement a finite state machine using Verilog.
2. Getting familiarity of steps involve in designing sequence detector and its implementation on
FPGA
Introduction
Field Programmable Gate Array (FPGA):
FPGAs are programmable semiconductor devices that are based around a matrix of Configurable
Logic Blocks (CLBs) connected through programmable interconnects. As opposed to Application
Specific Integrated Circuits (ASICs), where the device is custom built for the particular design,
FPGAs can be programmed to the desired application or functionality requirements. Although
One-Time Programmable (OTP) FPGAs are available, the dominant type are SRAM-based
which can be reprogrammed as the design evolves.
FPGAs allow designers to change their designs very late in the design cycle– even after the end
product has been manufactured and deployed in the field. In addition, Xilinx FPGAs allow for
field upgrades to be completed remotely, eliminating the costs associated with re-designing or
manually updating electronic system
Pinout diagrams
LEDs
The Spartan-3 Starter Kit board has eight individual surface-mount LEDs located above the push
button switches, indicated by in Figure 1-2. The LEDs are labeled LED7 through LED0. LED7 is the
left-most LED, LED0 the right-most LED. Table 4-3 shows the FPGA connections to the LEDs.
Output is a function of present state only. Output is a function of present state and
input.
Synchronous outputs Asynchronous outputs.
Lab Task:
Build an electronic combination lock with a reset option, two number inputs (0 and 1), and an
unlock output. The combination should be 101. Whenever a user input this sequence the lock
should be open and a sequence is detected.
You have to write the Verilog code for the following state transition diagram and verify your
design using FPGA.
Procedure:
Write a Verilog code and test your state diagram with the help of following steps
Design Steps:
1. Design: it involves the Verilog code for your state machine as well as the module to slow
down the FPGA clock.
Clock Synchronization
To run your code on FPGA you need to slow down the FPGA clock for visualization of results as
it is running on 50 MHz.
1. Compilation
2. Simulation
3. User Constraint: Then create a UCF file to run your code on fpga
Labs Rubrics
Experiment # 5
Implementation of Finite State Machine
In Verilog using FPGA