inflearn logo

MNIST NPU Built with an FPGA — Completing an AI That Recognizes Real Handwritten Digits

Putting a neural network on an FPGA — it sounds familiar, but few people have actually done it. If you want to get ahead in capstone projects, competitions, or graduation projects, you need to go beyond training a model: you must be able to build and prove for yourself how its computations actually run inside a chip. This course helps you bridge that gap between theory and physical hardware. From reading the specifications to building a Python golden model, Machine Learning training, Verilog RTL design, and FPGA verification, you will complete a neural network accelerator (NPU) for recognizing MNIST digits written in real people’s handwriting from start to finish. From a Conv layer built with line buffers and parallel MACs, through ReLU, MaxPool, and Flatten, to fully connected layers and Argmax — you will integrate nine blocks into a single chip and prove for yourself that "the Python reference answer and the hardware output do not differ by even one bit (Bit-True)." The course also covers how to overcome that frustrating moment when the simulation runs perfectly, but the results are subtly different. We will walk through practical know-how that general deep learning textbooks do not cover, one step at a time — including integer quantization, array-axis ordering conversions, and preventing accumulator overflow. Drawing on the trial and error I have experienced through extensive work with RISC-V CPU design and FPGA Bit-True verification, I have built those lessons into this course so that you do not have to repeat them. By the end of the course, you will have a complete hardware project in hand and be able to say, "I designed it myself and proved it.&quot

17 learners are taking this course

Level Intermediate

Course period Unlimited

Artificial Neural Network
Artificial Neural Network
Computer Vision(CV)
Computer Vision(CV)
Verilog HDL
Verilog HDL
FPGA
FPGA
verification
verification
Artificial Neural Network
Artificial Neural Network
Computer Vision(CV)
Computer Vision(CV)
Verilog HDL
Verilog HDL
FPGA
FPGA
verification
verification

What you will gain after the course

  • One complete neural network accelerator (NPU) project—from specifications through RTL and verification—that can be submitted for a capstone project, competition, or graduation project.

  • The entire process of first fixing the hardware constraints, then directly training a neural network to fit them, quantizing its weights to integers, and porting it to the hardware—not simply using weights made by someone else, but gaining hands-on experience creating them from scratch through training.

  • Bit-True verification capability that directly proves the Python reference and hardware outputs do not differ by even a single bit — the expertise to turn “it seems to work” into “I proved they match exactly”

  • Design capability to directly implement Conv·ReLU·MaxPool·Flatten·Fully Connected·Argmax in Verilog RTL (including line buffers, parallel MACs, and accumulators)

  • Practical know-how for handling real-world pitfalls encountered when converting trained floating-point weights to integers, such as axis-order transformations, decimal-place adjustments, and preventing accumulator overflow

  • System integration experience in consolidating and verifying individual blocks into a single chip

  • The First Step in Designing an NPU ISA to Expand a Fixed Accelerator into an Instruction-Based Processor

Turn the neural network into a chip, not software.

An MNIST Recognition NPU—from Specifications to RTL and Verification—Designed Directly, Proven Down to the Last Bit.


Have you ever had these concerns?

You may have trained a model, but no one teaches you how to put it on an FPGA. You may have worked with Verilog, but never completed an entire neural network as a single accelerator. Perhaps you chose “AI hardware” as the topic for your capstone or graduation project, but feel overwhelmed about where to start. You converted floating-point weights to integers, and the simulation runs, but the results are strange. You’ve confirmed that it “seems to work,” but don’t know how to prove that it’s actually correct.


The answer this course provides

In this course, you will build a neural network accelerator (NPU) that recognizes MNIST digits, starting with reading the specifications and covering everything through the Python golden model, training tailored to hardware constraints and integer quantization, Verilog RTL design, and FPGA Bit-True verification without skipping a single step.

When the course ends, you will have a complete hardware project in your hands that you can submit as-is for a capstone project, competition, or graduation project. And you will be able to say, “I trained it, designed it, and proved it down to the very last bit myself.”


This course’s unique shortcut

