//基本语法结构 module Decode38(A_in, Y_out); //模块名称(端口列表) //端口定义申明: input [2:0] A_in; output reg [7:0] Y_out; //内部变量及参数申明 //模块功能实现 always@(A_in) begin case(A_in) 3'b000: Y_out = 8'b1111_1110; 3'b001: Y_out = 8'b1111_1101; 3'b010: Y_out = 8'b1111_1011; 3'b011: Y_out = 8'b1111_0111; 3'b100: Y_out = 8'b1110_1111; 3'b101: Y_out = 8'b1101_1111; 3'b110: Y_out = 8'b1011_1111; 3'b111: Y_out = 8'b0111_1111; default: Y_out = 8'b1111_1111; endcase end endmodule //模块结束