加法在计算机中如何工作?

问题描述:

我正在观看有关计算机体系结构的视频,然后想到一个问题.加法和基本操作在计算机上如何工作?我的意思是,我知道2 + 2 = 4,但是我不知道为什么?我只是知道,如果我在另外2个苹果中添加2个苹果,那么我会看到4个,但是有可能对此进行演示吗?

I was watching a video on computer architecture and a question came to my mind. How does addition and basic operations work on computers? I mean, i know that 2+2 = 4 but i don't know why? i just know that if i add 2 apples to another 2 then i see 4, but is there a possible demonstration of this?

我的问题是,计算机如何最基本地知道2 + 2 = 4?我知道有一些可以加数字的函数,但是在基本级别上,该加法是如何执行的?

My question being is, how does a computer know that 2 + 2 = 4 at the most basic level? i know there are functions that add numbers, but at a basic level how is that addition performed?

我只是想知道这一点,以便更好地理解计算机的工作方式,因为计算机执行的最基本和最常用的操作是总和(我相信)

I just want to know this to understand better how computers work as the most basic and used operation performed by a computer is the sum ( i believe )

在非常低端"的数字只是加法器电路的某些变体完成.

At the "very bottom" numbers are just binary, and physical electronic hardware is used to perform the addition operation itself1 (where each bit in the number is represented by an on/off of the physical circuit line) - this is done by some variation of an an Adder circuit.

有关数学的工作原理",请参见 Two's补语:Aritmetic ,这是最常用的整数编码.从概念上讲,这种算术与其他基数类似,例如在学校教授的10进制/十进制.

For "how" the math works see Two's complement: Aritmetic, which is the most commonly used integer encoding. Conceptually such arithmetic is similar to that of other bases, such as base-10/decimal taught in school.

1 现代/常规计算机:曾经有机械计算机(至少在计算机"方面),模拟计算机和量子计算机等.

1 Modern/conventional computers: there have been mechanical computers (at least insofar as 'calculating machines'), analog computers, and takes on quantum computers, etc.