flipflop
A D flip-flop: on each rising edge of its clock, its output q takes the level at its d.
flipflop

#Attributes
#Derived attributes
Computed while the element renders — read one with #id.name in attribute position or {{#id.name}} in prose, never set.
levelThe level of
q.#Allowed content
Body { }Words set inside the box; usually empty
#Allowed in
#Examples


logic{
switch#d{$D$}(value: 1)
switch#clk{Clock}(value: 0 !cue.to{1}(at: 1 + 300ms))
flipflop#ff{}(value: 0)
lamp#q{$Q$}
wire(from: #d; to: #ff.d)
wire(from: #clk; to: #ff.clock)
wire(from: #ff.q; to: #q)
}#Notes
- Power-up is not an edge.
qbaris the complement ofq.- Its ports are marked inside it — D and CLK on its back, Q and Q̄ on its front — and
clk,q-barandnqname them too. - Wires that name no port land on
dand thenclock, and leave fromq. - A wire may return to the same flip-flop:
wire(from: #ff.qbar; to: #ff.d)divides its clock by two.