silicon atlasTHE HARDWARE REFERENCE
العربية
Reference/First principles
Foundations

Clocks, flip-flops & state

A clock separates what a circuit remembers from what it computes next.

Without state, a circuit can answer a question but cannot remember the answer.
Flip-flop

Edge-sampled state.

LIVE EXPERIMENT

Follow an instruction

Runs on your device
12345678910
I1
F
D
E
M
W
I2
F
D
E
M
W
I3
F
D
E
M
W
I4
F
D
E
M
W
I5
F
D
E
M
W
I6
F
D
E
M
W
F · FetchD · DecodeE · ExecuteM · MemoryW · Writeback
Instructions6
Total cycles10
Visible cycle1

Overlap improves throughput. Dependencies introduce bubbles unless the implementation can forward or do independent work.

What this model includes

Five-stage, single-issue teaching model. Dependent mode inserts two idle issue cycles per instruction; real forwarding and hazards vary.

FOLLOW THE MECHANISM

What happens inside

1

Hold a value

Combinational logic derives an output from current inputs. Sequential logic also depends on stored state. A latch is level-sensitive; a flip-flop samples around a clock edge. Registers group storage bits. SRAM cells hold state through feedback while power remains, unlike DRAM’s periodically refreshed charge.

2

Meet a timing contract

Input data must be stable for a setup interval before sampling and a hold interval after it. The slowest register-to-register path constrains the clock period. Crossing unrelated clock domains can cause metastability; synchronizers reduce failure probability, while multi-bit data needs a suitable handshake or asynchronous FIFO.

PUT IT TO WORK

What this means for your code

Low-level engineer

Check setup, hold, clock skew, and reset release. A two-flop synchronizer is for suitable single-bit signals, not arbitrary buses.

Software developer

State machines underpin protocols and device controllers. Ordering in your program is not proof that asynchronous hardware has completed an operation.

GO TO THE SOURCE

Read the actual specifications

These references supply the underlying contracts and implementation details. The diagrams here are simplified teaching models.

Nand2Tetris · MemoryNand2Tetris

Keep following the connection

Understood the idea? Keep a note of your progress.