A computer is an electronic device or equipment that computes the result of arithmetic, logical or other expressions when the values of variables are given.
The world is analog with all physical quantities varying continuously.
Analog computers are made of analog electronic boards. These contain circuits to process the analog inputs in real time and produce the result of computation at the output. There are electronic circuits corresponding to addition, subtraction, multiplication, division, logical AND, NAND, OR, NOT and NOR. When the inputs are applied and operation is chosen the appropriate circuit is connected and the result appears.
The values of inputs (data) are continuous and the outputs are also continuous values. It is very difficult to increase the quality or accuracy of the analog systems. There is noise mixed with the inputs and outputs and it is difficult to eliminate noise totally. The analog systems wear out after some time.
Analog computers are small and consume less electric power. But the quality of the response is not as high as the digital computers. The range of values of functioning of analog computers is limited. The voltage or current are taken as the input values and the circuit produces voltage of current that corresponds to the result. These are cheaper. These computers were made before the invention of transistor device.
Digital computers are modern computers and are made using a switching transistor. The voltage levels in electronic circuits are categorized in to two values 0 (low, from 0 volts to 1volt and 1 (high, from 2.5 to 5 volts). The circuits for each arithmetic and logical operation are designed as modules and combined in the ALU (arithmetic and logic unit) of the CPU (central processing unit). The output of the computation is a sequence of 0s and 1s in binary number system.
The values of inputs are discrete binary numbers and the results are also discrete values. The precision can be increased to any extent by extending the word size of the CPU.
It is possible to eliminate electronic noise in digital systems and inputs. These systems are more reliable and last for a long time.
In the modern world you see calculators, mobiles, computers - all these are digital.