neural.sv 928 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. `include "comp.sv"
  2. `include "sigmoid.sv"
  3. `include "neuron.sv"
  4. `include "layer.sv"
  5. module neural_adder(clk, rst, x0, x1, y);
  6. input clk, rst;
  7. input [31:0] x0, x1;
  8. output [31:0] y;
  9. floating_add#(.N(32), .M(8)) add0(
  10. .input_1(x0),
  11. .input_2(x1),
  12. .sum(y),
  13. .diff(),
  14. .clk(clk),
  15. .reset(rst)
  16. );
  17. endmodule : neural_adder
  18. module neural_mult(clk, rst, x0, x1, y);
  19. input clk, rst;
  20. input [31:0] x0, x1;
  21. output [31:0] y;
  22. floating_product#(.N(32), .M(8)) mul0(
  23. .input_1(x0),
  24. .input_2(x1),
  25. .product(y),
  26. .clk(clk),
  27. .reset(rst)
  28. );
  29. endmodule : neural_mult
  30. module neural_comp_gt(x0, x1, y);
  31. input [31:0] x0, x1;
  32. output y;
  33. fpu32_gt gt0(x0, x1, y0);
  34. endmodule : neural_comp_gt
  35. module neural_comp_lt(x0, x1, y);
  36. input [31:0] x0, x1;
  37. output y;
  38. fpu32_lt lt0(x0, x1, y0);
  39. endmodule : neural_comp_lt