kvnsmnsn
Junior Member level 1

When I was first exposed to the idea of a D flipflop, and the latch that was its main building block, I was given the impression that the standard way to implement it was the four NAND gates in the following diagram that I got from "https://www.electronicshub.org/d-flip-flop":
Since each NAND gate has four transistors, this involves sixteen transistors, or eighteen, if you include the inverter that produces (nData) from (data). But since then I've seen an alternative way to build the same latch with just a multiplexer and two inverters:
Note that this circuit just has ten transistors, a considerable improvement over eighteen. Is there a downside to using this ten-transistor circuit to the eighteen-transistor circuit?
Code:
,---.
data o---------------| \ ,---.
| )o-------| \
,-------| / | )o-------*-------o value
| `---' ,---| / |
| | `---' |
| | |
| `--------------. |
nData o-------+---. | |
| | ,--------------+---'
| | | |
| | | ,---. |
| | ,---. `---| \ |
| `---| \ | )o---*-----------o nValue
| | )o-------| /
gate o-------*-------| / `---'
`---'
Code:
-------
|
,-----------------*-------------.
| | |
,---' | |
|| | |
,---o|| | |
| || | |
| `---. | |
gate | | | |
o-----*---------* *---. | |
| | | | | |
| | ,---' | | |
| | || | | |
| `----|| | | |
data | || | | |
o-----+---------. `---. | | |
| | | | | |
| ,---*---. | | ,---' ,---'
| || || | | || ||
*----|| ||o---+---* ,---o|| ,---o||
| || || | | | || | ||
| `---*---' | | | `---. | `---.
| | | | | | | |
| *---------+---+---* *---* *---*-----o
| | | | | | | | | value
| ,---*---. | | | ,---' | ,---' |
| || || | | | || | || |
`---o|| ||----+---' `----|| *----|| |
|| || | || | || |
`---*---' | `---. | `---. |
| | | | | |
| | | `---------+---+-----o
| | | | | nValue
`---------+-----------------+-------------+---'
| | |
`-----------------*-------------'
|
.---,
\ /
v