Endoreversible Models for the Thermodynamics of Computing

Landauer’s principle says that, in principle, a computation can be performed without consumption of work, provided no information is erased during the computational process. This principle can be introduced into endoreversible models of thermodynamics.


Introduction
Thermodynamics of computing has a peculiar history. Many years, scientists have searched for the minimum energy needed to perform an elementary computing step. It was Landauer [1][2][3][4] who demonstrated in the period 1960-1990 that, in principle, computing can be performed without energy consumption, provided the computing process applies exclusively logically reversible computing steps. As long as information is not destroyed and computing is performed infinitely slowly, no work has to be supplied to the computer. Only erasure of information requires energy input. It is remarkable that we had to wait until the period 2012-2018 to have experimental confirmation [5][6][7][8] of Landauer's principle.
Basic thermodynamics, i.e., the Carnot theory, describes thermal engines acting infinitely slowly. In 1975, Curzon and Ahlborn [9] presented a thermodynamical model for an engine working at non-zero speed: the endoreversible engine. It consists of a reversible core, performing the actual conversion (of heat into work) and two irreversible channels for the heat transport. The approach turned out to be very fruitful: not only processes in engineering, but also in physics, chemistry, economics, etc. can successfully profit from endoreversible modelling, especially when processes happen at non-zero speed and thus tasks are performed in a finite time [10,11].
The present paper is an attempt to apply the endoreversible scheme to the Landauer principle, thus to thermodynamically describe computing at a non-zero speed.

Logic Gates
Any computer is built from basic building blocks, called gates. In a conventional electronic computer, such building block is e.g., a not gate, an or gate, a nor gate, an and gate, a nand gate, etc. Such gate has both a short input (denoted with subscript 1) and a short output (denoted with subscript 2). As an example, Table 1a defines the and gate, by means of its truth table. We see an input word A 1 B 1 and the corresponding output word A 2 . If the input word is given, the table suffices to read what the output 'will be'. If, however, the value of the output word is given, this information is not sufficient to recover what the input word 'has been'. Indeed, output A 2 = 0 can equally well be the result of either A 1 B 1 = 00 or A 1 B 1 = 01, or A 1 B 1 = 10. For this reason, we say that the gate is logically irreversible. In contrast, the not gate is logically reversible, as can be verified from its truth  table in Table 1b. Indeed, knowledge of A 1 suffices to know A 2 , but also: knowledge of A 2 suffices to know A 1 .
We not only can distinguish logically irreversible gates from logically reversible gates. We also can quantify how strongly a gate is irreversible. For this purpose, we apply Shannon's entropy: where k is Boltzmann's constant and q i is the probability that a word ABC... (either an input word A 1 B 1 C 1 ... or an output word A 2 B 2 C 2 ...) has a particular value. As an example, we examine Table 1a in detail. Let (q 00 ) 1 be the probability that input word A 1 B 1 equals 00, let (q 01 ) 1 be the probability that A 1 B 1 equals 01, let (q 10 ) 1 be the probability that it equals 10, and let (q 11 ) 1 be the probability that it equals 11. We, of course, assume 0 ≤ (q i ) 1 ≤ 1 for all i, as well as ∑(q i ) 1 = 1. Let (q 0 ) 2 be the probability that output word A 2 equals 0 and let (q 1 ) 2 be the probability that A 2 equals 1. Inspection of Table 1a reveals that Automatically, we have 0 ≤ (q i ) 2 ≤ 1 for both i, as well as ∑(q i ) 2 = 1. We now compare the entropies of input and output: We find that these two quantities are not necessarily equal. For example, if the inputs 00, 01, 10, and 11 are equally probable, i.e., if (q 00 ) 1 = (q 01 ) 1 = (q 10 ) 1 = (q 11 ) 1 = 1/4 , then we have (q 0 ) 2 = 3/4 and (q 1 ) 2 = 1/4 , such that where b = k log(2) is called 'one bit of information'. Thus, evolving from input to output is accompanied by a loss of entropy S 1 − S 2 of about 1.189 bits. A similar examination of Table 1b leads to S 1 = S 2 = 1 b. Thus, both input and output contain one bit of information. There is no change in entropy: A reversible computer is a computer exclusively built from reversible logic gates [12,13]. As among the conventional logic gates, only the not gate is logically reversible, we need to introduce unconventional reversible gates, in order to be able to build a general-purpose reversible computer. Table 2 shows two examples: the controlled not gate (a.k.a. the Feynman gate) and the controlled controlled not gate (a.k.a. the Toffoli gate). The truth table of the controlled not gate has the following properties: (q 00 ) 2 = (q 00 ) 1 (q 01 ) 2 = (q 01 ) 1 (q 10 ) 2 = (q 11 ) 1 (q 11 ) 2 = (q 10 ) 1 , such that ∑ (q i ) 2 log((q i ) 2 ) = ∑ (q i ) 1 log((q i ) 1 ) and thus S 2 = S 1 . This result is true whatever the values of the input probabilities (q 00 ) 1 , (q 01 ) 1 , (q 10 ) 1 , and (q 11 ) 1 , thus not only if these four numbers all are equal to 1/4. The reason of this property is clear: the output words A 2 B 2 of Table 2a are merely a permutation of the input words A 1 B 1 . Analogously, in Table 2b, the output words A 2 B 2 C 2 form a permutation of the input words A 1 B 1 C 1 . Therefore, the controlled controlled not gate also satisfies S 2 = S 1 and hence is logically reversible. Table 2. Truth tables of two reversible logic gates: (a) the controlled not gate and (b) the controlled controlled not gate.
(a) Figure 1 shows a c-MOS (i.e., complementary metal-oxide-semiconductor) implementation of these two reversible gates in a silicon chip.
The reader may easily verify that, in general, we are allowed to summarize as follows: • if the logic gate is logically reversible, then entropy is neither increased nor decreased; • if the logic gate is logically irreversible, then entropy is decreased.
Of course, in the framework of the second law, any entropy decrease sounds highly suspicious. The next section will demonstrate that fortunately there is no need to worry.

