Reputation: 539
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?
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 )
Upvotes: 7
Views: 9829
Reputation: 61885
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.
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 Modern/conventional computers: there have been mechanical computers (at least insofar as 'calculating machines'), analog computers, and takes on quantum computers, etc.
Upvotes: 12
Reputation: 113
there are different adders and sub tractors which are which are connected thro' circuit. .full adder ,half adder is for different no range. all these adders are arranged such as in the form of o' and 1' for each digit there is binary bit code . its too easy .u will get it if u read it once
Upvotes: -2