Advertisement
aridokmecian

Untitled

Nov 29th, 2018
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module allenMux(z, a, b, c, control);
  2. input [7:0]a, b, c;
  3. wire [7:0] op1, op2, op3, op3p2, op4;
  4. wire [7:0] z0, z1, z2, z3;
  5. wire [7:0] o0, o1, o2, o3;
  6. output[7:0] z;
  7. input [1:0] control;
  8. wire [1:0] controlI;
  9.  
  10. // operation 1
  11. or op1[7:0](op1, a, b, c);
  12. not op1Out[7:0](z0, op1);
  13. // operation 2
  14. and op2[7:0](op2, a, b, c);
  15. not op2Out[7:0](z1, op2);
  16. // operation 3
  17. not op3[7:0](op3, a);
  18. not op3p2[7:0](op3p2, c);
  19. xor op3Out[7:0](z2, op3, b, op3p2);
  20. // operation 4
  21. and op4[7:0](op4, a, b);
  22. xor op4Out[7:0](z3, op4, c);
  23.  
  24. not inverseControl[1:0](controlI, control);
  25.  
  26. and o0[7:0](o0, z0, controlI[1], controlI[0]);
  27. and o1[7:0](o1, z1, controlI[1], control[0]);
  28. and o2[7:0](o2, z2, control[1], controlI[0]);
  29. and o3[7:0](o3, z3, control[1], control[0]);
  30.  
  31. or name[7:0](z, o0, o1, o2, o3);
  32. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement