module V_d_ff(q, qbar, clk, d); input clk,d; output q,qbar; voltage q, qbar, clk, d; parameter real tdelay = 5n from [0:inf), ttransit = 5n from [0:inf), vout_high = 5, vout_low = 0 from (-inf:vout_high), vth = 1.4; integer x; analog begin @(initial_step) x = 0; @(cross(V(clk) - vth, +1 )) x = (V(d) > vth); V(q) <+ transition( vout_high*x + vout_low*!x, tdelay, ttransit ); V(qbar) <+ transition( vout_high*!x + vout_low*x, tdelay, ttransit ); end endmodule