The FPGA Programming Handbook — A Review

David Such
7 min readMay 20, 2024

--

Packt are the publishers of The FPGA Programming Handbook by Frank Bruno and Guy Eschemann. Recently, they were kind enough to provide me with an advance copy of this book for review.

If you don’t know what FPGA stands for (it’s Field Programmable Gate Array), then this book is probably not for you. In a recent interview, Guy Eschemann said that “Designing an FPGA for an application is maybe an order of magnitude more effort than writing software for an off-the-shelf microcontroller.” I think he is underselling it. Not only is FGPA development difficult in of itself, but there are not many resources available to learn how to do it and get help when things go wrong. Which brings us to the book.

Frank Bruno and Guy Ecshemann

For a technical book, you want to know whether the authors know what they are talking about. Frank Bruno is an Electrial Engineer with a Master of Science in Electrical Engineering. He also has over 30 years experience designing FPGA and ASIC (Application Specific Integrated Circuit) systems, with everyone from BAE, AppliedMicro and, Analog Devices to SpaceX and Cruise (self-driving cars).

Guy Eschemann was an Electrical Engineer with over twenty years of experience designing FPGA-based embedded systems for automotive, industrial, medical, aerospace, military and telecom applications.

It appears that we are in safe hands!

Target Audience

The FPGA Programming Handbook is targeted at people interested in learning about FPGA technology and its applications. The book assumes no background in programming or hardware design, making it an excellent resource for hobbyists, students, and anyone keen on exploring FPGA technology from the ground up.

Having said that, the reality is that you probably wouldn’t use an FPGA unless you needed to. The people likely to need FPGAs will also likely have a technical background and some experience in embedded development. This applies even more to ASICs.

FPGAs and ASICs are similar in some respects, but also have some big differences. ASICs are custom-designed chips for a specific application or function. Once designed and manufactured, they cannot be altered or reprogrammed. If FPGAs are an order of magnitude more difficult than traditional development then ASICs are even worse. As mentioned in Chapter 1 of the book, the capex “for a 7nm chip is $25 million to $30 million…” You don’t want to make a mistake in your ASIC design! In addition ASIC development tools can cost millions of dollars.

Not many hobbyists or makers will have the budget to tinker with ASICs, but FPGAs are a lot more affordable, many tools are free, and the ICs are re-programmable. Based on this, I believe those who would benefit most from this book would be:

  • Engineers who design and implement digital circuits and systems using FPGAs.
  • Graduate or advanced undergraduate students in electrical engineering or computer engineering programs who need a comprehensive understanding of FPGA architectures, programming languages, and tools.
  • Individuals who work with hardware description languages (HDLs) such as SystemVerilog, Verilog, and VHDL to create and test FPGA designs.
  • Hobbyists/Makers who have a strong interest in digital design and want to learn about FPGA development for personal projects.
  • Educators teaching courses on digital design, FPGA development, and related subjects. The book’s structured approach, from basic concepts to advanced topics, provides a good curriculum guide.

Why would you use an FPGA?

I said above you wouldn’t use one of these suckers unless you needed to, so why might you need to?

  • Rapid Prototyping: If you need a custom chip its a lot quicker and cheaper to develop, and iterate on a prototype using an FPGA.
  • Parallel Processing: FPGAs excel at parallel processing tasks, making them suitable for applications that require high-speed data processing, such as digital signal processing (DSP), image processing, and real-time data analysis.
  • Performance Optimisation: FPGAs can be customized to accelerate specific algorithms and applications, providing significant performance improvements over general-purpose processors.
  • Specific Interfacing Requirements: FPGAs support custom or multiple standard interfaces which respond to interface events without the software overhead.
  • Custom Solutions: FPGAs allow you to implement custom hardware solutions that are tailored to specific application requirements, providing advantages in niche markets where off-the-shelf solutions are inadequate.

Content Overview

