In the very beginning, of course was the abacus, a sort of hand operated mechanical calculator using beads on rods, first used by Sumerians and Egyptians around 2000 BC.
The principle was simple, a frame holding a series of rods, with ten sliding beads on each. When all the beads had been slid across the first rod, it was time to move one across on the next, showing the number of tens, and thence to the next rod, showing hundreds, and so on.
It made addition and subtraction faster and less error-prone and may have led to the term ‘bean counters’ for accountants.
But that was where the technology more or less stuck for the next 3,600 years, until the beginning of the 17th century AD, when the first mechanical calculators began to appear in Europe. Most notably, the development of logarithms by John Napier allowed Edward Gunter, William Oughtred and others to develop the slide rule.