Macroentropy and Microentropy
Let the phase space of a system be divided into N parts. Let p m be the probability that the system finds itself in part # m of the phase space. Then, the entropy of the system is (1) Figure 2a shows an example with N = 15. We now assume that the division of phase space happens in two steps. First, we divide it into M large parts (with M N), called macroparts. Then, we divide each macropart into microparts: macropart # 1 into n 1 microparts, macropart # 2 into n 2 microparts, ..., and macropart # M into n M microparts: We denote by p i,j the probability that the system is in microcell # j of macrocell # i. Let q i be the probability that the system finds itself in macropart # i: Let σ be the entropy of the system consisting of the M macrocells. We have One can easily check that this expression can be written as The former contribution to the rhs of Equation (3) is called the macroentropy S, whereas the latter contribution is called the microentropy s. We identify the macroentropy with the information entropy of Section 2. We associate the microentropy with the heat Q, i.e., with the energy exchange which would occur, if the microentropy enters or leaves the system at temperature T, according to the Gibbs formula Hence: This decomposition can be expressed in several ways: total entropy = macroentropy + microentropy = Shannon entropy + Gibbs entropy = information entropy + heat entropy .  We now assume that the probabilities of being in a particular microcell is the same in the three cases of Figure 2 (2) tell us that the entropy σ is the same in the three cases: Assuming all probabilities p i,j are non-zero, it is clear that the macroentropies satisfy Therefore, the microentropies satisfy σ = s a > s c > s b .
In particular, the inequality S c < S b corresponds with the inequality S 2 < S 1 in Section 2 for the and gate in Table 1a. Indeed: Figure 2b corresponds with the left part of the truth table, whereas Figure 2c corresponds with the right part of the table. The decrease of macroentropy (S 2 < S 1 ) thus is compensated by the increase of microentropy (s 2 > s 1 ), leading to σ 2 = σ 1 , thus saving the second law: σ 2 ≥ σ 1 . a heat reservoir at temperature T 1 , providing a heat Q 1 , • a heat reservoir at temperature T 2 , absorbing a heat Q 2 , and • a reversible convertor, generating the work E.

Reversible Engine
For our purpose, we provide each reservoir with a second parameter, i.e., the macroentropy S. See Figure 3b. We write the two fundamental theorems of reversible thermodynamics: • conservation of energy: the total energy leaving the convertor is zero: • conservation of entropy: the total entropy leaving the convertor is zero: Eliminating the variable Q 2 from the above two equations yields We can distinguish two special cases ( Figure 4): • If S 2 = S 1 , then we obtain from Equation (4) that known as Carnot's law.

