托福利门电路就足够了
Tofolli gates are all you need

原始链接: https://www.johndcook.com/blog/2026/04/06/tofolli-gates/

兰道尔原理规定了擦除信息所需的最低能量成本,但当前技术远远超过了这个限制。令人惊讶的是,即使没有达到理论最小值,可逆计算——设计不擦除信息的电路——*今天*仍然可以提供实际的节能效果。 可逆电路的关键组件是托夫利门,它对三个比特进行操作,并且是其自身的逆运算,从而确保可逆性。重要的是,任何标准的布尔函数都可以仅使用托夫利门构建;例如,一个NAND门可以用一个托夫利门操作来构造。 然而,可逆计算也并非没有缺点。对于相同的函数,它通常需要比传统计算更多的输入并产生更多的输出,例如基于托夫利的NAND门需要三个比特的输入/输出,而标准的NAND门只需要两个输入和一个输出。尽管如此,效率提升的潜力使得可逆计算成为一个值得研究的领域。

黑客新闻 新 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Tofolli 门电路是你所需要的 (johndcook.com) 5 分,来自 ibobev 1 小时前 | 隐藏 | 过去 | 收藏 | 讨论 帮助 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

Landauer’s principle gives a lower bound on the amount of energy it takes to erase one bit of information:

E ≥ log(2) kB T

where kB is the Boltzmann constant and T is the ambient temperature in Kelvin. The lower bound applies no matter how the bit is physically stored. There is no theoretical lower limit on the energy required to carry out a reversible calculation.

In practice the energy required to erase a bit is around a billion times greater than Landauer’s lower bound. You might reasonably conclude that reversible computing isn’t practical since we’re nowhere near the Landauer limit. And yet in practice reversible circuits have been demonstrated to use less energy than conventional circuits. We’re far from the ultimate physical limit, but reversibility still provides practical efficiency gains today.

A Toffoli gate is a building block of reversible circuits. A Toffoli gate takes three bits as input and returns three bits as output:

T(abc) = (abc XOR (a AND b)).

In words, a Toffoli gate flips its third bit if and only if the first two bits are ones.

A Toffoli gate is its own inverse, and so it is reversible. This is easy to prove. If ab = 1, then the third bit is flipped. Apply the Toffoli gate again flips the bit back to what it was. If ab = 0, i.e. at least one of the first two bits is zero, then the Toffoli gate doesn’t change anything.

There is a theorem that any Boolean function can be computed by a circuit made of only NAND gates. We’ll show that you can construct a NAND gate out of Toffoli gates, which shows any Boolean function can be computed by a circuit made of Toffoli gates, which shows any Boolean function can be computed reversibly.

To compute NAND, i.e. ¬ (ab), send (ab, 1) to the Toffoli gate. The third bit of the output will contain the NAND of a and b.

T(a, b, 1) = (ab, ¬ (ab))

A drawback of reversible computing is that you may have to send in more input than you’d like and get back more output than you’d like, as we can already see from the example above. NAND takes two input bits and returns one output bit. But the Toffoli gate simulating NAND takes three input bits and returns three output bits.

联系我们 contact @ memedata.com