Flip Flops and Latches
Circuit #1 - SR Latch (NOR)
{
"width":800,
"height":400,
"showToolbox":true,
"toolbox":[
{"type":"In"},
{"type":"Out"},
{"type":"Joint"},
{"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"},
{"type":"DSO"},
{"type":"DSO","numInputs":8},
{"type":"Delay"},
{"type":"Transmitter"}
],
"devices":[
{"type":"DC","id":"dev0","x":88,"y":152,"label":"DC"},
{"type":"NOR","id":"dev1","x":296,"y":96,"label":"NOR"},
{"type":"NOR","id":"dev2","x":296,"y":184,"label":"NOR"},
{"type":"PushOn","id":"dev3","x":184,"y":88,"label":"R"},
{"type":"PushOn","id":"dev4","x":184,"y":192,"label":"S"},
{"type":"LED","id":"dev5","x":424,"y":96,"label":"Q"},
{"type":"LED","id":"dev6","x":424,"y":184,"label":"NQ"},
{"type":"Joint","id":"dev7","x":360,"y":104,"label":"Joint","state":{"direction":0}},
{"type":"Joint","id":"dev8","x":368,"y":192,"label":"Joint","state":{"direction":0}},
{"type":"Joint","id":"dev9","x":264,"y":184,"label":"Joint","state":{"direction":0}},
{"type":"Joint","id":"dev10","x":264,"y":112,"label":"Joint","state":{"direction":0}},
{"type":"DSO","id":"dev11","x":392,"y":264,"label":"DSO","state":{"playing":true,"rangeIndex":0}}
],
"connectors":[
{"from":"dev1.in0","to":"dev3.out0"},
{"from":"dev1.in1","to":"dev10.out0"},
{"from":"dev2.in0","to":"dev9.out0"},
{"from":"dev2.in1","to":"dev4.out0"},
{"from":"dev3.in0","to":"dev0.out0"},
{"from":"dev4.in0","to":"dev0.out0"},
{"from":"dev5.in0","to":"dev7.out0"},
{"from":"dev6.in0","to":"dev8.out0"},
{"from":"dev7.in0","to":"dev1.out0"},
{"from":"dev8.in0","to":"dev2.out0"},
{"from":"dev9.in0","to":"dev7.out0"},
{"from":"dev10.in0","to":"dev8.out0"}
]
}
SR - Latch (NOR) Truth Table
Set | Reset | Q | Not Q |
0 | 0 | Qlast | Not Qlast |
0 | 1 | 0 | 1 |
1 | 0 | 1 | 0 |
1 | 1 | Illegal |
Circuit #2 - Gated SR Latch (NOR)
{
"width":800,
"height":400,
"showToolbox":true,
"toolbox":[
{"type":"In"},
{"type":"Out"},
{"type":"Joint"},
{"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"},
{"type":"DSO"},
{"type":"DSO","numInputs":8},
{"type":"Delay"},
{"type":"Transmitter"}
],
"devices":[
{"type":"NOR","id":"dev0","x":384,"y":104,"label":"NOR"},
{"type":"NOR","id":"dev1","x":384,"y":176,"label":"NOR"},
{"type":"LED","id":"dev2","x":512,"y":104,"label":"Q"},
{"type":"LED","id":"dev3","x":512,"y":176,"label":"NQ"},
{"type":"Joint","id":"dev4","x":448,"y":112,"label":"Joint","state":{"direction":0}},
{"type":"Joint","id":"dev5","x":456,"y":184,"label":"Joint","state":{"direction":0}},
{"type":"Joint","id":"dev6","x":352,"y":176,"label":"Joint","state":{"direction":0}},
{"type":"Joint","id":"dev7","x":352,"y":120,"label":"Joint","state":{"direction":0}},
{"type":"AND","id":"dev8","x":272,"y":96,"label":"AND"},
{"type":"AND","id":"dev9","x":272,"y":184,"label":"AND"},
{"type":"Joint","id":"dev10","x":240,"y":184,"label":"Joint","state":{"direction":0}},
{"type":"PushOn","id":"dev11","x":168,"y":88,"label":"R"},
{"type":"PushOn","id":"dev12","x":168,"y":192,"label":"S"},
{"type":"Joint","id":"dev13","x":224,"y":152,"label":"Joint","state":{"direction":0}},
{"type":"Toggle","id":"dev14","x":168,"y":144,"label":"Gate","state":{"on":false}},
{"type":"DC","id":"dev15","x":88,"y":144,"label":"DC"},
{"type":"Joint","id":"dev16","x":240,"y":112,"label":"Joint","state":{"direction":0}},
{"type":"DSO","id":"dev17","x":392,"y":264,"label":"DSO","state":{"playing":true,"rangeIndex":0}}
],
"connectors":[
{"from":"dev0.in0","to":"dev8.out0"},
{"from":"dev0.in1","to":"dev7.out0"},
{"from":"dev1.in0","to":"dev6.out0"},
{"from":"dev1.in1","to":"dev9.out0"},
{"from":"dev2.in0","to":"dev4.out0"},
{"from":"dev3.in0","to":"dev5.out0"},
{"from":"dev4.in0","to":"dev0.out0"},
{"from":"dev5.in0","to":"dev1.out0"},
{"from":"dev6.in0","to":"dev4.out0"},
{"from":"dev7.in0","to":"dev5.out0"},
{"from":"dev8.in0","to":"dev11.out0"},
{"from":"dev8.in1","to":"dev16.out0"},
{"from":"dev9.in0","to":"dev10.out0"},
{"from":"dev9.in1","to":"dev12.out0"},
{"from":"dev10.in0","to":"dev13.out0"},
{"from":"dev11.in0","to":"dev15.out0"},
{"from":"dev12.in0","to":"dev15.out0"},
{"from":"dev13.in0","to":"dev14.out0"},
{"from":"dev14.in0","to":"dev15.out0"},
{"from":"dev16.in0","to":"dev13.out0"}
]
}
Gated SR - Latch (NOR) Truth Table
Set | Reset | GATE | Q | Not Q |
X | X | 0 | Qlast | Not Qlast |
0 | 0 | 1 | Qlast | Not Qlast |
1 | 0 | 1 | 1 | 0 |
0 | 1 | 1 | 0 | 1 |
1 | 1 | 1 | Illegal |
X - Don't Care
Circuit #3 - SR Latch (NAND)
{
"width":800,
"height":400,
"showToolbox":true,
"toolbox":[
{"type":"In"},
{"type":"Out"},
{"type":"Joint"},
{"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"},
{"type":"DSO"},
{"type":"DSO","numInputs":8},
{"type":"Delay"},
{"type":"Transmitter"}
],
"devices":[
{"type":"DC","id":"dev0","x":176,"y":104,"label":"DC"},
{"type":"NAND","id":"dev1","x":336,"y":72,"label":"NAND"},
{"type":"NAND","id":"dev2","x":336,"y":136,"label":"NAND"},
{"type":"Joint","id":"dev3","x":384,"y":80,"label":"Joint","state":{"direction":0}},
{"type":"Joint","id":"dev4","x":384,"y":144,"label":"Joint","state":{"direction":0}},
{"type":"Joint","id":"dev5","x":304,"y":88,"label":"Joint","state":{"direction":0}},
{"type":"Joint","id":"dev6","x":304,"y":136,"label":"Joint","state":{"direction":0}},
{"type":"LED","id":"dev7","x":408,"y":72,"label":"Q"},
{"type":"LED","id":"dev8","x":408,"y":136,"label":"NQ"},
{"type":"DSO","id":"dev9","x":392,"y":256,"label":"DSO","state":{"playing":true,"rangeIndex":0}},
{"type":"Toggle","id":"dev10","x":256,"y":144,"label":"NR","state":{"on":true}},
{"type":"Toggle","id":"dev11","x":256,"y":64,"label":"NS","state":{"on":true}}
],
"connectors":[
{"from":"dev1.in0","to":"dev11.out0"},
{"from":"dev1.in1","to":"dev5.out0"},
{"from":"dev2.in0","to":"dev6.out0"},
{"from":"dev2.in1","to":"dev10.out0"},
{"from":"dev3.in0","to":"dev1.out0"},
{"from":"dev4.in0","to":"dev2.out0"},
{"from":"dev5.in0","to":"dev4.out0"},
{"from":"dev6.in0","to":"dev3.out0"},
{"from":"dev7.in0","to":"dev3.out0"},
{"from":"dev8.in0","to":"dev4.out0"},
{"from":"dev10.in0","to":"dev0.out0"},
{"from":"dev11.in0","to":"dev0.out0"}
]
}
SR - Latch (NAND) Truth Table
NOT Set | NOT Reset | Q | Not Q |
1 | 1 | Qlast | Not Qlast |
1 | 0 | 0 | 1 |
0 | 1 | 1 | 0 |
0 | 0 | Illegal |
As with the NOR Latch, A gate can be added to the NAND Latch.
Circuit #4 - D Latch
{
"width":800,
"height":400,
"showToolbox":true,
"toolbox":[
{"type":"In"},
{"type":"Out"},
{"type":"Joint"},
{"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"},
{"type":"DSO"},
{"type":"DSO","numInputs":8},
{"type":"Delay"},
{"type":"Transmitter"}
],
"devices":[
{"type":"LED","id":"dev0","x":576,"y":112,"label":"LED"},
{"type":"LED","id":"dev1","x":576,"y":184,"label":"LED"},
{"type":"DC","id":"dev2","x":24,"y":152,"label":"DC"},
{"type":"Toggle","id":"dev3","x":128,"y":96,"label":"D","state":{"on":true}},
{"type":"RS-FF","id":"dev4","x":448,"y":144,"label":"RS-FF"},
{"type":"NAND","id":"dev5","x":304,"y":176,"label":"NAND"},
{"type":"NAND","id":"dev6","x":304,"y":104,"label":"NAND"},
{"type":"Toggle","id":"dev7","x":128,"y":184,"label":"C","state":{"on":false}},
{"type":"Joint","id":"dev8","x":208,"y":192,"label":"Joint","state":{"direction":0}},
{"type":"Joint","id":"dev9","x":224,"y":120,"label":"Joint","state":{"direction":0}},
{"type":"Joint","id":"dev10","x":416,"y":160,"label":"Joint","state":{"direction":0}},
{"type":"Joint","id":"dev11","x":416,"y":144,"label":"Joint","state":{"direction":0}},
{"type":"Joint","id":"dev12","x":400,"y":112,"label":"Joint","state":{"direction":0}},
{"type":"Joint","id":"dev13","x":400,"y":184,"label":"Joint","state":{"direction":0}},
{"type":"Joint","id":"dev14","x":272,"y":176,"label":"Joint","state":{"direction":0}},
{"type":"DSO","id":"dev15","x":376,"y":256,"label":"DSO","state":{"playing":true,"rangeIndex":0}}
],
"connectors":[
{"from":"dev0.in0","to":"dev4.out0"},
{"from":"dev1.in0","to":"dev4.out1"},
{"from":"dev3.in0","to":"dev2.out0"},
{"from":"dev4.in0","to":"dev11.out0"},
{"from":"dev4.in1","to":"dev10.out0"},
{"from":"dev5.in0","to":"dev14.out0"},
{"from":"dev5.in1","to":"dev8.out0"},
{"from":"dev6.in0","to":"dev3.out0"},
{"from":"dev6.in1","to":"dev9.out0"},
{"from":"dev7.in0","to":"dev2.out0"},
{"from":"dev8.in0","to":"dev7.out0"},
{"from":"dev9.in0","to":"dev8.out0"},
{"from":"dev10.in0","to":"dev13.out0"},
{"from":"dev11.in0","to":"dev12.out0"},
{"from":"dev12.in0","to":"dev6.out0"},
{"from":"dev13.in0","to":"dev5.out0"},
{"from":"dev14.in0","to":"dev12.out0"}
]
}
D Latch
D | C | Q | Not Q |
X | 0 | Qlast | Not Qlast |
1 | 1 | 1 | 0 |
0 | 1 | 0 | 1 |
Circuit #5 - Edge Trigger
Rising Edge
{
"width":800,
"height":400,
"showToolbox":true,
"toolbox":[
{"type":"In"},
{"type":"Out"},
{"type":"Joint"},
{"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"},
{"type":"DSO"},
{"type":"DSO","numInputs":8},
{"type":"Delay"},
{"type":"Transmitter"}
],
"devices":[
{"type":"DC","id":"dev0","x":48,"y":88,"label":"DC"},
{"type":"Toggle","id":"dev1","x":120,"y":88,"label":"Toggle","state":{"on":false}},
{"type":"NOT","id":"dev2","x":328,"y":88,"label":"NOT"},
{"type":"Joint","id":"dev3","x":456,"y":120,"label":"Joint","state":{"direction":0}},
{"type":"Delay","id":"dev4","x":304,"y":96,"label":"Delay","state":{"direction":0}},
{"type":"LED","id":"dev5","x":592,"y":104,"label":"LED"},
{"type":"NOT","id":"dev6","x":256,"y":88,"label":"NOT"},
{"type":"NOT","id":"dev7","x":408,"y":88,"label":"NOT"},
{"type":"Delay","id":"dev8","x":376,"y":96,"label":"Delay","state":{"direction":0}},
{"type":"Joint","id":"dev9","x":440,"y":152,"label":"Joint","state":{"direction":0}},
{"type":"Delay","id":"dev10","x":224,"y":96,"label":"Delay","state":{"direction":0}},
{"type":"AND","id":"dev11","x":528,"y":104,"label":"AND"},
{"type":"Joint","id":"dev12","x":152,"y":152,"label":"Joint","state":{"direction":0}},
{"type":"Delay","id":"dev13","x":480,"y":96,"label":"Delay","state":{"direction":0}},
{"type":"DSO","numInputs":8,"id":"dev14","x":376,"y":224,"label":"DSO","state":{"playing":true,"rangeIndex":0}}
],
"connectors":[
{"from":"dev1.in0","to":"dev0.out0"},
{"from":"dev2.in0","to":"dev4.out0"},
{"from":"dev3.in0","to":"dev9.out0"},
{"from":"dev4.in0","to":"dev6.out0"},
{"from":"dev5.in0","to":"dev11.out0"},
{"from":"dev6.in0","to":"dev10.out0"},
{"from":"dev7.in0","to":"dev8.out0"},
{"from":"dev8.in0","to":"dev2.out0"},
{"from":"dev9.in0","to":"dev12.out0"},
{"from":"dev10.in0","to":"dev1.out0"},
{"from":"dev11.in0","to":"dev13.out0"},
{"from":"dev11.in1","to":"dev3.out0"},
{"from":"dev12.in0","to":"dev1.out0"},
{"from":"dev13.in0","to":"dev7.out0"}
]
}
Falling Edge
{
"width":800,
"height":400,
"showToolbox":true,
"toolbox":[
{"type":"In"},
{"type":"Out"},
{"type":"Joint"},
{"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"},
{"type":"DSO"},
{"type":"DSO","numInputs":8},
{"type":"Delay"},
{"type":"Transmitter"}
],
"devices":[
{"type":"DC","id":"dev0","x":40,"y":104,"label":"DC"},
{"type":"Toggle","id":"dev1","x":112,"y":104,"label":"Toggle","state":{"on":false}},
{"type":"NOT","id":"dev2","x":184,"y":104,"label":"NOT"},
{"type":"NOT","id":"dev3","x":320,"y":104,"label":"NOT"},
{"type":"Joint","id":"dev4","x":448,"y":136,"label":"Joint","state":{"direction":0}},
{"type":"Delay","id":"dev5","x":224,"y":112,"label":"Delay","state":{"direction":0}},
{"type":"Delay","id":"dev6","x":296,"y":112,"label":"Delay","state":{"direction":0}},
{"type":"Delay","id":"dev7","x":448,"y":112,"label":"Delay","state":{"direction":0}},
{"type":"LED","id":"dev8","x":584,"y":120,"label":"LED"},
{"type":"NOT","id":"dev9","x":248,"y":104,"label":"NOT"},
{"type":"NOT","id":"dev10","x":400,"y":104,"label":"NOT"},
{"type":"Delay","id":"dev11","x":368,"y":112,"label":"Delay","state":{"direction":0}},
{"type":"Joint","id":"dev12","x":216,"y":168,"label":"Joint","state":{"direction":0}},
{"type":"Joint","id":"dev13","x":432,"y":168,"label":"Joint","state":{"direction":0}},
{"type":"DSO","numInputs":8,"id":"dev14","x":376,"y":224,"label":"DSO","state":{"playing":true,"rangeIndex":0}},
{"type":"AND","id":"dev15","x":528,"y":120,"label":"AND"}
],
"connectors":[
{"from":"dev1.in0","to":"dev0.out0"},
{"from":"dev2.in0","to":"dev1.out0"},
{"from":"dev3.in0","to":"dev6.out0"},
{"from":"dev4.in0","to":"dev13.out0"},
{"from":"dev5.in0","to":"dev2.out0"},
{"from":"dev6.in0","to":"dev9.out0"},
{"from":"dev7.in0","to":"dev10.out0"},
{"from":"dev8.in0","to":"dev15.out0"},
{"from":"dev9.in0","to":"dev5.out0"},
{"from":"dev10.in0","to":"dev11.out0"},
{"from":"dev11.in0","to":"dev3.out0"},
{"from":"dev12.in0","to":"dev2.out0"},
{"from":"dev13.in0","to":"dev12.out0"},
{"from":"dev15.in0","to":"dev7.out0"},
{"from":"dev15.in1","to":"dev4.out0"}
]
}
These circuits allow the latch to be triggered (clocked) on the rising or falling edge of a pulse instead on just the ON GATE used in the previous examples.
These circuits work due to PROPAGATION DELAY. Propagation delay is the TIME it takes for a change in the input to be seen on the output pin. The simulation above is slowed down so you can see the output does toggle when the correct edge is detected. In a typical NOT gate, the propagation delay is ~ 10 nSec per gate.
Circuit #6 - D Flip Flop (Falling edge Trigger)
{
"width":800,
"height":400,
"showToolbox":true,
"toolbox":[
{"type":"In"},
{"type":"Out"},
{"type":"Joint"},
{"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"},
{"type":"DSO"},
{"type":"Delay"},
{"type":"Transmitter"}
],
"devices":[
{"type":"D-FF","id":"dev0","x":272,"y":88,"label":"D-FF"},
{"type":"Toggle","id":"dev1","x":136,"y":48,"label":"D","state":{"on":true}},
{"type":"Toggle","id":"dev2","x":136,"y":120,"label":"Clk","state":{"on":true}},
{"type":"DC","id":"dev3","x":40,"y":80,"label":"DC"},
{"type":"LED","id":"dev4","x":408,"y":80,"label":"LED"},
{"type":"DSO","id":"dev5","x":360,"y":168,"label":"DSO","state":{"playing":true,"rangeIndex":0}}
],
"connectors":[
{"from":"dev0.in0","to":"dev1.out0"},
{"from":"dev0.in1","to":"dev2.out0"},
{"from":"dev1.in0","to":"dev3.out0"},
{"from":"dev2.in0","to":"dev3.out0"},
{"from":"dev4.in0","to":"dev0.out0"}
]
}
Since flip flops contain multiple gates and they get tedious to draw, the above is a standard way of drawing a d-flip flop. Note the triangle on the clock input. This symbol represents a "EDGE TRIGGER". If a circle was on the line coming into this, then it would be a "FALLING EDGE TRIGGER" but since no circle is present, it is a "RISING EDGE TRIGGER".
Circuit #7 - JK Flip Flop (With Async Active low Preset and Clear)
{
"width":1600,
"height":800,
"showToolbox":true,
"toolbox":[
{"type":"In"},
{"type":"Out"},
{"type":"Joint"},
{"type":"DC"},
{"type":"LED"},
{"type":"PushOff"},
{"type":"PushOn"},
{"type":"Toggle"},
{"type":"BUF"},
{"type":"NOT"},
{"type":"AND"},
{"type":"NAND"},
{"type":"NAND","numInputs":3},
{"type":"NAND","numInputs":4},
{"type":"OR"},
{"type":"OR","numInputs":3},
{"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"},
{"type":"DSO"},
{"type":"DSO","numInputs":8},
{"type":"JKFFPC"},
{"type":"Delay"},
{"type":"Transmitter"}
],
"devices":[
{"type":"DC","id":"dev0","x":32,"y":328,"label":"DC"},
{"type":"JKFFPC","id":"dev1","x":304,"y":288,"label":"JKFFPC"},
{"type":"Toggle","id":"dev2","x":152,"y":256,"label":"J","state":{"on":true}},
{"type":"Toggle","id":"dev3","x":152,"y":312,"label":"Clk","state":{"on":false}},
{"type":"Toggle","id":"dev4","x":152,"y":368,"label":"K","state":{"on":false}},
{"type":"Toggle","id":"dev5","x":160,"y":440,"label":"/Clr","state":{"on":false}},
{"type":"LED","id":"dev6","x":496,"y":272,"label":"Q"},
{"type":"LED","id":"dev7","x":496,"y":336,"label":"/Q"},
{"type":"Toggle","id":"dev8","x":160,"y":504,"label":"/Pre","state":{"on":true}},
{"type":"DSO","numInputs":8,"id":"dev9","x":472,"y":456,"label":"DSO","state":{"playing":true,"rangeIndex":0}}
],
"connectors":[
{"from":"dev1.in0","to":"dev2.out0"},
{"from":"dev1.in1","to":"dev3.out0"},
{"from":"dev1.in2","to":"dev4.out0"},
{"from":"dev1.in3","to":"dev5.out0"},
{"from":"dev1.in4","to":"dev8.out0"},
{"from":"dev2.in0","to":"dev0.out0"},
{"from":"dev3.in0","to":"dev0.out0"},
{"from":"dev4.in0","to":"dev0.out0"},
{"from":"dev5.in0","to":"dev0.out0"},
{"from":"dev6.in0","to":"dev1.out0"},
{"from":"dev7.in0","to":"dev1.out1"},
{"from":"dev8.in0","to":"dev0.out0"}
]
}
JK - Flip Flop (With Async Active low Preset and Clear) Truth Table
J | K | Clock | /Pre | /Clr | Q | /Q |
X | X | 0,1,↓ | 1 | 1 | Qlast | Not Qlast |
0 | 0 | ↑ | 1 | 1 | Qlast | Not Qlast |
1 | 0 | ↑ | 1 | 1 | 1 | 0 |
0 | 1 | ↑ | 1 | 1 | 0 | 1 |
1 | 1 | ↑ | 1 | 1 | Not Qlast | Qlast |
x | x | x | 0 | 1 | 1 | 0 |
x | x | x | 1 | 0 | 0 | 1 |
X - Don't Care