Mathematicians in the 17th century sought to build machines for basic math functions like addition and multiplication. In 1804, Charles Babbage designed the difference engine, an early general purpose computer with a mechanical memory. Generations of computers are defined by their components: first used vacuum tubes and magnetic drums; second used transistors; third used integrated circuits; fourth used microprocessors; fifth uses artificial intelligence.