Altera_Forum
Honored Contributor
16 years agoMm74hc154 Fpga
hi friends im doing a project on MM74HC154 FPGA 4-to-16 line decoder i need some ideas and informations... waiting for your replies shimaz
@shimaz
This looks like an initial course assignment... --- Quote Start --- im doing a project on MM74HC154 FPGA 4-to-16 line decoder --- Quote End --- You can specify this as a schematic, VHDL or Verilog. Here is (one of the many possible) way(s) how you can do this in Verilog...
module MM74HC154(a, b, c, d, g1, g2, out);
input a, b, c, d, g1, g2;
output reg out;
integer i;
always @(a, b, c, d, g1, g2)
if (g1 || g2)
out = 16'bzzzzzzzzzzzzzzzz;
else
for (i = 0; i < 16; i = i + 1)
out = ({d, c, b, a} == i) ? 1'b0 : 1'b1;
endmodule
Have fun learing FPGA design.