The configuration of ROM is like we have to compute here squares meaning multiplication so we know :
In 8 bit multiplication (i.e. operands having bits) , the maximum number of bits which possible in product = 16 bits
We also know that no of OR gates in ROM = no of output bits which is product here..
Hence no of OR gates needed for 8 bit squares = 16