data/full_repos/permissive/172912857/project_bin_bcd_7dig/bin_bcd_7dig.v
 line:194: before: "("
data/verilator_xmls/b300b048-3dde-488a-a93e-90374b50244d.xml
module bcd(number, thousands, hundreds, tens, ones);

   input  [12:0] number;
   output reg [3:0] thousands;
   output reg [3:0] hundreds;
   output reg [3:0] tens;
   output reg [3:0] ones;
   

   reg [28:0] shift;
   integer i;
   
   always @(number)
   begin

      shift[28:13] = 0;
      shift[12:0] = number;
      

      for (i=0; i<13; i=i+1) begin
         if (shift[16:13] >= 5)
            shift[16:13] = shift[16:13] + 3;
            
         if (shift[20:17] >= 5)
            shift[20:17] = shift[20:17] + 3;
            
         if (shift[24:21] >= 5)
            shift[24:21] = shift[24:21] + 3;
         
         if (shift[28:25] >= 5)
            shift[28:25] = shift[28:25] + 3;
         

         shift = shift << 1;
      end
      

      thousands = shift[28:25];
      hundreds = shift[24:21];
      tens     = shift[20:17];
      ones     = shift[16:13];
   end
 
endmodule
module bcd(number, thousands, hundreds, tens, ones);


   input  [12:0] number;
   output reg [3:0] thousands;
   output reg [3:0] hundreds;
   output reg [3:0] tens;
   output reg [3:0] ones;
   

   reg [28:0] shift;
   integer i;
   
   always @(number)
   begin

      shift[28:13] = 0;
      shift[12:0] = number;
      

      for (i=0; i<13; i=i+1) begin
         if (shift[16:13] >= 5)
            shift[16:13] = shift[16:13] + 3;
            
         if (shift[20:17] >= 5)
            shift[20:17] = shift[20:17] + 3;
            
         if (shift[24:21] >= 5)
            shift[24:21] = shift[24:21] + 3;
         
         if (shift[28:25] >= 5)
            shift[28:25] = shift[28:25] + 3;
         

         shift = shift << 1;
      end
      

      thousands = shift[28:25];
      hundreds = shift[24:21];
      tens     = shift[20:17];
      ones     = shift[16:13];
   end
 
endmodule