1. A magnetic device configured to perform an analog adder circuit function, the magnetic device comprising a plurality of magnetic units, each of the plurality of magnetic units including: n magnetic tunnel junctions, each magnetic tunnel junction comprising a storage magnetic layer having a storage magnetization a sense magnetic layer having a sense magnetization that can be varied with respect to the storage magnetization and a tunnel barrier layer between the first and second layer; a current line electrically connecting in series said n magnetic tunnel junctions; n input lines, each input line being configured to generate a magnetic field adapted for varying a direction of the sense magnetization and a junction resistance of a corresponding one of said n magnetic tunnel junctions, based on a corresponding input, wherein the junction resistance of said corresponding one of said n magnetic tunnel junctions varies linearly based on said corresponding input; and wherein each of the plurality of magnetic units is configured to add said n inputs to generate an output signal that varies in response to the n junction resistances of said n magnetic tunnel junctions, and, characterized in that, each of the n input lines are independent of one another such that the the n input lines can conduct n independent input signals so that the output signal can vary as a function of said n independent input signals.