Simulating R2R DAC taking into account resistor tolerances, calculate distribution of THD of produced signal