Build a 2:1 mux structurally using only gate primitives.
Requirements
mux2_prima, b, selynot/and/or or equivalent). No assign, no always.Behavior
y = (sel ? b : a) Equivalent 4-state logic: y = (~sel & a) | (sel & b)
| n_input gates | n_output_gates | Three-state gates | Pull gates | MOS switches | Bidirectional switches |
|---|---|---|---|---|---|
| and | buf | bufif0 | pulldown | cmos | rtran |
| nand | not | bufif1 | pullup | nmos | rtranif0 |
| nor | notif0 | pmos | rtranif1 | ||
| or | notif1 | rcmos | tran | ||
| xnor | rnmos | tranif0 | |||
| xor | rpmos | tranif1 |
Basic combinational logic gates with n inputs (2 or more).
Single-input, multiple-output primitives.
Output can be 0, 1, or high-impedance (Z).
Provide weak constant logic values.
Model ideal MOS transistors (digital switch-level).
Transmission gates passing signals both ways.
π Rule of thumb for RTL design: