Since ancient times, humans have worked to develop tools to help with tasks like counting and calculations. The abacus, invented over 4,000 years ago in China, was one of the earliest counting devices, allowing easier addition and subtraction. Later inventions included Pascal's calculator in 1642, the first mechanical calculator; Leibniz's calculator in 1673, which could also multiply and find square roots; and Jacquard's loom in 1801, which used punch cards to automate patterns in textile production. These early electromechanical devices paved the way for computers.