Hi,
Have you ever worked with a PROM before this?
The address lines can be broken up into two groups, group A and group B. Group A is one input, group B is the other input. The limit of any group is given by the number of bits in that group, but the limit of the two groups is equal to the size of the PROM. With A combinations and B combinations you have all the possible address combinations, so all you have to do is program each location with the correct result for each and every combination.
This means you can program them to add, subtract, multiply, or roughly divide, or even any other operation you can think of which has a bits limit equal to the width of the data output port.