The book starts with the basics and gradually progresses to more complex topics. This is a summary of what each chapter covers:

  1. Introduction to FPGA Architectures: Provides an overview of ASICs and FPGAs, Boolean logic, and fundamental gates, setting the foundation for understanding FPGA technology.
  2. FPGA Programming Languages and Tools: Introduces Hardware Description Languages (HDLs) like SystemVerilog and VHDL, and essential tools like Vivado and Vitis for FPGA development.
  3. Combinational Logic: Explores combinational logic design, creating SystemVerilog modules, and writing self-checking testbenches.
  4. Counting Button Presses: Builds on combinational logic with storage elements, clock synchronization, and a practical project on counting button presses.
  5. Let’s Build a Calculator: Delves into state machines and more complex design projects, such as a calculator and a traffic light controller.
  6. FPGA Resources and How to Use Them: Examines FPGA resources like PDM microphones and I2C temperature sensors and their integration into projects.
  7. Math, Parallelism, and Pipelined Design: Discusses fixed-point and floating-point arithmetic, parallelism, and pipelined designs for enhanced performance.
  8. Introduction to AXI: Covers the AXI standard for interfacing IP cores and using IP integrators for design integration.
  9. Lots of Data? MIG and DDR2: Explains how to interface with large external memory (DDR2) using the Memory Interface Generator.
  10. A Better Way to Display — VGA: Implements VGA displays for more advanced output capabilities, such as displaying text and audio data.
  11. Bringing It All Together: Integrates various inputs and outputs, including keyboards and sensors, with VGA displays to create comprehensive projects.
  12. Using the PMOD Connectors — SPI and UART: Explores PMOD connectors, creating reusable components for UART and SPI interfaces.
  13. Embedded Microcontrollers Using the Xilinx MicroBlaze: Introduces the MicroBlaze processor, its implementation, and software development.
  14. Advanced Topics: Covers advanced SystemVerilog concepts and verification constructs, along with practical tips and common pitfalls.

Recommended Hardware

If you want to follow along with the examples in the book you will need an FPGA development board like the Nexys A7. At the time of writing, this costs USD349.00 from Diligent.

Hardware Languages — SystemVerilog/Verilog vs VHDL

Verilog and SystemVerilog are hardware description languages used for designing and verifying digital circuits. Verilog, resembling the C programming language, is known for its concise syntax, making it suitable for both design and verification. SystemVerilog extends Verilog by adding advanced features for verification, including object-oriented programming capabilities and more complex data types.

// Sample Verilog Code - 2 input AND gate
module and_gate (
input wire a, // Input a
input wire b, // Input b
output wire y // Output y
);

assign y = a & b; // AND operation

endmodule

VHDL, on the other hand, is a hardware description language similar to Ada, emphasizing readability and strong typing. It requires more explicit declarations and offers a wide range of data types, making it preferred in industries where reliability and maintainability are crucial, such as aerospace and defense.

-- 2-input AND gate in VHDL
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity and_gate is
Port (
a : in STD_LOGIC; -- Input a
b : in STD_LOGIC; -- Input b
y : out STD_LOGIC -- Output y
);
end and_gate;

architecture Behavioral of and_gate is
begin
y <= a AND b; -- AND operation
end Behavioral;

The main difference between them is that Verilog/SystemVerilog is often chosen for its simplicity and powerful verification features, while VHDL is favored for its rigor and strong typing, particularly in high-integrity applications.

Vivado IDE [Image Credit: Xilinx]

Vivado is the Xilinx tool that the book uses to implement, test, download, and debug their HDL designs. You can download a free copy of this software. Note that the current version is Vivado™ ML 2023.2, while the book uses version 2022.2. There are only installers for Windows and Linux, not macOS.

The Vivado IDE will work with either SystemVerilog or VHDL, and includes a simulator (XSIM). All of the code examples for the projects in the book are provided for SystemVerilog and VHDL. I understand the thinking behind this, but if you are a beginner, you only want to learn one language at a time. The most approachable is SystemVerilog.

The code used in the book may be downloaded from the PacktPublishing GitHub repository. In the early review copy that I had, the link provided to the code was incorrect and went to an earlier book by Frank called FPGA Programming for Beginners (e.g., https://github.com/PacktPublishing/LearnFPGA-Programming/tree/master/CH3.). No doubt this will be fixed in the published version.

Conclusion

The FPGA Programming Handbook is an excellent resource for anyone looking to learn more about FPGAs and their associated tool chains. Its clear explanations, practical examples, and progressive structure make it suitable for beginners and those with a bit of technical background alike. Whether you are a student, hobbyist, or professional seeking to expand your knowledge, this book provides a thorough and accessible introduction to FPGA programming.

The book is available for purchase on Amazon.

If you enjoyed this article and would like to help support my writing, then please show your appreciation by following me, clapping (up to 50 times), highlighting or commenting! Alternatively, you can buy me a coffee or subscribe, to get an email whenever I publish a new article.

--

--

David Such

Reefwing Software · Embedded Systems Engineer · iOS & AI Development · Robotics · Drones · Arduino · Raspberry Pi · Flight Control