Advertisement
AlexanderAntonov

Untitled

Nov 2nd, 2022
840
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module mux_builtin (
  2.     input [1:0] sel_bi
  3.     , input [3:0] data_bi
  4.     , output q_o
  5. );
  6.  
  7. logic [1:0] sel_not;
  8. not (sel_not[0], sel_bi[0]);
  9. not (sel_not[1], sel_bi[1]);
  10.  
  11. logic sel00, sel01, sel10, sel11;
  12. and (sel00, sel_not[0], sel_not[1]);
  13. and (sel01, sel_bi [0], sel_not[1]);
  14. and (sel10, sel_not[0], sel_bi [1]);
  15. and (sel11, sel_bi [0], sel_bi [1]);
  16.  
  17. logic [3:0] data_gated;
  18. and (data_gated[0], data_bi[0], sel00);
  19. and (data_gated[1], data_bi[1], sel01);
  20. and (data_gated[2], data_bi[2], sel10);
  21. and (data_gated[3], data_bi[3], sel11);
  22.  
  23. logic or_inter0, or_inter1;
  24. or (or_inter0, data_gated[0], data_gated[1]);
  25. or (or_inter1, data_gated[2], data_gated[3]);
  26. or (q_o,       or_inter0,     or_inter1);
  27.  
  28. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement