33 lines
587 B
Verilog
33 lines
587 B
Verilog
`include "or16.v"
|
|
|
|
module Or16_test;
|
|
reg [15:0] a, b;
|
|
wire [15:0] out;
|
|
|
|
integer i, j;
|
|
|
|
initial begin
|
|
$dumpfile("or16_tb.vcd");
|
|
$dumpvars;
|
|
for (i=0; i<16; i=i+1)
|
|
begin
|
|
a[i]=0;
|
|
b[i]=0;
|
|
end
|
|
for (i=15; i>=0; i=i-1)
|
|
begin
|
|
for (j=0; j<4; j=j+1)
|
|
begin
|
|
b[i]=(j&2)>>1;
|
|
a[i]=j&1;
|
|
#1;
|
|
end
|
|
a[i]=0;
|
|
b[i]=0;
|
|
end
|
|
$finish();
|
|
end
|
|
|
|
Or16 u1 (.a(a), .b(b), .out(out));
|
|
endmodule
|