Minimization of dynamic and static power through joint assignment of threshold voltages and sizing optimization