Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. `timescale 1ns / 1ps
  2. //////////////////////////////////////////////////////////////////////////////////
  3. // Company:
  4. // Engineer:
  5. //
  6. // Create Date: 11/21/2019 12:34:07 PM
  7. // Design Name:
  8. // Module Name: Main
  9. // Project Name:
  10. // Target Devices:
  11. // Tool Versions:
  12. // Description:
  13. //
  14. // Dependencies:
  15. //
  16. // Revision:
  17. // Revision 0.01 - File Created
  18. // Additional Comments:
  19. //
  20. //////////////////////////////////////////////////////////////////////////////////
  21.  
  22.  
  23. module Main(
  24. input clk,
  25. input wire[15:0] x1,x2,x3,x4,
  26. input wire[15:0] k1,k2,k3,k4,k5,k6,
  27. output reg[15:0] s0,s1,s2,s3
  28. );
  29.  
  30. reg [15:0] p1,p2,p3,p4,p5,p6,p7,p8,p9,p10;
  31. Inmultire m1(x1,k1,p1);
  32. Inmultire m4(x4,k4,p4);
  33. Inmultire m5(p5,k5,p7);
  34. Inmultire m9(p8,k6,p9);
  35. always @(*)
  36. begin
  37. p2 = x2+k2;
  38. p3 = x3+k3;
  39. p5 = p1 ^ p3;
  40. p6 = p2 ^ p4;
  41. p8 = p6+p7;
  42. p10=p7+p9;
  43.  
  44. s0= p1 ^ p9;
  45. s1= p3 ^ p9;
  46. s2= p2 ^ p10;
  47. s3= p4 ^ p10;
  48. end
  49. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement