Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chisel function for mux with more than two inputs

What single function can I use in chisel to represent a multiplexer with more than two inputs (choices)?

MuxLookup()?

like image 616
user15497032 Avatar asked Jul 13 '26 15:07

user15497032


1 Answers

You can cascade 2-input Muxes, describe the behavior through a hierarchy of when/elsewhen/otherwise statements, or use MuxCase to describe an n-way Mux

result := MuxCase(defaultValue, Array(sel0 -> value0, sel1 -> value1, ...))

MuxLookup implies comparators (in addition to the multiplexers) to match the value of a signal to a number of values.

A good description of different chisel Mux constructs is available here: https://www.chisel-lang.org/chisel3/docs/explanations/muxes-and-input-selection.html

like image 107
ɹɐʎɯɐʞ Avatar answered Jul 21 '26 02:07

ɹɐʎɯɐʞ



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!