All-optical programmable logic arrays (PLAs) based on canonical logic units (CLUs), i.e., minterms and maxterms, are presented. We experimentally demonstrated the full set of two-input and three-input minterms as well as maxterms using the cross-gain modulation in semiconductor optical amplifiers (SOAs). Maxterms can be easily obtained based on minterms. The reconfigurability and scalability of the system are largely enhanced compared to our previous work. Correct and clear temporal waveforms are achieved for all the canonical logic units. The measured extinction ratios of two-input and three-input CLUs are ~ 15 dB and ~ 11 dB, respectively. Based on the CLUs, both sum-of-products and product-of-sums typed PLAs are exhibited. Six important logic functions, including full-adder, full-subtractor, multiplier, multiplexer, demultiplexer and decoder, are presented as examples to show that the canonical logic units-based programmable logic array (CLUs-PLA) can be reconfigured to perform different logic functions. The features of simple architectures, integration ability of SOA and programmable filter enable the great integration potential for CLUs-PLA.