Industriële fabricage
Industrieel internet der dingen | Industriële materialen | Onderhoud en reparatie van apparatuur | Industriële programmering |
home  MfgRobots >> Industriële fabricage >  >> Industrial programming >> Verilog

JK Flip-Flop: Ontwerp, Implementatie en Testbench

Ontwerp

module jk_ff (
  input j,
  input k,
  input clk,
  output q
);
  reg q;
  always @ (posedge clk)
    case ({j,k})
      2'b00 : q <= q;
      2'b01 : q <= 0;
      2'b10 : q <= 1;
      2'b11 : q <= ~q;
    endcase
endmodule

Hardware Schema

Afbeelding van het JK flip-flop schema

Testbench

module tb_jk;
  reg j;
  reg k;
  reg clk;
  always #5 clk = ~clk;
  jk_ff jk0 (
    .j(j),
    .k(k),
    .clk(clk),
    .q(q)
  );
  initial begin
    j <= 0; k <= 0;
    #5  j <= 0; k <= 1;
    #20 j <= 1; k <= 0;
    #20 j <= 1; k <= 1;
    #20 $finish;
  end
  initial $monitor ("j=%0d k=%0d q=%0d", j, k, q);
endmodule

Verilog

  1. Hoe Frequentieomkeerders Energie-efficiëntie In Industriële Operaties Boosten
  2. Verilog Basics: Uw Eerste AND-poort Ontwerpen
  3. Verilog beheersen: Complete tutorial voor digitale schakelingontwerp
  4. Uitgebreide ASIC Ontwerpstroom: Van Vereisten tot Productie
  5. Ontwerpabstractielagen: Duidelijke gids voor chip-architectuur
  6. Verilog-syntaxis beheersen: Essentiële regels & best practices
  7. Verilog-datatypes: Bits, wires en logische waarden uitgelegd
  8. Verilog scalars en vectors begrijpen: Bits, registers en nettypes
  9. Een Verilog T Flip-Flop Ontwerpen: RTL Implementatie & Testbench
  10. Verilog Mod-N Teller Ontwerp: Geparametriseerde Module & Testbench
  11. Verilog Gray-code Teller Module – 4-bit Gray Code Generator