Low power optimization using self-gating technique