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: BCD to Excess 3 and Excess 3 to BCD Dataflow Modelling

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

VLSI: 4-1 MUX Dataflow Modelling with Testbench

VLSI: Half Subtractor and Full Subtractor Gate Level Modelling

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