实验过程截图
实验结果截图
实验代码
module or4_behav #(parameter word_length = 4)(output reg y,
input [word_length -1:0] x_in
);
integer k;
always @ x_in begin: check_for_1
y=0;
for (k = 0; k <= word_length -1; k = k+1)
if (x_in[k] == 1) begin
y=1;
disable check_for_1;
end
end
endmodule
module or4_behav_latch#(parameter word_length=4)(output reg y, input [word_length -1: 0] x_in
);
integer k;
always @(x_in[3: 1]) begin: check_for_1 y=0;
for (k=0;k<=word_length -1; k=k+1)
if (x_in[k] == 1) begin
y=1;
disable check_for_1;
end
end
endmodule
实验视频:搜索哔哩哔哩链接
【期末考试实验三-哔哩哔哩】https://b23.tv/qicYo1