Skip to content
  • This project
    • Loading...
  • Sign in

Barry / rf-depot

Go to a project
Toggle navigation
Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Graphs
  • Network
  • Create a new issue
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • rf-depot
  • ..
  • nec
  • GCB_DFF.v
  • root's avatar
    added the rest · 5fa3b884
    5fa3b884
    root committed 2020-05-02 06:11:47 +0000
GCB_DFF.v 384 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
`timescale 1ns/1ns

module GCB_DFF (q, qn, d, cp, sdn, cdn);
   input d, cp, sdn, cdn;
   output q, qn;
   reg tq;

   assign #1 qn = (!sdn && !cdn) ? 1'b0 : ~tq;
   assign #1 q  = tq;

   always @ (posedge cp or negedge cdn or negedge sdn) begin
      if (sdn && cdn)
         tq = d;
      else if (!sdn && cdn)
         tq = 1'b1;
      else
         tq = 1'b0;
   end

endmodule