First, hardware comes first, and training comes next. Rather than using weights created by someone else, you first lock in hardware constraints such as bit widths and operation order, then train the neural network yourself to match them. The Python model becomes the bit-level blueprint for the RTL.

Second, we turn “seems to work” into “matches exactly.” We put Bit-True verification front and center, proving that the Python integer golden model and the RTL output do not differ by even a single bit. We also convey the practical pitfalls as they are, including why it is easy to be misled when only the class matches and why large-scale verification is necessary.

Third, we move from an accelerator to a processor. Rather than ending with a single example, we open the path to extending a fixed accelerator into an instruction-controlled processor (NPU ISA).


Curriculum at a Glance (7 Sections · 10 Lessons · 7 Hours 7 Minutes)

Section 1. The Language of Design — How to Read the MNIST NPU Specification
Section 2. Python — The Hardware Ground Truth (Golden Model), Training, and Integer Quantization
Section 3. Feature Extraction Circuit — Line Buffers and 4-Channel Parallel MAC
Section 4. Transformation and Decision Circuit — ReLU, MaxPool, Flatten, Fully Connected, and Argmax
Section 5. Integration and Verification — Nine Blocks into One Chip, Proven Bit-True
Section 6. Extension — NPU ISA and a Mini Compiler
Section 7. Setting Up the Practice Environment — What to Check Before Simulation


Recommended for

Recommended for undergraduates preparing capstone projects or graduation works on AI hardware, competition participants seeking distinctive results, engineers at design companies looking to expand their expertise into NPUs and AI accelerators, self-directed hardware engineers who want hands-on building and verification experience beyond what theory books offer, and prospective graduate students planning a career in NPU design.


Prerequisite knowledge

Basic knowledge of Verilog HDL and digital logic design is sufficient. You only need to be able to read and run Python code, and no deep learning theory is required—we explain neural network operations from the hardware perspective from the ground up. Even if you are new to FPGA tools, Section 7 guides you through setting up the environment.

Recommended for
these people

Who is this course right for?

  • A practicing hardware engineer working at a semiconductor or design company who wants to broaden their expertise into AI accelerator and NPU design — someone familiar with RTL design but in need of experience completing and verifying a neural network as a single accelerator.

  • Self-motivated engineers who want to steadily improve their skills even while busy with practical work—those seeking hands-on projects they can build themselves and validate with Bit-True accuracy, beyond what textbooks alone can provide.

  • Electrical, electronics, and semiconductor engineering undergraduates who chose “AI hardware” as the topic for their capstone or graduation project but feel overwhelmed about how to convert a neural network into RTL and deploy it on an FPGA

  • Participants who need a result that stands out in a competition — those who want to showcase an “NPU they designed themselves and proved Bit-True,” rather than model training.

  • A graduate school applicant who wants to pursue a career in NPU and AI accelerator design and needs hands-on implementation and verification experience, not just theory.

Need to know before starting?

  • This course is intended for those with a basic understanding of Verilog HDL and digital logic design.

  • Basic Python syntax sufficient to read and execute the golden model code is enough.

  • Experience with FPGA simulation tools is preferred.

Hello
This is EdgeChipLab

Career Verified

268

Learners

6

Reviews

1

Answers

4.8

Rating

16

Courses

"In the AI era, the surest response is to build AI semiconductors yourself."

This program is neither a theory-focused university course nor the standardized curriculum of a contract department tailored to specific specifications. Nor is it limited to simply gaining experience using EDA tools or leveraging libraries, as in conventional fragmented practical seminars.

Designed and FPGA-verified by a practicing engineering professor with 30 years of experience, who began as a system semiconductor researcher at Samsung Electronics’ DS Division, received the Silver Award (Group Chairman’s Award) at the Samsung Technology Awards for design automation, and served as Director of Samsung’s UK and German subsidiaries and head of the System LSI marketing and sales group, this is a one-of-a-kind, hands-on course.

We also provide free web-based practice tools developed by the author: EdgeTCAD, EdgeAssembler, and EdgeVerilog.

