Enhancing Energy Efficiency with ROM Size Optimization