Computers are Hard

I’ve spent the last few weeks reviewing digital logic, FPGAs, Verilog, etc., and I’ve come to one main conclusion. This stuff is confusing, complicated, and hard.

It can also be elegant and, just like any well designed analog circuit, a smooth and simple implementation is truly a work of art.

I took a couple of classes a few years ago at Washington State University here in Pullman, WA, taught by Digilent’s co-founder Clint Cole. The basic building blocks were covered, things like latches, flip-flops, counters, clock dividers, adders, etc. From there we worked on sequential logic and state machines and the last project was a VGA video driver. I enjoyed both classes immensely and feel that I learned a lot regarding the basics of digital logic circuits. The only drawback was that we were doing everything using VHDL and not Verilog. That right there was enough to give me hours of syntax-based frustration. Now, I know each language has its strengths and weaknesses and I’m not here to say one or the other is better. I just wish I had learned Verilog from the beginning since it makes more sense to me. As an example, half of my frustration with VHDL was figuring out which libraries needed to be included, but with Verilog the libraries are included by default.

So now I find myself both refreshing old knowledge and learning new things as well. I’ve been using the Nexys 4, which was one of the first boards, along with the Basys 3, that Digilent produced that utilized the Artix-7 FPGA chip and was intended to be used with the Vivado tool suite from Xilinx. (The Nexys 4 was replaced by the Nexys 4 DDR when the original flash memory chips were discontinued.) I like the Nexys platform because it is designed with students in mind, intended to be used as a learning platform. There are numerous I/O peripherals built onto the board so building and testing most circuits requires no extra parts. This makes it easy to synthesize a simple latch using a couple of switches or pushbuttons as inputs and LEDs as outputs.

So after spending some time refreshing and learning, I then got my hands on one of the first Digital Discovery units we received in the warehouse and put together an FPGA project using the CMOD A7.

The all-new Digital Discovery.

The goal was to build a simple 7-segment LED driver on the FPGA, output all of the signals to an analog driver circuit, and run a 10k counter on an external 4 digit display.

Everything works great!

Everything worked well and the project highlighted the Digital Discovery’s capability of monitoring many digital signals all at the same time.

But then I decided that wasn’t enough. With the right settings in software and using the external High-Speed Adapter, the Digital Discovery can capture digital data at 800 MS/s, and with a system clock of only 12 MHz, the CMOD A7 just wasn’t fast enough. So I switched the whole project back to the Nexys 4 and clocked the Ones digit off of it’s 100 MHz system clock. I was thoroughly impressed with the results. Not only could it keep up and correctly capture the data, you could actually see the lag between signals that is a direct result of the differences in length of the PCB traces between the FPGA chip and the PMOD connectors used. The traces were never designed to be distance matched, so at this speed, you can actually see the impact it has.

100 MHz data sampled at 800 MS/s. Here is a higher resolution version of that same data.

What does this have to with computers? Everything! Anytime you use an electronic device, you are using a computer of some kind. In its most basic form a computer is simply a device that processes a given set of inputs and then outputs the result, right?

While computers can be difficult, and building a full computer from scratch is still beyond my own capabilities right now, there are still plenty of opportunities to learn. Here at Digilent we are constantly working to make electronics accessible and affordable for everybody, including FPGAs and microcontrollers capable of being programmed as computers.

Now, that wasn’t so hard, was it?

Author

Be the 1st to vote.

Leave a Reply

Your email address will not be published. Required fields are marked *