Skip to content
Hackerland LogoHackerland
Hardware Description Languages

Digital Logic HDL & GTKWave Waveform Studio

Hardware Description Language (HDL) Digital Simulator

Cycle-accurate Verilog synthesis & testbench simulation workbench modeled after Verilator, Icarus Verilog, ModelSim, and GTKWave. View register transitions, multi-bit bus decodes, and export standard IEEE 1364 VCD files.

IEEE 1364-2001 VerilogModelSim / QuestaGTKWave VCD
Digital Circuit Topologies
Logic LUTs
4 LUT6
Registers (FF)
4 D-FFs
Clock Timebase
10 ns (100 MHz)
Total Duration
200 ns Simulated
Hardware Synthesis Theory & RTL Logic

In sequential digital logic, flip-flops latch state on clock edge (posedge clk). When reset is high, the 4-bit register q clears to 0000. Otherwise, it increments by 1 on each clock tick, rolling over from 1111 (15) to 0000 with a carry-out pulse.

q[3:0] \Leftarrow q[3:0] + 1 \quad (\text{mod } 16) \quad \text{cout} = \&q[3:0]

Digital Logic Waveform Viewer (GTKWave / ModelSim Style)

IEEE 1364 Timebase
Cursor: 35 ns
1.0x
↔ Swipe timeline or click axis to move measurement cursor
SIGNAL / RADIX
0ns20ns40ns60ns80ns100ns120ns140ns160ns180ns200ns
clk0
rst_n1
enable1
q[3:0]0x1
cout0
// ==========================================
// 4-Bit Synchronous Counter with Enable & Reset
// ==========================================
module counter_4bit (
    input  wire       clk,
    input  wire       rst_n,   // Active-low asynchronous reset
    input  wire       enable,  // Count enable
    output reg  [3:0] q,       // 4-bit counter output
    output wire       cout     // Terminal count carry-out
);

    always @(posedge clk or negedge rst_n) begin
        if (!rst_n) begin
            q <= 4'b0000;
        end else if (enable) begin
            q <= q + 1'b1;
        end
    end

    // Carry-out generates a pulse when q reaches 15 (4'b1111)
    assign cout = (q == 4'b1111) && enable;

endmodule
Format: Verilog HDL (IEEE 1364-2001)Target Simulator: Verilator / Icarus Verilog / ModelSim / Questa