how to design 8 to 256 decoder..

Status
Not open for further replies.
how to design 8 to 256 decoder ..

There are various ways to design a 8-to-256 decoder.
1. Using 3-to-8 decoder.
2. Using 4-to-16 decoder.
and many.
many logic can be applied to this problem.

any simple logic is there to write code in verilog ..

You can make a 3-to-8 decoder and instantiate them to make a 8-to-256 decoder.A very simple logic for 3-to-8 decoder is given below.

Code:
module decoder (Out, In);
output [7:0] Out;
input  [2:0] In;
reg    [7:0] Out;

always @ (In)
begin
case (In)
0 : Out=8'b00000001;
0 : Out=8'b00000010;
0 : Out=8'b00000100;
0 : Out=8'b00001000;
0 : Out=8'b00010000;
0 : Out=8'b00100000;
0 : Out=8'b01000000;
0 : Out=8'b10000000;
default : Out=8'bx;
endcase

endmodule
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…