Posts Tagged ‘Verilog’

Visualize Music with a Muscled FPGA

Tuesday, September 13th, 2016

Picture of LED Music Visualizer with Zybo Board

The Zybo Board is one of the most powerful tools in FPGA and this is because it is FPGA combined with an ARM processor that widens the spectrum of possibilities with FPGA. Today’s post is yet another dive into Zybo’s possibilities and in this project a visualization of audio signals or music will be accomplished. The author has been very detailed about this project and has explained every aspect of it in 18 steps.

The Hardware needed for carrying out this project are the Zybo Zynq 7000 FPGA board, a neo pixel LED matrix, a 5V 10 A power supply, a female DC power adapter, 3 pin male to male header, a 1mF capacitor, an audio splitter and some jumper wires. The connection diagram is provided by the author in step 17.

The code basically uses the principle of FFTs to detect frequency components in the audio file. Depending upon the magnitude of frequencies received, the LED display has been programmed to light up. 16 steps starting from opening Vivado to run the code to generating a bit file for the FPGA has been provided by the author. You can download a zip file which contains all modules relevant to the project. The author has used a combination of C, custom Verilog and HDL to code the project. This gives an ease in defining GPIO ports and makes the circuit a lot simpler.

Another interesting aspect is that the FPGA has been so coded that with the help of switches, your LED matrix can either act as a spectrogram or as a visualizer seen in media players.

Let me challenge you to achieve similar results adapting your own FPGA!

By jtdykstra

Recreating Nintendo Chiptunes with FPGA and the 6502 processor

Tuesday, July 12th, 2016

Greetings FPGA lovers! Today’s project explores the possibility of using FPGA in combination with other processors to recreate the amazing Nintendo Chiptunes or Soundtracks that an entire generation of gamers are used to. The project uses a combination of FPGA with Verilog and the 6502 processor along with a Nesdev APU for audio generation.

The Hardware required for the project consists of the NIOS II FPGA, 6502 processor, Nesdev APU, SD card reader and a few other components needed to create the three primary blocks which are the timer block, length counter block and an envelope unit. These 3 blocks use a network of Mixers and PIOs besides the 5 channels available on the APU.

Out of the 5 channels available on the APU, only 4 channels have been used by the developers since the fifth channel (Delta Modulation Channel) is a time consuming endeavour. However the project does successfully emulate perfect chiptunes with the hardware. A detailed explanation of the Hardware used can be found here.

The coding used for this project is a combination of Verilog and C since FPGA and the 6502 are used. The Verilog Coding is used to extract Nintendo Sound Format files (.nsf) from the SD card reader onto the FPGA. The NSF files can be loaded on to the FPGA through the 6502 processor which has been coded in the C language using standard functions. NSF files can be stored on the SD card using a computer.

The NIOS II FPGA acts as an NSF player in this particular project.  It can be used to control playback, stop tracks or forward and rewind to the next or previous track.

Using just 4 channels in the APU the developers have done an amazing job and an example of the fruits of their labour (and an inspiration!) can be seen here.


By A. Heil and S. Zhao

How To Make Simon Says Game With Your FPGA

Tuesday, April 19th, 2016

Hi again FPGA people! Today I have another game for you to implement using your FPGA, Simon Says for 2 players. I know it´s a pretty old game but I promise you that it´s a very interesting project.

In this project you will have to make use of your hand skills both for coding and for connecting and playing with cables and stuff.

User input comes from a set of modified Rock Band drum kit.

WARNING: If you don´t want to play Frankenstein with your set of Rock Band drum kit, stop reading or find an alternative!

Right, so you will need a bunch of things to modify your drums: a breadboard, some resistors and caps, two dual retriggerable monostable multivibrators, wire and a ribbon cable. Everything is very well detailed in the article and they have even shared the schematics as well as all the project files. Click here to download them.

The other two major modules for this project are the output to a VGA monitor and the store & check module that compares the inputs from the two players to determine whether they match or not.

For the code the authors used Verilog HDL. I always recommend you to think and write your own code instead of just copying what is given, but this time I won´t. I would just say copy it and implement it. Then, try to develop any of their suggestions for improvements. We would love to hear what you have achieved.

Have fun!


By K. Akiko

Protect Your Home With a FPGA-based Alarm System

Tuesday, April 12th, 2016

Welcome back again FPGA addicts! Today we have a very interesting and useful project for you: Build your own alarm system with your FPGA.

This work was carried out by a group of students and it could perfectly serve as a baseline for any alarm system.