•
If T 2 = T 1 (say T), then we obtain from (4) that known as Landauer's law. We thus retrieve, besides Carnot's formula, the priciple of Landauer: if no information is erased (S 2 = S 1 ), then no work E is involved; if information is erased (S 2 < S 1 ), then a negative work E is produced, meaning that we have to supply a positive work −E.
We note that, in Figure 4a, the arrows indicate the sence of positive Q 1 (heat leaving the upper heat reservoir) and positive Q 2 (heat entering the lower heat reservoir). Analogously, in Figure 4b, the arrows indicate the sence of positive S 1 (macroentropy leaving the upper memory register) and S 2 (macroentropy entering the lower memory register). In order to actually perform the computation in the positive direction, an external driving force is necessary. The next section introduces this 'arrow of computation'.

Reversible Engine Revisited
Information is carried by particles. Therefore, we have to complement the reservoirs of Figure 3b with a third parameter, i.e., the chemical potential µ of the particles. See Figure 5. Besides a heat flow Q, a reservoir also provides (or absorbs) a matter flow N.
In conventional electronic computers, the particles are electrons and holes within silicon and copper. There, the particle flow N is (up to a constant) equal to the electric current I: where q is the elementary charge. The chemical potential µ is (up to a constant) equal to the voltage V: In the present model, we maintain the quantities N and µ, in order not to exclude unconventional computing, e.g., computation by means of ions, photons, Majorana fermions, ... or even good old abacus beads.
We write the three fundamental theorems of reversible thermodynamics: • conservation of matter: the total amount of matter leaving the convertor is zero: • conservation of energy: the total energy leaving the convertor is zero: • conservation of entropy: the total entropy leaving the convertor is zero: The first equation leads to N 2 = N 1 , which we simply denote by N. Eliminating the variable Q 2 from the remaining two equations yields the output work: We can distinguish three special cases ( Figure 6): • If µ 2 = µ 1 and S 2 = S 1 , then we obtain i.e., Carnot's law.

•
If T 2 = T 1 and S 2 = S 1 , then we obtain known as Gibb's law.

•
If T 2 = T 1 (say T) and µ 2 = µ 1 , then we obtain i.e., Landauer's principle.  Figure 7a represents a transport channel between two reservoirs. The upper reservoir has parameter values T , µ , and S ; the lower reservoir has parameter values T , µ , and S . We assume that the computer hardware is at a uniform temperature. Hence, T = T (say T). Furthermore, we assume that S = S (say S). This means, e.g., that noise does not cause random bit errors during the transport of the information. Thus, reservoirs only differ by µ and µ . See Figure 7b. The particle drift N is caused by the difference of the two potentials µ and µ . The law governing the current is not necessarily linear. Hence, we have

Irreversible Transport
where f (µ) is an appropriate (monotonically increasing) function of µ and R (called resistance) is a constant depending primarily on the material properties and geometry of the particle channel.
Many different functions f are applicable in different circumstances. For example, in classical c-MOS technology, an electron or hole diffusion process in silicon [14,15] can successfully be modeled by the function Below, however, for sake of mathematical transparency, we will apply such that we have a linear transport equation, i.e., Ohm's law: Figure 8 shows an endoreversible computer gate. It consists of • a core part with reversible gate and • two transport channels: one for providing the input information and one for draining the output information.

