Skip to content

Repository files navigation

Logo

Jerry's HDLBits Solutions Archive

Static Badge

An archive of my solutions to HDLBits, a Verilog/RTL practice platform developed by University of Toronto. Working through this self-directed over summer 2026 ahead of first-year Electrical Engineering at the University of Waterloo, as a means to explore my interest and expand my knowledge on RTL design & verification.

All problem sets are organized by topic in their respective folders.

Progress

151 / 182 problems complete (83%)

Progress

*progress paused for the next few weeks to work on a cool new project 🤫🧏

Skills I've Learned So Far

  • RTL fundamentals: combinational and sequential logic, blocking vs. non-blocking assignment semantics, avoiding unintended latch inference
  • Datapath building blocks: ripple-carry and carry-select adders, adder-subtractors, BCD arithmetic, multiplexers, priority encoders, population counters
  • Finite state machine design: Moore and Mealy machines, one-hot state encoding, hysteresis FSM, edge detection, dual-edge triggered flip-flops
  • Shift registers & LFSRs: Galois-style LFSR structure, tap selection for maximal-length sequences
  • Parameterized/generative design: generate for-loops for scalable adders and BCD chains, reduction operators on wide vectors
  • Grid-based sequential systems: Conway's Game of Life on a toroidal 16×16 grid, cellular automata (Rule 90/110)

Notes

A few problems worth calling out for the design decisions involved rather than being pure syntax exercises:

  • 32-bit LFSR: Galois-style LFSR structure, choosing correct tap positions for a maximal-length sequence.
  • 12-hour clock: multi-field state (hours/minutes/seconds) with carry logic between fields and edge cases at 12:59:59 → 1:00:00.
  • Conway's Game of Life (16×16 toroidal): implemented the full birth/survival/death rule set on a 256-cell grid, with wrap-around (toroidal) neighbor indexing so edge and corner cells correctly reference neighbors on the opposite side of the board using combinational arithmetic. The trickiest part was updating all 256 cells simultaneously on a single clock edge: computing each cell's next state requires reading the current state of its 8 neighbors, so the whole grid has to be treated as one snapshot rather than updated cell-by-cell. This meant being deliberate about blocking vs. non-blocking assignment. Thus, using non-blocking (<=) throughout the update logic to make sure every cell computes its next state from the same consistent snapshot of the board, rather than accidentally reading a neighbor's already-updated value mid-cycle.
  • Designing a Moore FSM for Water Reservoir Hysteresis Controller: a 6-state Moore machine overcoming a directional state-tracking problem. Utilizes vector to map physical sensor logic directly to state names, implementing directional tracking (rising vs. falling) to drive a supplemental flow rate valve (ΔFR) only when the level drops, and drive three distinct nominal flow rate outputs (FR1, FR2, FR3) when the level rises.

Repo Structure

Solutions are organized to mirror HDLBits' own categories, so it's easy to cross-reference against the site.

Solved Problems

Section Status
Getting Started ✅ Completed
Verilog Language (Basics, Vectors, Modules, Procedures, More Features) ✅ Completed
Circuits — Combinational Logic (Basic Gates, Multiplexers, Arithmetic Circuits, Karnaugh Map to Circuit) ✅ Completed
Circuits — Sequential Logic (Latches/FFs, Counters, Shift Registers) ✅ Completed
Circuits — More Circuits (Cellular Automata) ✅ Completed
Circuits — Finite State Machines ✅ Completed
Circuits — Building Larger Circuits 🔄 In progress
Verification — Reading Simulations ⬜ Not started
Verification — Writing Testbenches ⬜ Not started

Getting Started

Verilog Language

Basics

Vectors

Modules: Hierarchy

Procedures

More Verilog Features

Circuits — Combinational Logic

Basic Gates

Multiplexers

Arithmetic Circuits

Karnaugh Map to Circuit

Circuits — Sequential Logic

Latches and Flip-Flops

Counters

Shift Registers

More Circuits (Cellular Automata)

Finite State Machines

Up Next

  • Building Larger Circuits
  • Verification: Reading Simulations
  • Verification: Writing Testbenches

All solutions here were simulated successfully virtually with ModelSim and synthesized successfully with Altera Quartus.

Solutions by Zhiyuan (Jerry) Jiang

Problem sets and resources by HDLbits

About

An archive for my solutions to HDLBits (a RTL learning platform by UofT) problem sets, organized by topic

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages