Saturday 4 July 2015

Combinational circuits-Decoder 3of8


DECODER 3 out of 8

module decoder3outof8(d,in);
output [7:0]d;
input [2:0]in;
reg [7:0]d;
always @(in)
begin
case(in)
3'b000:d=8'b10000000;
3'b001:d=8'b01000000;
3'b010:d=8'b00100000;
3'b011:d=8'b00010000;
3'b100:d=8'b00001000;
3'b101:d=8'b00000100;
3'b110:d=8'b00000010;
3'b111:d=8'b00000001;
endcase
end
endmodule

No comments:

Post a Comment