library IEEE; use IEEE.electrical_systems.all; entity buck_avg is generic ( Vd : voltage := 0.7; -- Diode Voltage Vramp : voltage := 2.5); -- P-P amplitude of ramp voltage port ( terminal input, output, ref, ctrl: electrical); end entity buck_avg; architecture simple of buck_avg is quantity Vout across Iout through output to ref; quantity Vin across input to ref; quantity Vctrl across ctrl to ref; begin -- bhv Vout + Vd == Vctrl * Vin / Vramp; end simple;