Endoreversible Engine
The core is modeled according to Section 5; the two transport channels are modeled according to Section 6. In Figure 8a, the two outermost reservoirs (i.e., the input and output data registers) have fixed boundary conditions: T 1 , µ 1 , S 1 and T 2 , µ 2 , S 2 , respectively. The inner parameters T 3 , µ 3 , S 3 , T 4 , µ 4 , and S 4 are variables. In accordance with Section 6, we choose T 3 and S 3 equal to T 1 and S 1 , respectively, as well as T 4 and S 4 equal to T 2 and S 2 , respectively. Finally, we assume the whole engine is isothermal, such that T 2 = T 1 . This results in Figure 8b. We thus only hold back as variable parameters the chemical potentials µ 3 and µ 4 .
According to Section 5, we have, for the core of the endoreversible engine: According to Section 6, the two transport laws are We remind that, in the present model, the intensive quantities T, µ 1 , S 1 , µ 2 , and S 2 have given values, whereas the quantities µ 3 and µ 4 have variable values. We eliminate the two parameters µ 3 and µ 4 from the three Equations (5)- (7). We thus obtain where µ = µ 1 − µ 2 and R = R 1 + R 2 . The total energy dissipated in the endoreversible engine is We thus find The former term on the rhs of Equation (8) consists of the energy R 1 N 2 dissipated in resistor R 1 and the energy R 2 N 2 dissipated in resistor R 2 ; the latter term is the energy dissipated in the information loss in the core of the engine. If N = 0, then we dissipate a minimum of energy F min = F(0) = T(S 1 − S 2 ). Unfortunately, N = 0 corresponds with an engine computing infinitely slowly (just like a heat engine produces power with a maximum, i.e., Carnot, efficiency when driven infinitely slowly). For reasons of speed, a computer is usually operated in so-called short-circuit mode: N = N sc = µ/R. This operation corresponds with a short circuit between the two inner reservoirs of Figure 8: µ 3 = µ 4 . Under such condition, we have For the sake of energy savings, we aim at low F sc . As N sc is large for sake of speed, we thus need both small R and small µ.

Discussion
Figure 8b acts as our thermodynamical model of classical (i.e., non-quantum) computing. It is equally applicable to a single elementary logic gate as it is to a complete supercomputer. In the use of the model, we distinguish two cases: logically irreversible computation and logically reversible computation:

Conventional Computing
In conventional computers, information is erased during the computational process: S 1 − S 2 > 0. The computation happens in one direction: from reservoir # 1 to reservoir # 2. In other words: N > 0 and thus µ 1 > µ 2 .
During several decades, classical MOS technology succeeded in minimizing both parameters R and µ. Indeed, according to Moore's law, we have known a continuous (exponential) shrinking of computer components. As a consequence, energy consumption per computational step diminished accordingly. In spite of this, the former term in (9) is still several orders of magnitude larger than the latter contribution. For a single computational step with e.g., a nand gate, in a 10 nanometer c-MOS technology, run with a power-supply voltage of 0.6 volt and operating at room temperature (i.e., at about 300 K), the dissipation in the resistor R is of the order of one attojoule (i.e., 10 −18 J), whereas the dissipation T(S 1 − S 2 ) is of order one zeptojoule (i.e., 10 −21 J) only (corresponding with an entropy production of 3 zJ/K and 0.003 zJ/K, respectively). An attojoule may sound as an irrelevant miniscule amount of energy. However, because of present-day computer speeds (i.e., clock rates of about 3 GHz) and computation parallelism, it is responsible for the approximately 50 W dissipation in a single silicon chip (CPU or central processing unit) and hence for the megawatt power consumption in today's data centres. Further improvement of technology could lead to less energy dissipation. However, breaking the Landauer barrier will be impossible without radically changing computation architecture, i.e., without switching from logically irreversible computing to reversible computing.

Reversible Computing
In reversible computers, no information is erased: S 1 − S 2 = 0. The computation can happen in either direction: either from reservoir # 1 to reservoir # 2 or from reservoir # 2 to reservoir # 1. The former operation is activated by choosing µ 1 > µ 2 (and hence N > 0); the latter operation is activated by choosing µ 2 > µ 1 (and hence N < 0). For example, the circuits in Figure 1 indeed can be operated from top to bottom as well as from bottom to top, depending on the applied voltages.
Because the contribution T(S 1 − S 2 ) to the dissipated energy F is absent from (8), we can, in the limit, make F as small as we like, by letting N go to zero, either from the positive side or from the negative side. This reminds us of the fundamental law: things only can happen without dissipation if they happen infinitely slowly.

Conclusions
Endoreversible schemes have proven to be very useful in many branches of science: both in thermodynamics and in many disciplines far beyond. In the present paper, we have applied it to informatics and computing. The simple model presented brings together Carnot's law, Landauer's principle, Ohm's law, and even Moore's law.
Funding: This research received no external funding.