Advertisement
Guest User

Untitled

a guest
Feb 7th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module carry_lookahead_adder
  2. (
  3.     input   logic[15:0]     A,
  4.     input   logic[15:0]     B,
  5.     output  logic[15:0]     Sum,
  6.     output  logic           CO
  7. );
  8.  
  9.     /* TODO
  10.      *
  11.      * Insert code here to implement a CLA adder.
  12.      * Your code should be completly combinational (don't use always_ff or always_latch).
  13.      * Feel free to create sub-modules or other files. */
  14.      
  15. endmodule
  16.  
  17.  
  18.  
  19.  
  20.  
  21. module four_bit_CLA
  22.  
  23.    
  24. endmodule
  25.  
  26. endmodule
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33. module full_CLA(
  34.  
  35.                         input x,
  36.                         input y,
  37.                         input cin,
  38.                         output logic s,
  39.                         output logic cout
  40.                     );
  41.  
  42. assign s = x ^ y ^ cin; // output S, same as FA output
  43.                        
  44. assign G = x & y; //generated carry-out
  45. assign P = x ^ y; //propogated carry-out
  46.  
  47.  
  48.  
  49.  
  50.                        
  51.                        
  52.                        
  53.  
  54. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement