A method of generating a switching sequence for a unary array of conducting branches of a thermometrically decoded digital-to-analog converter, the conducting branches of which are affected by an error distributed over the array according to a certain error distribution function, comprising the steps of:
- preliminarily evaluating said error distribution function, fixing an upper bound function and a lower bound function symmetrical to each other of an INL error function associated with the switching sequence, determining the center of gravity of the array and calculating, by said preliminarily evaluated error distribution function, error values associated with each pair of conducting branches symmetrical with respect to the center of gravity of the array;
- choosing pairs of successive conducting branches in the switching sequence such that every even conducting branch (2n) is substantially symmetrical to a preceding odd conducting branch (2n−1) with respect to said center of gravity;
- building a switching sequence with an INL error function comprised between said upper bound and lower bound functions by:
- a) starting from a first chosen pair of conducting branches (1, 2) of the switching sequence and iteratively performing the following steps from b1) to b3) for all other pairs of conducting branches of the array:
- b1) calculating a corresponding value of the INL error function of the switching sequence being built,
- b2) choosing as a successive pair, the pair of conducting branches that maximizes or minimizes a next value of the INL error function of the switching sequence comprised between the corresponding values of said upper bound and lower bound functions,
- b3) if all said other pairs do not meet the conditions of point b2), then repeating the steps from a) to b2) choosing every time a different first pair of branches, and if the conditions cannot yet be met, changing at least one of said bound functions and restarting from point a);
- c) when all other pairs of conducting branches of the unary array meet the conditions, outputting the resulting switching sequence.