Advertisement
Guest User

Untitled

a guest
Nov 15th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module mux3 #(parameter WIDTH=8) (a, b, c, select, out);
  2.   // select | out
  3.   // 00 | a
  4.   // 01 | b
  5.   // 02 | c
  6.   input [1:0] select;
  7.   input[WIDTH-1:0] a,b,c;
  8.   output [WIDTH-1:0]out;
  9.   reg out;
  10.   always @(select or a or b or c)
  11.   if (select ==2'b00) out = a;
  12.   else if (select == 2'b01) out = b;
  13.   else if (select == 2'b10) out = c;
  14. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement