Advertisement
Guest User

Untitled

a guest
Oct 11th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module half_sublimer(a, b, y, s);
  2.     input logic a, b;
  3.     output logic y, s;
  4.     assign y = a^b;
  5.     assign s = ~a&b;
  6. endmodule
  7.  
  8. module full_sublimer(a, b, sin, y, sout);
  9.     input logic a, b, sin;
  10.     output logic y, sout;
  11.     logic temp[0:2];
  12.     half_sublimer first(a, b, temp[0], temp[1]);
  13.     half_sublimer second(temp[0], sin, y, temp[2]);
  14.     assign sout = temp[1]|temp[2];
  15. endmodule
  16.  
  17. module full_sublimer_8(a, b, sin, y, sout);
  18.     input logic [7:0] a, b;
  19.     input logic sin;
  20.     output logic [7:0] y;
  21.     output logic sout;
  22.     logic temp[0:6];
  23.     full_sublimer a1(a[0], b[0], sin, y[0], temp[0]);
  24.     full_sublimer a2(a[1], b[1], temp[0], y[1], temp[1]);
  25.     full_sublimer a3(a[2], b[2], temp[1], y[2], temp[2]);
  26.     full_sublimer a4(a[3], b[3], temp[2], y[3], temp[3]);
  27.     full_sublimer a5(a[4], b[4], temp[3], y[4], temp[4]);
  28.     full_sublimer a6(a[5], b[5], temp[4], y[5], temp[5]);
  29.     full_sublimer a7(a[6], b[6], temp[5], y[6], temp[6]);
  30.     full_sublimer a8(a[7], b[7], temp[6], y[7], sout);
  31. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement