As an important branch of fuzzy systems, hierarchical fuzzy system (HFS) has a wide range of applications in system science, medical science and engineering. Using the semi-tensor product of matrices, this paper investigates the universal approximation of multi-input single-output HFSs, and develops the construction algorithms of universal approximators. Initially, based on the fuzzy relation matrices of fuzzy logic units with Mamdani-type fuzzy rules, the algebraic formulation of HFSs consisting of fuzzy logic units is proposed. After that, the universal approximation of HFSs is explored via the algebraic formulation, and some effective algorithms are presented to construct the universal approximators of HFSs with respect to different scenarios of approximated functions. Finally, the effectiveness of obtained results is verified by the on-ramp metering of freeway.