1

A basic calculator can perform a wide variety of operations. How does the claculator 'get' the concept of adding two numbers in the same way a human does? I dont think people that make claculators store every possible result of every possible addition on the chip before shipping it. Soemhow the chip needs to 'learn' how to add.

I mean if I were to start with a blank slate(chip) and 'teach' the chip to perform calculations(additions), how do i go about it? Do i need to learn artificial nural networks first?

Kaushik
  • 1,195
  • 3
  • 12
  • 20
  • 2
    A pocket calculator uses logic circuits to calculate numbers. It doesn't 'get' *anything*. If you want to start with an AI and *teach* it the concept of arithmetic, that's a completely different thing from your pocket calculator. – FrustratedWithFormsDesigner Jul 11 '13 at 17:57
  • Look here: http://en.wikipedia.org/wiki/Adder_%28electronics%29 – Doc Brown Jul 11 '13 at 17:58
  • Thanks. I can understand logical circuits for addition, but what about complex operations in a scientific calculator like the derivative of a function? or the std deviation? – Kaushik Jul 11 '13 at 18:07
  • 2
    How do you get the result of, say 12 + 24, yourself, using a piece of paper? Do you have a table that has every possible result of every possible addition? No, you use an *algorithm* ( a series of steps) to perform the calculation. Same thing with calculators. Algorithms to compute derivatives or std deviation work the same way; they're just a bit more complex than the addition calculation, that's all. – Robert Harvey Jul 11 '13 at 18:15
  • 1
    @Kaushik still hardware. The VAX even had a hardware set of instructions to do polynomial evaluation. [Odd/complex vax instructions](http://esolangs.org/wiki/User:Ian/Computer_architectures#Some_interesting.2Fcomplex_VAX_instructions) - the POLYx instruction. In hardware, designed by humans. No machine learning or anything strange like that. –  Jul 11 '13 at 18:17

1 Answers1

7
  1. Work in binary: 0, 1, 10, 11, 100, 101...

  2. Know your math: 0+0=00, 0+1=01, 1+0=01, 1+1=10

  3. Know your logic: or, and, not, xor...

  4. Find that the low bit is a XOR and the high bit is a AND.

  5. Expand the principle of one bit to 8, 16, 32, 64 bits

  6. Build it with logic gates.

enter image description here

If you want to know more, see my answer to How is fundamental mathematics efficiently evaluated by programming languages?

mouviciel
  • 15,473
  • 1
  • 37
  • 64