发布网友 发布时间:2023-10-31 22:25
共1个回答
热心网友 时间:2024-11-20 03:31
mole decode3_8(data_out,data_in,enable) ;
input [2:0] data_in;
input enable;
output [7:0] data_out;
reg [7:0] data_out;
always @(data_in orenable)
begin
if (enable==1)
case (data_in )
3'b000: data_out=8'b0000_0001;
3'b001: data_out=8'b0000_0010;
3'b010: data_out=8'b0000_0100;
3'b011: data_out=8'b0000_1000;
3'b100: data_out=8'b0001_0000;
3'b101: data_out=8'b0010_0000;
3'b110: data_out=8'b0100_0000;
3'b111: data_out=8'b1000_0000;
default: data_out=8'bxxxxxxxx;
endcase
else
data_out=8'b0000_0000;
end
endmole