Hello,
Here is AMS-model of comparator:
Code:module COMPAR_v0 (INP, INN, OUT);
input INP, INN;
output OUT;
reg OUT;
electrical INP, INN;
initial begin
if (V(INP)>V(INN)) OUT = 1;
else OUT = 0;
end
always @(cross(V(INP)-V(INN),+1)) OUT = 1;
always @(cross(V(INP)-V(INN),-1)) OUT = 0;
endmodule
At the picture below there are waveforms.
Comparator output is connected to
comp signal.
INP is connected to envlp,
INN - to
dac_out.
As you can see at the picture, after 2nd transition ('0'->'1'), output is frozen at '1'.
How to avoid this problem.
Thanks.
Pavel.