The project is developed in 6 easy steps. All you need to replicate it is the following: a FPGA (they used an Altera DEs-115 Cyclone IV), an IR Beam Break Sensor, an Arduino LilyPad Buzzer, a breadboard, some wires and a pull-up resistor. As you can well infer there is some minor manipulation in this project which is always funny and distracting. Cool stuff.

The alarm system is comprised of three modules: the main module, the display one and the sound module. The FPGA runs all the code. It receives information from the IR Beam Breaker Sensor and controls both the LED display to show whether the alarm is armed or not and the buzzer. The functioning of the alarm is quite simple, if the alarm is armed the LEDs will display “ON”, during this state if the IR beam is interrupted then the buzzer will go off and make noise. In any other state the alarm won´t activate and so there won´t be any acoustic sign and you won´t know if someone broke into.

All three modules are explained in detail, thus this project represent a very nice learning document both for system design and coding, even though all the code is given (but you should only use it as a way to check your work).  You can find all the files here.

It´s interesting to highlight that the code for the noise of the buzzer is based upon the code of a Music Box developed using a FPGA.

Let´s get hand on and wire up your house!


By TeamCaffeine

Quick Guide: 4 Easy Steps To Play Snake on Your FPGA

Thursday, April 7th, 2016

Hello FPGA lovers. I am sure you are going to love today´s post: How to implement Snake Game on your FPGA. Maybe some of you are too young to remember this everlasting game that has been popular generation after generation on a wide variety of formats. And as it couldn´t be less, Snake Game deserves to be played on a FPGA.

The tutorial I am presenting today was developed by a group of students from the University of Manitoba.  The project has 4 simple steps and all the hardware that you will need is your FPGA, a VGA monitor, a PS/2 keyboard, a USB cable and a power cable. Easy stuff here. Sorry for those hand-work lovers. More on that in future posts.

Well, getting back to the snake. According to the authors the more difficult parts to develop where the VGA output and the PS/2 keyboard input, as there is not too much information available on internet for its coding using Verilog. Read this, if you want to learn useful basics that will help you in future projects.

The FPGA that they used was an Altera DE2 Cyclone IV. Thus you may need to adapt the Verilog program to your FPGA. You can download the whole code here.

Another aspect I would like to highlight for you, it is their approach for coding the snake itself and what it eats, apples (funny uh). No they are not from IBM. Anyway, you may like to make your snake carnivore or a sweet lover so read these steps up and play with the code. Make your snake a dragon that eats carrots or whatever you want. This is the magic of coding.

We would love to see your modifications!

But as always, have fun!


By D. Lovegrove, I. Sweetland, K. Jacobson & R. Alves

How To Control A Joystick With Your FPGA

Tuesday, April 5th, 2016

Fantastic tutorial here today about how to add and control a joystick, using your FPGA.

This project is based upon a demo written in Verilog. However, the author used a Basys 3 FPGA board and thus she needed to transfer the Verilog code over to Vivado.

The hardware needed for this project is pretty simple, just the FPGA board, an USB  A to B micro cable and the joystick, which is connected via SPI.

Pretty much an implementation project if you have a Basys 3, Nexys 4 or Zybo FPGA board. You can find the files you need here.

In case you have a different FPGA, you will have to transfer or adapt the files to be read by your required programming environment.

Very easy tutorial that all that requires is you to follow the simple steps and, of course, buy a joystick!

Try this and you won´t regret as a whole new world of possibilities will be open for you and your FPGA, from playing video games to controlling a servo motor…More about this coming soon.

Have fun!


By kaitlyn1franz

How To Build Your Own Giant Digit Grid

Tuesday, March 8th, 2016

Today´s post presents a great article for almost everybody. Whether you like real making from scratch, writing code or just working with an FPGA, keep reading.

Somehow the author was fascinated by LED digit displays at some point in his life and so he decided he had to build his own giant LED digit grid. The final design consists of 64 panels of 7-segment digits displays (8 taking into account the decimal point), a total of 4096 LEDs! These diodes are grouped by 16, each group having its own PCB with input and output headers and a LED driver/controller. Then the whole design is controlled by a Spartan 3E FPGA. This guy chose to write the animations on Processing and send them over the FPGA serial port. So you can see there are candies for every taste in this store.

Read the full article to find out that the first draft of the design did not include the use of an FPGA…In the end it did and so did the Verilog code.

The schematic and the layout are given so those who love the smell of the solder can get straight hands on. And code guys are also lucky, there is no Verilog provided and just an example of a processing sketch for displaying the first 512 digits of pi, so you can do what you love to.

Like I said, a great project for everyone.



By Skot