element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Digital Fever
  • Challenges & Projects
  • Project14
  • Digital Fever
  • More
  • Cancel
Digital Fever
Blog Prototyping with FPGAs - Part 3 - Sequential Logic with Quartus Prime on Cyclone-IV FPGA
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Digital Fever to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: yesha98
  • Date Created: 9 Apr 2021 7:47 PM Date Created
  • Views 4367 views
  • Likes 4 likes
  • Comments 0 comments
  • digitalfeverch
Related
Recommended

Prototyping with FPGAs - Part 3 - Sequential Logic with Quartus Prime on Cyclone-IV FPGA

yesha98
yesha98
9 Apr 2021

image

Here are the previous blogs in this series:

Prototyping with FPGAs - Part 1 - Basics

Prototyping with FPGAs - Part 2 - Combinational Logic with Xilinx ISE on Spartan 6 FPGA

 

Part 2 explains how to program a Spartan 6 FPGA using the Xilinx ISE, in this blog, I'll be explaining how to program a Cyclone IV FPGA using Quartus Prime software.

The design flow is the same for all FPGAs as mentioned in Part 2, just different names but the underlying algorithm is not much different.

 

I'm going to use the DE0-Nano Development board in this project. One good thing about using DE0 Nano is that it has a lot of supporting tools such as the Terasic System Builder which creates a project with all required files such as the master constraints and timing constraints files.

 

This blog will take you through a design of an 8-bit counter with a frequency divider in Verilog HDL to convert 50MHz into 1Hz clock frequency and implementation on Cyclone IV FPGA.

 

What is Sequential logic?

Sequential logic is a type of logic circuit whose output depends not only on the present value of its input signals but on the sequence of past inputs that means it has memory elements.

 

Design for FPGA:

Open Terasic System Builder and do the following steps:

 

{gallery} SB

image

Open Terasic DE0-Nano System Builder and select required system components

image

Save the generated files in project Directory

image

Generated Files

 

 

Now the required files such as the Quartus Prime Project File (QPF File), Quartus Prime Settings File (QSF File), and Synopsys Design Constraints File (SDC File) are generated in the project location.

 

Getting started with Quartus Prime:

 

 

{gallery} QP

image

Open the project from Quartus Prime

image

IMAGE TITLE: THEN IMAGE DESCRIPTION

image

Write the program for frequency divider and Counter

image

Add other files which are required for the design

 

I'm going to implement something very similar to this but in a different modeling style.

Why frequency divider?

The output clock frequency of the onboard clock is usually in the range of MHz to support fast computations, but in order to realize the counting, the clock speed should be slow enough to be visible to our naked eye.

Thus we divide the frequency to get lower clock frequencies.

 

Design of a frequency divider:

image

 

Verilog code:

image

The constant value here is 25 Million (where onboard clock = 50MHz), which signifies 0.5 seconds ON and 0.5 seconds OFF time of the 1Hz clock.

 

Design of 8-bit counter:

image

As you can see, the design is pretty simple, a series of flip-flops that store one bit of data and a full adder as discussed in Part 2 of the blog series.

 

Verilog Code:

image

 

Here the module Counter has the 50MHz onboard clock as the input thus we divide and reduce it to a 1Hz clock by feeding it to the Frequency divider module by instantiating it (see line 8).

Complete Design (Expected):

image

Synthesized:

image

 

 

Now it's time to write the constraints file for design implementation.

Constraints file:

image

 

SDC File:

image

 

As we have Synthesis, Implementation and bitstream generation in ISE, it's called as Analysis & Synthesis, Fitter and then Assembler in Quartus Prime. Apparently, all do the same job.

Hit compile!

image

 

 

Then Open the Programmer and then click on Start.

imageimage

Then it'll show the successful message once the device is programmed.

As the 8-bits of count is tied to the onboard LEDs (check constraints file). Thus, the output can be viewed onboard!

 

Output:

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Thanks for reading!

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube