Forum
 cheap_salary Senior Member Offline Posts: 162 Negative power for flicker_noise() Dec 25th, 2018, 6:26am   See Junction diode by Marek Mierzwinski.http://www.designers-guide.org/VerilogAMS/semiconductors/diode/diode.vaNegative power is used for flicker_noise() in this code like following. Code:```if (Id > 0) AbsId = pow(Id, af); else AbsId = -pow(-Id, af); I(anode, internal) <+ flicker_noise(kf * AbsId, 1.0, "flicker"); ```What does this negative power mean ?I think negative power is nonsense.BTW, ahdllint of Cadence Spectre does not give any warning fir this negative power. Back to top IP Logged
 Ken Kundert Global Moderator Offline Posts: 2211 Silicon Valley Re: Negative power for flicker_noise() Reply #2 - Jan 2nd, 2019, 4:03pm   I am not really sure what you mean by negative power. Perhaps your question regards this code: Code:```if (Id > 0)   AbsId = pow(Id, af); else   AbsId = -pow(-Id, af); ```This is basically a hack to handle negative currents. The pow() function requires its first argument to be non-negative, but you don't want to simply pass the first argument through an abs() function, because that changes the behavior of the model in a non-physical way.To understand this, consider the case where af=1. In this case, the pow() function becomes a no-op, and the above collapses down to: Code:```AbsId = Id ```If you were to add an abs() function to protect the pow() function, and then set af=1, the equivalent would be Code:```AbsId = abs(Id) ```This is clearly a different behavior. To see that, consider the case were Id is a sinusoid. In the first case you are modulating the noise with a pure tone, in the second you are modulating it with a rectified sinewave, which has a high harmonic content but no component at the fundamental frequency.If you are not comfortable with this model, just assume af=1 and simplify it down to: Code:```I(anode, internal) <+ kf*flicker_noise(Id, 1, "flicker"); ```-Ken Back to top IP Logged