sp3ctrm5tr

8 to 3 Multiplexer using case

Mar 18th, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*============================
  2. 8 to 3 Multiplexer using case
  3. ============================*/
  4.  
  5. module mux8to1case (
  6.     input [7:0]I,
  7.     input [2:0]S,
  8.     output reg Y );
  9.    
  10.     always@(*)
  11.     begin
  12.     case(S)
  13.         0 : Y = I[0];
  14.         1 : Y = I[1];
  15.         2 : Y = I[2];
  16.         3 : Y = I[3];
  17.         4 : Y = I[4];
  18.         5 : Y = I[5];
  19.         6 : Y = I[6];
  20.         7 : Y = I[7];
  21.     endcase
  22.     end
  23. endmodule
Advertisement
Add Comment
Please, Sign In to add comment