The aim of this paper is to show how to build a fuzzy controller and its membership functions automatically. In a fuzzy logic controller (FLC), the proposed method allows one easily to construct a set of membership functions, called shrinking-span membership functions (SSMFs). The FLC uses Mamdani-type fuzzy controllers for the defuzzification strategy and inference operators. The FLC hardware implementation is performed on an 8-bit microcontroller. Simulation results and experimental results demonstrate that the converter can be regulated with good performance even when subjected to input disturbance and load variation. The presented approach is generally valid for the design of an FLC, and can be applied to any dc-dc converter topologies.