mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-08-22 13:57:32 +02:00
source and large parts of the example circuits between Verilator and Icarus Verilog. Verilog source file adc.v has improved style: all assignments in the always block are now non-blocking.
27 lines
567 B
Verilog
27 lines
567 B
Verilog
// Very simple logic for a 555 timer simulation
|
|
|
|
`timescale 1us/100ns
|
|
|
|
module VL555(Trigger, Threshold, Reset, Q, Qbar);
|
|
input wire Trigger, Threshold, Reset; // Reset is active low.
|
|
output reg Q;
|
|
output wire Qbar;
|
|
|
|
wire ireset, go;
|
|
|
|
assign Qbar = !Q;
|
|
|
|
// The datasheet implies that Trigger overrides Threshold.
|
|
|
|
assign go = Trigger & Reset;
|
|
assign ireset = (Threshold & !Trigger) | !Reset;
|
|
|
|
initial begin
|
|
Q = 0;
|
|
end
|
|
|
|
always @(posedge(go), posedge(ireset)) begin
|
|
Q = go;
|
|
end
|
|
endmodule
|