This repository has been archived on 2024-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
study/decoder/rtl/decoder_138.v
2020-06-09 15:48:03 +08:00

31 lines
499 B
Verilog

module decoder_138(
a0,
a1,
a2,
out_n
);
input a0;
input a1;
input a2;
output reg [7:0] out_n;
always @(a0 or a1 or a2)
begin
case({a0,a1,a2})
3'b000:out_n = 8'b1111_1110;
3'b001:out_n = 8'b1111_1101;
3'b010:out_n = 8'b1111_1011;
3'b011:out_n = 8'b1111_0111;
3'b100:out_n = 8'b1110_1111;
3'b101:out_n = 8'b1101_1111;
3'b110:out_n = 8'b1011_1111;
3'b111:out_n = 8'b0111_1111;
endcase
end
endmodule