This paper deals with the digital implementation of a motor control algorithm based on a unified machine model, thus usable with every traditional electric machine type (induction, brushless with interior permanent magnets, surface permanent magnets or pure reluctance). Starting from the machine equations in matrix form in continuous time, the paper exposes their discrete time transformation, suitable for digital implementation. Since the solution of these equations requires integration, the virtual division of the calculation time in sub-intervals is proposed to make the calculations more accurate. Optimization of this solver enables faster runs and higher precision especially when high rotating speed requires fast calculation time. The proposed solver is presented at different implementation levels, and its speed and accuracy performance are compared with standard solvers.