Notice that this only applies to setting it into a known value. In theory there are some operations that we can do without dissipating any heat.
There is a nice <a href="http://en.wikipedia.org/wiki/Maxwell%27s_demon>tought experiment</a> linking thermodynamics to information theory. And guess what, experiments agree with the theory.
After you have the theoretical framewok done, it is just a matter of applying the <a href="http://en.wikipedia.org/wiki/Boltzmann%27s_entropy_formula... entropy formula</a>, and you are done.