Latest Post

Ads

Verilog: VLSI Code for JK Flip Flop with Testbench Dataflow Modelling

Verilog Code for J K Flip Flop Dataflow Modelling

module JK_flipflop(
input j,
input k,
input en,
output q,
output qb
);
assign a = ~ ( qb & j & en );
assign b = ~ ( q & k & en );
assign q = ~ ( a & qb );
assign qb = ~ ( b & q & (~ k) );

endmodule
 
//Testbench

initial begin
// Initialize Inputs
j = 0;
k = 0;
en = 0;
// Wait 100 ns for global reset to finish
#100;
// Add stimulus here 
#100;j = 0;k = 0;en = 1;
#100;j = 0;k = 1;en = 1;
#100;j = 1;k = 0;en = 1;
#100;j = 1;k = 1;en = 1;
#100;j = 0;k = 1;en = 0;
#100;j = 1;k = 0;en = 0;
#100;j = 1;k = 1;en = 0;
#100;j = 0;k = 0;en = 1;
#100;j = 0;k = 1;en = 1;
#100;j = 1;k = 0;en = 1;
#100;j = 1;k = 1;en = 1;
 
end

Xillinx Output:

JK Flip Flop


JK Flip Flop Dataflow Modelling

 
Also See:List of Verilog Programs

Comments

Ads

Popular posts from this blog

VLSI: 1-4 DEMUX (Demultiplexer) Dataflow Modelling with Testbench

VLSI: Half Subtractor and Full Subtractor Gate Level Modelling

1 to 4 DEMUX (Demultiplexer) Verilog CodeStructural/Gate Level Modelling with Testbench

Full Subtractor Verilog Code in Structural/Gate Level Modelling with Testbench

VLSI: 3-8 Decoder Structural/Gate Level Modelling with Testbench