Devices for counting the cycles of operation in division or multiplication