Latest Post

Ads

Verilog: OR Gate Behavioral Modelling with Testbench Code

Verilog Code OR Gate Behavioral Modelling

module OR_GATE (

input a, b,

output out );

reg out;

always @(a or b)

begin

if(a==0 & b==0)

out = 1’b0;

else

out = 1’b1;

endmodule

//test-bench

initial begin

a=0; b=0;

#100; //wait 100ns for global reset to finish

//add stimulus here

#100 a=0; b=1;

#100 a=1; b=0;

#100 a=1; b=1;

end

initial begin

#100 $monitor(“a=%b, b=%b, out=%b”, a, b, out);

end

endmodule


Xilinx Output:
Verilog code OR gate Behavioral Modelling
OR Gate Response



Comments

Ads

Popular posts from this blog

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

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

VLSI: Half Subtractor and Full Subtractor Gate Level Modelling

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

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