Software and hardware implementation of the algorithm for 2-mirrors automatic laser beam alignment system