An Approach for Low Power Design of Power Gated Finite State Machines Considering Partitioning and State Encoding Together