We have created an educational environment where students can directly simulate and analyze the structures, operating principles, and electrical properties of semiconductor devices such as PN junctions, MOS capacitors, planar MOSFETs, 3D FinFETs, and GAA on their own PCs using the semiconductor device simulation tool EdgeTCAD.

With EdgeAssembler, you can convert RISC-V Assembly into Machine Code and Instruction Encoding and inspect the results, and use EdgeVerilog to design RTL and simulate it on your PC.

(Free to run: https://www.semiconductorschool.co.kr → click the 'LAUNCH' button)


[ Key differentiators for industry professionals and aspiring engineers ]

Architecture design skills—rather than connecting off-the-shelf IP or modifying code, directly design the RV32I five-stage Pipeline (IF·ID·EX·MEM·WB) in RTL, including Data Hazard Forwarding, Load-Use Stall, and Branch handling. Understanding and directly working with the five-stage Pipeline is what sets your design skills apart.

From Algorithm to RTL — Implement an MNIST CNN as NPU RTL, starting with a Python model and applying Quantization, then verify that the Python and hardware results match bit-for-bit for the same input. The key is to achieve 100% identical results in Python and Verilog and produce results from actual FPGA operation.

CPU + NPU + RTOS integration on a single FPGA — Put everything on a single device: a CPU you designed running an NPU you designed, with FreeRTOS implemented by EdgeChipLab running on top. Students can use all these publicly available RTL and code resources to create their own semiconductor chips.

Free RTL design and simulation environment — With our in-house developed EdgeVerilog v1.0, you can write Verilog RTL, run simulations, and analyze waveforms on a PC or smartphone without signing up or installing any software. We provide a real simulation environment based on Icarus Verilog and 52 design examples for free, making it easy for anyone to get started with semiconductor design practice.

AI Algorithm → RTL Design → FPGA Implementation → Bit-True Verification → AI SoC

It provides an unparalleled, top-tier practical guide not only for undergraduate and graduate students, but also for working professionals looking to advance into next-generation AI semiconductor/SoC design.

 

Beyond theory to actual AI hardware implementation

It is difficult to develop system-level AI semiconductor design skills with only scattered, fragmented knowledge.

Students will not stop at using finished black-box IP. The goal is to progressively develop the system design skills to design an AI NPU and a 5-stage Pipeline RISC-V CPU themselves, integrate memory and peripherals, port an RTOS on top of them, and ultimately build their own AI SoC.

Starting with the fundamentals of transistors and digital circuits, this course connects FPGA, CPU, and NPU technologies to hardware for accelerating Transformers and LLMs.

 

We validate the research results on actual FPGA hardware.

This is not a lecture you only watch. Rather than stopping at theory or simple simulations, you will run AI semiconductor circuits you designed yourself on an actual FPGA and perform Bit-True verification, confirming that the Python model and RTL results match down to the last bit.

The instructor also connects research results, including four KCI-indexed papers on AI semiconductors, FPGAs, and RISC-V, to the educational content, taking technologies validated through research into actual design and FPGA implementation. The source code needed for the exercises—including a self-developed RISC-V CPU, Python code for image training, and Verilog RTL—is made available.

Built around the affordable Arty S7-25 FPGA board and the free Vivado design tool, this course enables learners to reproduce the entire process of designing, implementing, and verifying their own work. It can also be used with Digilent FPGA boards, including the Zybo Z7. Simply modify the XDC pin mapping (board) and clock division parameters (RTL) to match your board. The 'MNIST NPU with FPGA' course only requires modifying the XDC pin mapping, while courses that use an OLED and camera require modifying the clock division parameters (RTL).

→ The divider parameters for the course exercises are set based on the Arty S7’s 100 MHz input clock. Since other boards have different input clocks (for example, the Zybo Z7 has a 125 MHz input clock), you will need to recalculate the divider value so that the target frequency remains the same. If you miss this, the screen or video may not display properly,which can easily be mistaken for a code error, so please check.


Free RISC-V and Verilog Practice Environment — EdgeAssembler · EdgeVerilog

You can now start semiconductor design practice in your web browser without installing any software.

EdgeAssembler and EdgeVerilog, developed by the instructor, are free educational tools for hands-on practice. In EdgeAssembler, you can see how RISC-V Assembly is converted into Machine Code, and in EdgeVerilog, you can design and simulate RTL that processes those instructions. They run directly in your web browser, with no need to install separate EDA software.

Key Features of EdgeAssembler

  • Assembly → Machine Code: Convert RISC-V Assembly to Machine Code (HEX)

  • Instruction Encoding Display: Select a Machine Code row to display its 32-bit binary representation and illustrate the opcode, rd, funct3, rs1, rs2, and imm fields.

  • Immediate Reconstruction: Reassemble scattered immediate bits, as in B-type and J-type, and display the offset and target address as well.

  • TinyRV32I Target: Tests tailored to the range of instructions supported by the textbook CPU

  • Encoding verification tool: Does not execute hardware; actual behavior is verified through EdgeVerilog’s RTL Simulation.

    1.png.webp


    2.png.webp


Key Features of EdgeVerilog

  • Actual RTL Simulation: Compile and simulate based on the open-source Icarus Verilog 12

  • Waveform Viewer: Observe signal changes, zoom, display HEX/DEC/BIN, position the cursor at signal changes, navigate to the previous or next change, and expand bus bits.

  • Example Library: Provides 52 digital circuit design examples, including counters, FSMs, and CPUs.

  • Project management: Write RTL and testbenches, autosave, and ZIP export/import

  • Mobile Support: Edit RTL, run simulations, and analyze waveforms on smartphones as well

  • Free of charge: Freely available for educational and non-commercial purposes.

sim.png.webp


sim2.png.webp


Using the two tools together, learners can explore everything from introductory Verilog-HDL and FSMs to AXI4 and RISC-V CPU design, and verify everything from instruction encoding to RTL.

Run for free: https://www.semiconductorschool.co.kr
Click the ‘LAUNCH’ button on the website to get started right away—no installation required.

EdgeAssembler is a tool for checking instruction encoding, and EdgeVerilog is an educational tool for RTL functional verification. FPGA synthesis, implementation, and timing verification are performed in Vivado.


A seamless full-stack roadmap: from fundamentals to a mini LLM accelerator

Each lecture is part of a journey toward completing one vast system, not an isolated fragment.

  • Step 1: Fundamentals of AI Theory and Image Processing (Including Machine Learning)

  • Step 2: AI Accelerator (NPU) Design and Verification (Including Machine Learning)

  • Step 3: 5-Stage Pipeline RISC-V CPU Design and System Integration

  • Step 4: Advanced AI SoC Implementation and Expansion into a Mini LLM Acceleration Platform (Ongoing Content Updates)

     

 

Objective Verification Metrics

All design deliverables from this course have undergone rigorous validation against global standards and by the academic community.

  • 5-Stage Pipeline RISC-V Architecture Verification: In-house developed RISC-V CPU passed the international foundation’s official compliance test (ACT), and its source code was released (GitHub)

  • Academic Recognition: Four sole-authored academic papers published in IJIBC, a prestigious KCI Grade A journal.

  • Global Recognition: Published four global Amazon technology books (reached #1 bestseller status)


    Published books: Roger Kim: books, biography, latest update

  • Real-World Operation Verification Complete: Core IPs, including the RV32I CPU, NPU, vision system, GPS, Transformer, and AURA-Edge SoC, operate flawlessly in the Arty S7 environment.

     

Take on the challenge. By the end of this process of loading your own code onto the board and verifying the results, you will have leveled up into a hardware engineer with a completely different perspective.

More

Curriculum

All

10 lectures ∙ (4hr 39min)

Published: 
Last updated: 

Reviews

Not enough reviews.
Please write a valuable review that helps everyone!

EdgeChipLab's other courses

Check out other courses by the instructor!

Similar courses

Explore other courses in the same field!

25% off for new members

$153.50

25%

$203.50