Voltage for motor driver
You are mixing everything, this is not a power supply or some kind of voltage regulator.

As you can see in the datasheet, this is just a dual H-Bridge. A H-Bridge is a simple and clever way to associate 4 transistors to connect, disconnect and reverse a voltage input. This is useful to control a motor with a µC, by sending it a PWM signal.

The H-Bridge needs 2 power supplies. One for the power side and one for the logic side.

You can see the H-Bridge as a switch that can apply the power side voltage to your motor, and reverse it. So the input voltage of the power side should be around 3V. The effective voltage at the motor will be a bit less due to the voltage dropout inside the bridge, but you can neglect it for now.

The input voltage of the logic side should be the same as the operating voltage of your µC. You can use the 5V pin of the Arduino Mega. Warning : never use that pin on something that uses power, such as your motors. Only logical purposes.

Then you will need to provide power to your Arduino Mega. You can apply a voltage between 7 and 12V. 9V is fine.