0% found this document useful (0 votes)
3 views2 pages

Day 6

The document provides Verilog HDL code for a module named 'mod_a' that computes two outputs based on four inputs using logical operations. It also includes a testbench for the 'RTL_D6' module, which instantiates 'mod_a' and tests it with various input combinations while monitoring the outputs. The testbench simulates the functionality of the design over a series of time steps.

Uploaded by

gireshramg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Day 6

The document provides Verilog HDL code for a module named 'mod_a' that computes two outputs based on four inputs using logical operations. It also includes a testbench for the 'RTL_D6' module, which instantiates 'mod_a' and tests it with various input combinations while monitoring the outputs. The testbench simulates the functionality of the design over a series of time steps.

Uploaded by

gireshramg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Day 6:

Verilog HDL Code:

module mod_a (

output out1, out2,

input a, b, c, d

);

assign out1 = (a & b) | (c & d);

assign out2 = (a | b) & (c | d);

endmodule

module RTL_D6 (

input a, b, c, d,

output out1, out2

);

mod_a my_instance (out1, out2, a, b, c, d);

endmodule

Verilog HDL testbench code:

module RTL_D6_tb;

reg a, b, c, d;

wire out1, out2;

RTL_D6 uut (

.a(a), .b(b), .c(c), .d(d),

.out1(out1), .out2(out2)

);

initial begin
$monitor("Time=%0t | a=%b b=%b c=%b d=%b | out1=%b out2=%b", $time, a, b, c, d,
out1,

out2);

a = 0; b = 0; c = 0; d = 0; #10;

a = 0; b = 0; c = 0; d = 1; #10;

a = 0; b = 1; c = 1; d = 1; #10;

a = 1; b = 1; c = 0; d = 0; #10;

a = 1; b = 1; c = 1; d = 1; #10;

$finish;

end

endmodule

Functional Simulation:

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy