.PS log_init # Usual defs... qrt=dimen_/4; hlf=dimen_/2; dim=dimen_; # Master Flip Flop: G1:NAND_gate line from G1.In1 left_ 6*L_unit; R:Here line from G1.Out right_ 6*L_unit; Y1:Here line from G1.In2 left_ 3*L_unit then down_ 3*L_unit J1:Here move to G1.center then down_ 12*L_unit; right_ G2:NAND_gate with .center at Here line from G2.In2 left_ 6*L_unit; S:Here line from G2.Out right_ 6*L_unit line from G2.In1 left 3*L_unit then up_ 3*L_unit J2:Here move to G1.Out then right_ 3*L_unit line from J2 to (Here,J1) then to Here; dot move to G2.Out then right_ 3*L_unit line from J1 to (Here,J2) then to Here; dot # Clock circuit... G3:NAND_gate with .Out at R G4:NAND_gate with .Out at S line from G3.In2 left_ 3*L_unit line to (Here,G4.In1) then to G4.In1 move to G3.In2+(-3*L_unit,(G4.In1.y-G3.In2.y)/2); dot; line left_ 12*L_unit; "Clock " ljust_ Mid: Here line from G3.In1 left_ 15*L_unit; "$D$ " ljust_ line from G4.In2 left_ 2*L_unit; right_; G5:NOT_gate with .Out at Here line from G5.In1 left_ 2*L_unit line to (Here,G3.In1);dot #Slave Flip Flop move to G1.center; P1:Here; right_ G1:NAND_gate with .center at P1+(35*L_unit,0);right_; dot; line from G1.In1 left_ 6*L_unit; R:Here line from G1.Out right_ 6*L_unit; " $Q$" ljust_ line from G1.In2 left_ 3*L_unit then down_ 3*L_unit J1:Here move to G1.center then down_ 12*L_unit; right_ G2:NAND_gate with .center at Here line from G2.In2 left_ 6*L_unit; S:Here line from G2.Out right_ 6*L_unit; " $\overline{Q}$" ljust_ line from G2.In1 left 3*L_unit then up_ 3*L_unit J2:Here move to G1.Out then right_ 3*L_unit line from J2 to (Here,J1) then to Here; dot move to G2.Out then right_ 3*L_unit line from J1 to (Here,J2) then to Here; dot # Clock circuit... G3:NAND_gate with .Out at R G4:NAND_gate with .Out at S line from G3.In2 left_ 2*L_unit line to (Here,G4.In1) then to G4.In1 move to G3.In2+(-2*L_unit,(G4.In1.y-G3.In2.y)/2); R1:dot; line left_ 1.5*L_unit then down_ 15*L_unit; line to (G5.Out,Here);right_ NOT_gate with .Out at Here line from last[].In1 left_ 5*L_unit line to (Here, Mid); dot line from G3.In1 left_ 6*L_unit then down_ 3*L_unit line from G4.In2 left_ 6*L_unit then up_ 3*L_unit move to R1 L1:line dashed from R1-(2.75*L_unit,18*L_unit) to R1+(-2.75*L_unit,15*L_unit) move to L1.end; right_ # note that sp_ is strictly for gpic(). Now that I use dpic().... # {"Master sp_ sp_" rjust_};{"sp_ sp_ Slave"ljust_} {"Master \ \ " rjust_};{" \ \ Slave"ljust_} move to G2.center then down_ 4*L_unit; "\tiny EdgeDLatch" ljust_ .PE