Suggest you track down a text on instruments for the details of the innards ..... there is no need for a temperature input as Mach can be expressed in terms of altitude and CAS only. The equation comes down to something along the lines of
M = (5((qc/ps+1)^0.286-1))^0.5
(presuming that I have counted my brackets and put them in the correct spots).
Just think of the machmeter as a fancy ASI ....