Least-square estimation of average power in digital cmos circuits