HDL2Chips

Interactive Hardware Design Platform

LOADING...
Initializing HDL workspace...

Master Verilog & SV

HDL2Chips is the premier interview prep platform for hardware engineers. Solve industry-standard FPGA and ASIC design problems.

NVIDIA INTEL AMD APPLE QUALCOMM BROADCOM
Interactive Preview

Experience our Pro IDE

top.v
LIVE

D Flip-Flop

Medium
top d clk q

Problem Statement

Build a module that captures the sensor value at the clock tick and holds it until the next tick. When the clock rises, q takes d. Between ticks, q stays unchanged.

Input/Output Examples:
clk=0, d=0 -> q=0
clk=0, d=1 -> q=0 (mid-cycle change ignored)
clk=↑, d=1 -> q=1
clk=0, d=0 -> q=1 (still holds)

Constraints

  • Module name: top
  • Inputs: clk, d (1-bit each)
  • Output: q (1-bit)
  • Use always @(posedge clk)
  • Use non-blocking assignment (<=)
Execution Output
Console ready. Click Run or Submit to see outputs...
Cursor: 0 ns
SIGNAL VALUE
clk 0
d 0
q 1

No Waveform Yet

Click ▶ Run to compile your code
and generate the signal waveform.

Verilog
123456789
module top (
    input  clk,
    input  d,
    output reg q
);

    // Write code here...

endmodule
WHY HDL2CHIPS

Master the skills for top-tier hardware roles.

Interactive Waveforms

High-contrast, zoomable signal viewing—just like industry-standard logic analyzers.

Split-Pane IDE

A pro-grade 3-pane IDE: Detailed Specs | Smart Editor | Simulation Console.

Instant Verification

Lightning-fast simulation with real-time pass/fail feedback and success animations.

Career Path Ranks

Progress from Trainee to Silicon Master through our comprehensive 10-level hardware curriculum.

Global Leaderboard

Compete with a global community of engineers and track your standing in real-time.

Activity Heatmap

Visualize your consistency and dedication with our GitHub-style practice tracker.