eli5: At the most basic level, how is a computer programmed to know how long a unit of time is?

909 views

eli5: At the most basic level, how is a computer programmed to know how long a unit of time is?

In: 2404

39 Answers

Anonymous 0 Comments

There are certain crystals that vibrate when we apply electricity to them. We can exploit that vibration to make a device that opens and closes an electrical switch as it vibrates. That sends a “pulse” of electricity and we call this a “clock”.

The neat thing about these crystals is they vibrate at pretty much exactly the same frequency no matter what. So if we build a circuit that counts how many “pulses” have been sent, we know when it reaches a certain number 1 second has passed. We can use math to figure out smaller units of time.

The CPU in a computer already has to have a “clock” line. That periodic on and off pulsing is what tells it to perform its next instruction, it’s kind of like turning the crank on a jack in the box. So it can count these “cycles” to have an idea of the passage of time.

You are viewing 1 out of 39 answers, click here to view all answers.