An improved version of a digital-to-analog converter (DAC) based on a multi-electrode Mach-Zehnder interferometer (MZI) is presented and analyzed. The device described has superior performance regarding both linearity and dynamic range. The improvements are achieved by utilizing a special mapping method between the analog input and the digital sequence applied to the device, and by an optimized sectioning method for the electrodes. Further improvement in linearity is attained by allowing the number of electrodes M to be larger than the number of digitization bits N (M > N). An analytical and systematic method for performing the mapping and selecting the electrodes' sizes is explicitly described and shown to be optimal. A comparison of the proposed approach to previously reported biased MZI reveals that dynamic range and linearity are significantly improved which is translated to increased resolution and reduced quantization errors. It follows from the optimization process that quantization and nonlinearity errors can be reduced to any extent by appropriately increasing the number of electrodes.