This paper presents a look-up table based digital control approach to on-line efficiency optimization over wide ranges of operating conditions. The proposed digital controller allows programmable modes of operation based on off-line efficiency characterization and optimization. Applied to a flyback dc-dc converter, the controller adopts valley switching in discontinuous conduction mode (DCM), which significantly reduces the MOSFET turn-on switching loss. Furthermore, solutions to the problem related to undesirable frequency hopping, commonly observed in other valley-switching control schemes, are presented. Dynamic operation of the controller demonstrates smooth mode transitions and consistent transient responses over various operating conditions. Experimental results show that efficiency of a low-cost 65-W flyback prototype exceeds 92% at all operating points over approximately 3:1 range of input voltages and 10:1 range of loads.