Flipflops and Latches
SR latch
When Set goes high the output Q goes high. When Reset goes high
Q goes low. When Set and Reset are both low Q stays at its previous
value.
{
"width":500,
"height":300,
"showToolbox":false,
"toolbox":[
],
"devices":[
{"type":"DC","id":"dev0","x":64,"y":112,"label":"DC"},
{"type":"LED","id":"dev1","x":396,"y":72,"label":"Q"},
{"type":"NOR","id":"dev2","x":290,"y":72,"label":"NOR"},
{"type":"NOR","id":"dev3","x":290,"y":136,"label":"NOR"},
{"type":"LED","id":"dev4","x":396,"y":136,"label":"~Q"},
{"type":"Toggle","id":"dev5","x":176,"y":144,"label":"Set"},
{"type":"Toggle","id":"dev6","x":176,"y":64,"label":"Reset"}
],
"connectors":[
{"from":"dev1.in0","to":"dev2.out0"},
{"from":"dev2.in0","to":"dev6.out0"},
{"from":"dev2.in1","to":"dev3.out0"},
{"from":"dev3.in0","to":"dev2.out0"},
{"from":"dev3.in1","to":"dev5.out0"},
{"from":"dev4.in0","to":"dev3.out0"},
{"from":"dev5.in0","to":"dev0.out0"},
{"from":"dev6.in0","to":"dev0.out0"}
]
}
~S~R latch
The ~S~R latch operates like the SR latch, except the Set and Reset
inputs are inverted.
{
"width":500,
"height":300,
"showToolbox":false,
"toolbox":[
],
"devices":[
{"type":"DC","id":"dev0","x":64,"y":112,"label":"DC"},
{"type":"LED","id":"dev1","x":396,"y":72,"label":"Q"},
{"type":"LED","id":"dev2","x":396,"y":136,"label":"~Q"},
{"type":"Toggle","id":"dev3","x":176,"y":144,"label":"~Reset"},
{"type":"Toggle","id":"dev4","x":176,"y":64,"label":"~Set"},
{"type":"NAND","id":"dev5","x":288,"y":72,"label":"NAND"},
{"type":"NAND","id":"dev6","x":288,"y":136,"label":"NAND"}
],
"connectors":[
{"from":"dev1.in0","to":"dev5.out0"},
{"from":"dev2.in0","to":"dev6.out0"},
{"from":"dev3.in0","to":"dev0.out0"},
{"from":"dev4.in0","to":"dev0.out0"},
{"from":"dev5.in0","to":"dev4.out0"},
{"from":"dev5.in1","to":"dev6.out0"},
{"from":"dev6.in0","to":"dev5.out0"},
{"from":"dev6.in1","to":"dev3.out0"}
]
}
D latch
The D latch copies the input on the D line whenevel the enable
line is high.
{
"width":500,
"height":300,
"showToolbox":false,
"toolbox":[
],
"devices":[
{"type":"LED","id":"dev0","x":432,"y":72,"label":"Q"},
{"type":"NAND","id":"dev1","x":360,"y":72,"label":"NAND"},
{"type":"NAND","id":"dev2","x":264,"y":72,"label":"NAND"},
{"type":"NAND","id":"dev3","x":264,"y":144,"label":"NAND"},
{"type":"DC","id":"dev4","x":16,"y":112,"label":"DC"},
{"type":"Toggle","id":"dev5","x":104,"y":64,"label":"Data"},
{"type":"NOT","id":"dev6","x":168,"y":88,"label":"NOT"},
{"type":"Toggle","id":"dev7","x":104,"y":152,"label":"Enable"},
{"type":"NAND","id":"dev8","x":360,"y":144,"label":"NAND"},
{"type":"LED","id":"dev9","x":432,"y":144,"label":"~Q"}
],
"connectors":[
{"from":"dev0.in0","to":"dev1.out0"},
{"from":"dev1.in0","to":"dev2.out0"},
{"from":"dev1.in1","to":"dev8.out0"},
{"from":"dev2.in0","to":"dev5.out0"},
{"from":"dev2.in1","to":"dev7.out0"},
{"from":"dev3.in0","to":"dev6.out0"},
{"from":"dev3.in1","to":"dev7.out0"},
{"from":"dev5.in0","to":"dev4.out0"},
{"from":"dev6.in0","to":"dev5.out0"},
{"from":"dev7.in0","to":"dev4.out0"},
{"from":"dev8.in0","to":"dev1.out0"},
{"from":"dev8.in1","to":"dev3.out0"},
{"from":"dev9.in0","to":"dev8.out0"}
]}
D-type master-slave flipflop
This is the opaque version of the D-type latch. The input
is copied to the ouput just as the enable (clock) line goes high.
It is composed of two D-type latches which are enabled at opposite
times during the clock cycle. This prevents inputs from being
transparently copied to the output, except when the clock transitions
to high.
{
"width":600,
"height":300,
"showToolbox":false,
"devices":[
{"type":"DC","id":"dev0","x":16,"y":112,"label":"DC"},
{"type":"Toggle","id":"dev1","x":104,"y":64,"label":"Data"},
{"type":"NOT","id":"dev2","x":168,"y":88,"label":"NOT"},
{"type":"LED","id":"dev3","x":544,"y":64,"label":"Q"},
{"type":"LED","id":"dev4","x":552,"y":144,"label":"~Q"},
{"type":"NAND","id":"dev5","x":224,"y":72,"label":"NAND"},
{"type":"NAND","id":"dev6","x":216,"y":144,"label":"NAND"},
{"type":"NAND","id":"dev7","x":280,"y":72,"label":"NAND"},
{"type":"NAND","id":"dev8","x":280,"y":144,"label":"NAND"},
{"type":"NAND","id":"dev9","x":376,"y":72,"label":"NAND"},
{"type":"NAND","id":"dev10","x":376,"y":144,"label":"NAND"},
{"type":"NAND","id":"dev11","x":440,"y":72,"label":"NAND"},
{"type":"Toggle","id":"dev12","x":104,"y":152,"label":"Enable"},
{"type":"NAND","id":"dev13","x":440,"y":144,"label":"NAND"},
{"type":"NOT","id":"dev14","x":160,"y":152,"label":"NOT"},
{"type":"BUF","id":"dev15","x":272,"y":240,"label":"BUF"}
],
"connectors":[
{"from":"dev1.in0","to":"dev0.out0"},
{"from":"dev2.in0","to":"dev1.out0"},
{"from":"dev3.in0","to":"dev11.out0"},
{"from":"dev4.in0","to":"dev13.out0"},
{"from":"dev5.in0","to":"dev1.out0"},
{"from":"dev5.in1","to":"dev14.out0"},
{"from":"dev6.in0","to":"dev2.out0"},
{"from":"dev6.in1","to":"dev14.out0"},
{"from":"dev7.in0","to":"dev5.out0"},
{"from":"dev7.in1","to":"dev8.out0"},
{"from":"dev8.in0","to":"dev7.out0"},
{"from":"dev8.in1","to":"dev6.out0"},
{"from":"dev9.in0","to":"dev7.out0"},
{"from":"dev9.in1","to":"dev15.out0"},
{"from":"dev10.in0","to":"dev15.out0"},
{"from":"dev10.in1","to":"dev8.out0"},
{"from":"dev11.in0","to":"dev9.out0"},
{"from":"dev11.in1","to":"dev13.out0"},
{"from":"dev12.in0","to":"dev0.out0"},
{"from":"dev13.in0","to":"dev11.out0"},
{"from":"dev13.in1","to":"dev10.out0"},
{"from":"dev14.in0","to":"dev12.out0"},
{"from":"dev15.in0","to":"dev12.out0"}
]
}
Sand box
{
"width":700,
"height":500,
"showToolbox":true,
"toolbox":[
{"type":"In"},
{"type":"Out"},
{"type":"DC"},
{"type":"LED"},
{"type":"PushOff"},
{"type":"PushOn"},
{"type":"Toggle"},
{"type":"BUF"},
{"type":"NOT"},
{"type":"AND"},
{"type":"NAND"},
{"type":"OR"},
{"type":"NOR"},
{"type":"EOR"},
{"type":"ENOR"},
{"type":"OSC"},
{"type":"7seg"},
{"type":"16seg"},
{"type":"4bit7seg"},
{"type":"RotaryEncoder"},
{"type":"BusIn"},
{"type":"BusOut"},
{"type":"RS-FF"},
{"type":"JK-FF"},
{"type":"T-FF"},
{"type":"D-FF"},
{"type":"8bitCounter"},
{"type":"HalfAdder"},
{"type":"FullAdder"},
{"type":"4bitAdder"},
{"type":"2to4BinaryDecoder"},
{"type":"3to8BinaryDecoder"},
{"type":"4to16BinaryDecoder"}
],
"devices":[
{"type":"LED","id":"dev0","x":432,"y":72,"label":"Q"},
{"type":"NAND","id":"dev1","x":360,"y":72,"label":"NAND"},
{"type":"NAND","id":"dev2","x":264,"y":72,"label":"NAND"},
{"type":"NAND","id":"dev3","x":264,"y":144,"label":"NAND"},
{"type":"DC","id":"dev4","x":16,"y":112,"label":"DC"},
{"type":"Toggle","id":"dev5","x":104,"y":64,"label":"Data"},
{"type":"NOT","id":"dev6","x":168,"y":88,"label":"NOT"},
{"type":"Toggle","id":"dev7","x":104,"y":152,"label":"Enable"},
{"type":"NAND","id":"dev8","x":360,"y":144,"label":"NAND"},
{"type":"LED","id":"dev9","x":432,"y":144,"label":"~Q"}
],
"connectors":[
{"from":"dev0.in0","to":"dev1.out0"},
{"from":"dev1.in0","to":"dev2.out0"},
{"from":"dev1.in1","to":"dev8.out0"},
{"from":"dev2.in0","to":"dev5.out0"},
{"from":"dev2.in1","to":"dev7.out0"},
{"from":"dev3.in0","to":"dev6.out0"},
{"from":"dev3.in1","to":"dev7.out0"},
{"from":"dev5.in0","to":"dev4.out0"},
{"from":"dev6.in0","to":"dev5.out0"},
{"from":"dev7.in0","to":"dev4.out0"},
{"from":"dev8.in0","to":"dev1.out0"},
{"from":"dev8.in1","to":"dev3.out0"},
{"from":"dev9.in0","to":"dev8.out0"}
]
}