Sie sind auf Seite 1von 3

hdlsnippets

Verilog Snippets | VHDL Snippets | SystemVerilog Snippets | About | Links

User login
Username: * Password: *

Home

Verilog JK Flip Flop


Submitted by abettino on Thu, 03/18/2010 - 21:24

Search
Search this site:

A JK flip flop can be considered the "universal" flip flop since any other flip flop can be constructed from it. While this is an interesting point, it does not have any real world implications since digital electronics is dominated by the D flip flop. Nevertheless, it makes for an interesting discussion. Here is a snippet for the JK flip flop.

Search

Log in

Create new account Request new passwor d

module jk_flip_flop ( input clk, input j, input k, output reg q ); always @(posedge case ({j,k}) 2'b11 : q <= 2'b01 : q <= 2'b10 : q <= 2'b00 : q <= endcase endmodule
And this is how a D flip flop can be synthesized from a JK flip flop.

Currently Indexing SystemVerilo g Snippets: 16 Verilog Snippets: 41 VHDL Snippets: 3 Total Snippets: 60

clk) ~q; 1'b0; 1'b1; q; // // // // toggle. reset. set. hold.

module d_from_jk_flip_flop ( input clk, input d, output q ); jk_flip_flop d_flop ( .clk (clk), .j (d ), .k (~d ), .q (q ) ); endmodule
And finally a T flip flop can also be synthesized from the JK flip flop.

module t_from_jk_flip_flop ( input clk, input t, output q ); jk_flip_flop t_flop ( .clk (clk), .j (d ), .k (d ), .q (q ) ); endmodule Attachment

Size

jk_flip_flop.v 625 bytes

Add new comment

Verilog Snippets

VHDL Snippets

SystemVerilog Snippets

About

Links

Fatal error: Call to undefined function user_access() in /home/abettino/public_html/sites/all/modules/visitors/ visitors.module on line 247

Das könnte Ihnen auch gefallen