Question: working on vivado, tasked to write a testbench for my 2 - 1 MUX but the compiler keeps saying my syntax is bad on line

working on vivado, tasked to write a testbench for my 2-1 MUX but the compiler keeps saying my syntax is bad on line 6 by 'reg'. what am i missing?
//2-1mux code
`timescale 1s /1s
module Mux_2x1(Y, I0, I1, S);
input I0,I1,S;
output Y;
wire sb, a, b;
not(sb,S);
and(a,sb,I0);
and(b,S,I1);
or(Y,a,b);
endmodule
//mux_tb code
`timescale 1ns /1ps
module Mux_2x1_tb
reg I0, I1, S;
wire Y;
Mux_2x1 uut(I0, I1, S, Y);
initial begin
S =0; I0=0; I1=1;
#10
S =0; I0=1; I1=0;
#10
S =1; I0=1; I1=0;
#10
S =1; I0=0; I1=1;
#10
$finish();
end
endmodule
working on vivado, tasked to write a testbench

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 Programming Questions!