mirror of
				https://github.com/openhwgroup/cvw
				synced 2025-02-11 06:05:49 +00:00 
			
		
		
		
	Fixed spacing
This commit is contained in:
		
							parent
							
								
									36108e4b52
								
							
						
					
					
						commit
						49823ccd45
					
				@ -28,11 +28,11 @@
 | 
			
		||||
////////////////////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
module fmalza #(WIDTH, NF) ( 
 | 
			
		||||
  input logic [WIDTH-1:0]             A,      // addend
 | 
			
		||||
  input logic [2*NF+1:0]             Pm,     // product
 | 
			
		||||
  input logic                         Cin,    // carry in
 | 
			
		||||
  input logic                         sub,    // subtraction
 | 
			
		||||
  output logic [$clog2(WIDTH+1)-1:0]  SCnt    // normalization shift count for the positive result
 | 
			
		||||
  input logic [WIDTH-1:0]             A,              // addend
 | 
			
		||||
  input logic [2*NF+1:0]              Pm,             // product
 | 
			
		||||
  input logic                         Cin,            // carry in
 | 
			
		||||
  input logic                         sub,            // subtraction
 | 
			
		||||
  output logic [$clog2(WIDTH+1)-1:0]  SCnt            // normalization shift count for the positive result
 | 
			
		||||
); 
 | 
			
		||||
 | 
			
		||||
  logic [WIDTH:0]                     F;              // most significant bit of F indicates leading digit
 | 
			
		||||
@ -40,19 +40,19 @@ module fmalza #(WIDTH, NF) (
 | 
			
		||||
  logic [WIDTH-1:0]                   P, G, K;        // propagate, generate, kill for each column
 | 
			
		||||
  logic [WIDTH-1:0]                   Pp1, Gm1, Km1;  // propagate shifted right by 1, generate/kill shifted left 1
 | 
			
		||||
 | 
			
		||||
  assign B = {{(NF+1){1'b0}}, Pm, 1'b0}; // Zero extend product
 | 
			
		||||
  assign B = {{(NF+1){1'b0}}, Pm, 1'b0};              // Zero extend product
 | 
			
		||||
 | 
			
		||||
  assign P = A^B;
 | 
			
		||||
  assign G = A&B;
 | 
			
		||||
  assign K= ~A&~B;
 | 
			
		||||
  assign K = ~A&~B;
 | 
			
		||||
 | 
			
		||||
  assign Pp1 = {sub, P[WIDTH-1:1]};   // shift P right by 1 (for P_i+1) , use subtract flag in most significant bit
 | 
			
		||||
  assign Gm1 = {G[WIDTH-2:0], Cin};   // shift G left by 1 (for G_i-1) and bring in Cin
 | 
			
		||||
  assign Km1 = {K[WIDTH-2:0], ~Cin};  // shift K left by 1 (for K_i-1) and bring in Cin
 | 
			
		||||
  assign Pp1 = {sub, P[WIDTH-1:1]};                   // shift P right by 1 (for P_i+1) , use subtract flag in most significant bit
 | 
			
		||||
  assign Gm1 = {G[WIDTH-2:0], Cin};                   // shift G left by 1 (for G_i-1) and bring in Cin
 | 
			
		||||
  assign Km1 = {K[WIDTH-2:0], ~Cin};                  // shift K left by 1 (for K_i-1) and bring in Cin
 | 
			
		||||
  
 | 
			
		||||
  // Apply function to determine Leading pattern
 | 
			
		||||
  //      - note: Schmookler01 uses the numbering system where 0 is the most significant bit
 | 
			
		||||
  assign F[WIDTH] = ~sub&P[WIDTH-1];
 | 
			
		||||
  assign F[WIDTH]     = ~sub&P[WIDTH-1];
 | 
			
		||||
  assign F[WIDTH-1:0] = (Pp1&(G&~Km1 | K&~Gm1)) | (~Pp1&(K&~Km1 | G&~Gm1));
 | 
			
		||||
 | 
			
		||||
  lzc #(WIDTH+1) lzc (.num(F), .ZeroCnt(SCnt));
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user