Beruflich Dokumente
Kultur Dokumente
Ch#1: Introduction
What is Verilog? (/verilog/verilog-tutorial)
Introduction to Verilog (/verilog/verilog-introduction)
Chip Design Flow (/verilog/asic-soc-chip-design-flow)
Chip Abstraction Layers (/verilog/verilog-design-abstraction-layers)
module tb;
reg a, b, sel;
wire out;
integer
You consent to our cookies if you continue i; our website. To know more about cookies, see our privacy policy
to use Agree
(/info/privacy-policy). I accept cookies from this site.
/
mux 2x1 u0 ( .a(a), .b(b), .sel(sel), .out(out))
mux_2x1 u0 ( .a(a), .b(b), .sel(sel), .out(out))
initial begin
{a, b, sel} <= 0;
Simulation Log
ncsim> run
T=0 a=0 b=0 sel=0 out=0
T=1 a=0 b=1 sel=1 out=0
T=2 a=1 b=1 sel=1 out=1
T=3 a=1 b=0 sel=1 out=1
T=6 a=0 b=1 sel=0 out=1
T=7 a=1 b=1 sel=0 out=1
T=8 a=1 b=0 sel=0 out=0
T=9 a=0 b=1 sel=0 out=1
T=10 a=1 b=1 sel=1 out=1
ncsim: *W,RNQUIE: Simulation is complete.
Full Adder
wire s1,
You consent to our cookies if you continue net1,
to use net2;To know more about cookies, see our privacy policy
our website. Agree
(/info/privacy-policy). I accept cookies from this site.
/
xor (s1, a, b);
xor (s1, a, b);
and (net1, a, b);
endmodule
module tb;
reg a, b, cin;
wire sum, cout;
integer i;
initial begin
{a, b, cin} <= 0;
Simulation Log
ncsim> run
T=0 a=0 b=0 cin=0 cout=0 sum=0
T=1 a=0 b=1 cin=1 cout=1 sum=0
T=2 a=1 b=1 cin=1 cout=1 sum=1
T=3 a=1 b=0 cin=1 cout=1 sum=0
T=6 a=0 b=1 cin=0 cout=0 sum=1
T=7 a=1 b=1 cin=0 cout=1 sum=0
T=8 a=1 b=0 cin=0 cout=0 sum=1
T=9 a=0 b=1 cin=0 cout=0 sum=1
T=10 a=1 b=1 cin=1 cout=1 sum=1
ncsim: *W,RNQUIE: Simulation is complete.
2x4 Decoder
initial begin
{x, y, en} <= 0;
$monitor ("T=%0t x=%0b y=%0b en=%0b a=%0b b=%0b c
$time, x, y, en, a, b, c, d);
en <= 1;
for (i = 0; i < 10; i = i+1) begin
#1 x <= $random;
y <= $random;
end
end
endmodule
Simulation Log
ncsim> run
T=0 x=0 y=0 en=1 a=0 b=0 c=0 d=1
T=1 x=0 y=1 en=1 a=0 b=0 c=1 d=0
T=2 x=1 y=1 en=1 a=1 b=0 c=0 d=0
T=4 x=1 y=0 en=1 a=0 b=1 c=0 d=0
T=5 x=1 y=1 en=1 a=1 b=0 c=0 d=0
T=6 x=0 y=1 en=1 a=0 b=0 c=1 d=0
T=7 x=1 y=0 en=1 a=0 b=1 c=0 d=0
T=10 x=1 y=1 en=1 a=1 b=0 c=0 d=0
ncsim: *W,RNQUIE: Simulation is complete.
4x2 Encoder
or (x, b, d);
or (y, c, d);
endmodule
module tb;
reg a, b, c, d;
wire x, y;
integer
You consent to our cookies if you continue i; our website. To know more about cookies, see our privacy policy
to use Agree
(/info/privacy-policy). I accept cookies from this site.
/
enc 4x2 u0 ( .a(a), .b(b), .c(c), .d(d), .x(x), .y
g ( g g )
SystemVerilog Tutorial (/systemverilog/systemverilog-tutorial)
UVM Tutorial (/uvm/uvm-tutorial)
Quiz (/quiz/systemverilog-quiz-1)
Quizzes
Submit
General
Blog (/blog)
Login (/connect)
Tutorials (/verilog/verilog-tutorial)
Discussion Forum (/forum)
Contact Us (/contact-us)
You consent to our cookies Tutorials
if you continue to use our website. To know more about cookies, see our privacy policy Agree
(/info/privacy-policy). I accept cookies from this site.
/
Verilog (/verilog/verilog-tutorial)
SystemVerilog (/systemverilog/systemverilog-tutorial)
UVM (/uvm/uvm-tutorial)
SoC (/soc/soc-tutorial)
Code Examples (/verificaton/codehub)
Interview Questions (/verificaton/interview-questions)
Quiz (/quiz/systemverilog-quiz-1)
Latest SV Articles
SystemVerilog Ch#1 Quiz (/log-in/)
SystemVerilog Assertions with time delay
(/systemverilog/systemverilog-assertions-time-delay)
SystemVerilog $rose, $fell, $stable
(/systemverilog/systemverilog-sequence-rose-fell-stable)
SystemVerilog Assertions (/systemverilog/systemverilog-
assertions)
SystemVerilog Testbench Example Adder
(/systemverilog/systemverilog-testbench-example-adder)
You consent to our cookies if you continue to use our website. To know more about cookies, see our privacy policy Agree
(/info/privacy-policy). I accept cookies from this site.
/
enc_4x2 u0 ( .a(a), .b(b), .c(c), .d(d), .x(x), .y
initial begin
{a, b, c, d} <= 0;
endmodule
Simulation Log
ncsim> run
T=0 a=0 b=0 c=0 d=0 x=0 y=0
T=2 a=0 b=0 c=0 d=1 x=1 y=1
T=3 a=0 b=0 c=1 d=0 x=0 y=1
T=4 a=0 b=0 c=1 d=1 x=1 y=1
T=5 a=0 b=1 c=0 d=0 x=1 y=0
T=6 a=0 b=1 c=0 d=1 x=1 y=1
T=7 a=0 b=1 c=1 d=0 x=1 y=1
T=8 a=0 b=1 c=1 d=1 x=1 y=1
T=9 a=1 b=0 c=0 d=0 x=0 y=0
T=10 a=1 b=0 c=0 d=1 x=1 y=1
T=11 a=1 b=0 c=1 d=0 x=0 y=1
T=12 a=1 b=0 c=1 d=1 x=1 y=1
T=13 a=1 b=1 c=0 d=0 x=1 y=0
T=14 a=1 b=1 c=0 d=1 x=1 y=1
T=15 a=1 b=1 c=1 d=0 x=1 y=1
T=16 a=1 b=1 c=1 d=1 x=1 y=1
T=17 a=0 b=0 c=0 d=0 x=0 y=0
ncsim: *W,RNQUIE: Simulation is complete.
You consent to our cookies if you continue to use our website. To know more about cookies, see our privacy policy Agree
(/info/privacy-policy). I accept cookies from this site.
JEE Main Previous UVM Veri cation Write With JK
/ Fl
Year Papers Testbench Example Con dence
Easy Tutorials
You consent to our cookies if you continue to use our website. To know more about cookies, see our privacy policy Agree
(/info/privacy-policy). I accept cookies from this site.
Verilog Tutorial (/verilog/verilog-tutorial) /