Question: 1 . This exercise refers to the files: XOR 2 gate.sv XOR 2 gate testbench.sv a . After loading these fies into the EDA playground,

1. This exercise refers to the files:
XOR2gate.sv
XOR2gate testbench.sv
a. After loading these fies into the EDA playground, run a simulation and include a timing diagram of your simulation in your report.
b. Edit the design file and convert the Verilog code to a behavioral model that performs the same function as the structural model. After doing this, run a simulation and include your code and a timing diagram of your simulation in your report.
XOR testbench:reg x1, x2;
reg y1;
//display variables
initial
$monitor ("x1=%b, x2=%b, y1=%b", x1, x2, y1);
//instantiate the xor2input module into the test bench
xor2input XOR2_SIM (
.x1(x1),
.x2(x2),
.y1(y1)
);
//apply input vectors
initial begin
// Dump waves
$dumpfile("dump.vcd");
$dumpvars(1, xor2_tb);
#0 x1=1'b0;
x2=1'b0;
#1 x1=1'b0;
x2=1'b1;
#1 x1=1'b1;
x2=1'b0;
#1 x1=1'b1;
x2=1'b1;
#10 $stop;
end
endmodule
XOR sv:module xor2input (x1, x2, y1);
input x1, x2;
output y1;
wire x1not, x2not, a1, a2;
not inv1(x1not, x1);
not inv2(x2not, x2);
and and1(a1, x2, x1not);
and and2(a2, x1, x2not);
or or1(y1, a1, a2);
endmodule
2. This exercise refers to the files:
full adder 1bit behavioral model.sv
full adder 1bit behavioral model testbench.sv
a. After loading these files into the EDA playground, run a simulation and include a timing diagram of your simulation in your report.
b. Edit the test bench file in order to add two more test cases to your simulation after those already shown in your timing diagram (you may choose the time at which to initiate these values):
i. a =1; b =1; c =1;
ii. a =1; b =0; c =0;
3. This exercise refers to the files:
full adder 4bit ripple carry behavioral model.sv
full adder 4bit ripple carry behavioral model testbench.sv
a. After loading these files into the EDA playground, run a simulation and include a timing diagram of your simulation in your report.
b. Edit the design and test bench files in order to convert the 4-bit adder into an 8-bit adder. Choose four different pairs of values for the a and b operands (with cin =0).
i. Run a simulation and include your code and a timing diagram of your simulation in your report.
ii. For the four sets of values you chose, verify 'by hand' the addition took place correctly by comparing your timing diagram results with the answers you computed by hand. Make sure to refer to the timing diagram in your report in order to show exactly where your predicted result is computed.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!