module DFlipFlop(
    output q,
    input clock,
    input nreset,
    input d
    );
    
    reg q;
    
    always @(posedge clock or posedge nreset)
    begin
        if (nreset == 1)
            q = d;
        else
            q = 0;
    end
endmodule