120526
BEMTS (6A)
Assignment 5
begin
temp <= {temp[14:0],si};
end
assign so = temp[15];
endmodule
clk = 0;
si = 1;
// Wait 100 ns for global reset to finish
#10;
clk = 1;
si = 1;
//**Follow and give values according to requirements
end
endmodule
initial begin
Test Fixture
code:
s = 0;
// Wait 10 ns for global reset to finish
#10;
// Initialize Inputs
si = 1;
clk = 0;
s = 0;
// Wait 10 ns for global reset to finish
#10;
si = 1;
clk = 0;
s = 0;
//**Follow and give values according to requirements
end
endmodule
si = 1;
clk = 1;
begin
temp <= {temp[6:0],si};
end
assign po = temp;
endmodule
clk = 0;
si = 0;
// Wait 100 ns for global reset to finish
#10;
clk = 1;
si = 1;
//**Follow and give values according to requirements
end
endmodule
else if (s==1)
begin
temp <= {si,temp[7:1]};
so <= temp[0];
end
//parallel in serial out
else if (s==2)
begin
temp <= pi;
so <= temp[0];
end
//serial in parallel out
else
begin
temp <= {si,temp[7:1]};
po <= temp;
end
end
end
endmodule
clk = 1;
clr = 0;
s = 2'b00;
si = 1;
pi = 8'b11001011;
// Wait 100 ns for global reset to finish
//**Follow and give values according to requirements
end
endmodule
// Initialize Inputs
clk = 0;
clr = 0;
s = 2'b00;
si = 1;
pi = 8'b11001011;
// Wait 100 ns for global reset to finish
#10;
else
begin
if(countvalue == period -1)
begin
countvalue =0;
clkout <= 0;
end
else
countvalue = countvalue +1;
if (countvalue == halfperiod)
clkout <= 1;
end
end
endmodule
initial begin
// Initialize Inputs
clk = 0;
reset = 1;
// Wait 100 ns for global reset to finish
#10;
clk = 1;
reset = 1;
// Wait 100 ns for global reset to finish
#10;
end
endmodule