r/ComputerEngineering • • Feb 27 '19

What is clock in computer?

I am studying about computer architecture. I have no idea about clock in computer. Please explain.

7 Upvotes

4 comments sorted by

5

u/MushinZero CpE / Digital Logic Design Feb 28 '19 edited Feb 28 '19

A clock is a square wave electrical signal. It oscillates from 0 to 1 then 1 to 0 at a regular interval.

The top signal in this timing diagram is a clock: https://i.ytimg.com/vi/VedA7dYe834/maxresdefault.jpg

This is used by circuits to synchronize operations. As opposed to just letting a signal go through a circuit whenever it wants (a combinational circuit), a sequential circuit will only perform an operation on (commonly) the rising edge of the clock. So when a clock goes from 0 to 1, the circuit performs some function. This makes it easier to work with propagation delays in a circuit because you know you have a single clock period to allow a signal to propagate through the circuit.

3

u/symmetry81 Feb 27 '19

In a computer you have a bunch of gates like NANDS and NORS and so forth that make up the logic of its operation. It takes time for signals to get through these gates. But depending on things like how many other gates have inputs from another it takes different amounts of time for signals to get through. So periodically the signals along different paths arrive at latches where they are locked in and synchronized. The clock signal is the one driving the latches and making sure everything is synchronized

0

u/Ultimategamer32 Electrical and Computer Engineer Feb 27 '19

Memory cells need to be told when to update. The clock allows that to happen.