8 to 1 multiplexer Verilog

2009-12-07 10:36 am
8 to 1 multiplexer Verilog

用assign語法來寫...

謝謝!

回答 (1)

2009-12-07 5:31 pm
✔ 最佳答案
你好,

給你參考, good luck !

module mux8_1 (out, sel, a, b, c, d, e, f, g, h);
output out;
input [2:0] sel;
input a, b, c, d, e, f, g, h;
assign out = (sel == 3'h0) ? a :
(sel == 3'h1) ? b :
(sel == 3'h2) ? c :
(sel == 3'h3) ? d :
(sel == 3'h4) ? e :
(sel == 3'h5) ? f :
(sel == 3'h6) ? g : h ;

endmodule
參考: Pegasus


收錄日期: 2021-04-23 23:04:17
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20091207000010KK00885

檢視 Wayback Machine 備份