涉及知识点: case用法、always敏感赋值。
模块源码
module my3_8(a,b,c,out);
input a;//输入端口
input b;
input c;
output reg [7:0] out;//输出端口
always @(a,b,c) begin
case ({a,b,c})
3'b000: out = 8'b0000_0001;
3'b001: out = 8'b0000_0010;
3'b010: out = 8'b0000_0100;
3'b011: out = 8'b0000_1000;
3'b100: out = 8'b0001_0000;
&