D flip-flop with synchronous reset
📖 Scenario: In digital electronics, a D flip-flop stores a single bit of data. It changes its output only on the clock's rising edge. A synchronous reset means the flip-flop resets its output to 0 only when the clock ticks and the reset signal is active.
🎯 Goal: You will build a simple D flip-flop module in Verilog with a synchronous reset input. This flip-flop will store the input d on the rising edge of the clock clk, and reset the output q to 0 when reset is high during a clock edge.
📋 What You'll Learn
Create a module named
d_flip_flop with inputs d, clk, reset and output qUse an
always block triggered on the rising edge of clkInside the
always block, check if reset is high to set q to 0Otherwise, assign
d to qUse non-blocking assignments
<= inside the always block💡 Why This Matters
🌍 Real World
D flip-flops are fundamental building blocks in digital circuits used for memory, registers, and state machines.
💼 Career
Understanding flip-flops and synchronous resets is essential for hardware design engineers working with FPGAs and ASICs.
Progress0 / 4 steps