1
0
mirror of https://github.com/aolofsson/oh.git synced 2025-02-07 06:44:09 +08:00
oh/stdlib/rtl/oh_mx3.v
Andreas.Olofsson e631bfe3f1 Fixing naming error
-The directory should contain rtl only.
-HDL is too broad a term
2022-06-22 11:04:54 -04:00

23 lines
781 B
Verilog

//#############################################################################
//# Function: 3-Input Mux #
//# #
//# Copyright: OH Project Authors. ALl rights Reserved. #
//# License: MIT (see LICENSE file in OH repository) #
//#############################################################################
module oh_mx3 #(parameter DW = 1 ) // array width
(
input [DW-1:0] d0,
input [DW-1:0] d1,
input [DW-1:0] d2,
input [DW-1:0] s0,
input [DW-1:0] s1,
output [DW-1:0] z
);
assign z = (d0 & ~s0 & ~s1) |
(d1 & s0 & ~s1) |
(d2 & s1);
endmodule