--- author: Oldrich Pecak --- # Latches, flip-flops --- ## bistable circuits - until now we worked with stable circuits - astable - do not have stable state (vibrators, clock generators) - monostable - one stable state (pulse generators) - bistable - two stable states -> very useful - two types of bistable circuits we use: - latches - sensitive to level of input - flip-flops - sensitive to edges of input --- ## Basic SR latch - most basic latch - uses feedback from output - transparent output - immediate change of output - AND-OR construction |S|R|Q-next| |-|-|----:| |0|0|Q| |0|1|0| |1|0|1| |1|1|X| --- ## NAND SR latch - inverted SR latch - has double feedback - complementary output - let's build it --- ## Gated SR latch - adds enable pin to SR latch - can be built using two more NAND gates - makes the output opaque/non-transparent - still not a flip-flop - let's modify the SR latch we built --- ## D flip-flop - basic flip-flop - commonly used for memory, shift registers, delays |Edge|D|Q-next| |----|-|-----:| |↑|0|0| |↑|1|1| |↓|X|Q| --- ## T flip-flop - toggles the output Q on positive edge - can be used for clock dividing - not common |T|Q-next| |-|-----:| |0|Q| |1|!Q| --- ## JK flip-flop - universal flip-flop, it can simulate D and T flip-flops - very commonly used due to this - pros: very common in 74xxxx logic - cons: slower and more complex |J|K|Q-next| |-|-|-----:| |0|0|Q| |0|1|0| |1|0|1| |1|1|!Q| --- ## Shift registers - memory that shifts the contents on clock input - let's build a 2 bit shift register