Value of money is not solely function of money supply (see Mankiws Macroeconomics or Woodford Interest and Prices). Consequently, it is not possible to appropriately calculate value of money (measured by CPI) solely from money supply.
Price level is determined via supply demand interactions on money market equilibrium. Supply and demand on money market equilibrium are in turn determined by wider state of an economy.
Depending how detailed or accurate you want to be there are various different models of money market equilibrium. If you want just something very simplistic for back of the envelope calculation you could use the equation of exchange (see Mankiw Macroeconomics pp 87):
$$MV=PY \tag{*}$$
where $M$ is money supply, $V$ velocity of money, $P$ price level and $Y$ real output. You could just solve it for $P=MV/Y$, but given the simplicity of the model you should not expect answer to be very precise.
Something still very simple would be taking a bit more complex version of (*):
$$M/P=L(Y,i)$$
where $L$ is the money demand. You could estimate the parameters of money demand separately. Money demand should look something like $L(Y,i) = a_0 + a_1 Y - a_2 i$. Afterwards, you can just solve for $P$. This would be more precise then the previous example (although still not precise enough in case you want to make some serious projections).
If you would want to have something more serious then just a toy model, then you could estimate Dynamic Stochastic General Equilibrium (DSGE) model of a whole economy where you could determine what price level is based on all other estimated parameters of the economy. You can see overview of such models in Wickens Macroeconomic Theory.
There is also a plethora of intermediate models, such as Philips curve estimations, that can deliver solid CPI predictions, but they do not directly utilize money supply, but rather infer how prices change from other variables, such as output or past prices. Hence, I omit them since you wanted a model with a money supply.