data/full_repos/permissive/465671848/Project_files/Bin_bcd.v
1: b'%Warning-WIDTH: data/full_repos/permissive/465671848/Project_files/Bin_bcd.v:18: Operator ADD expects 4 bits on the RHS, but RHS\'s CONST \'2\'h3\' generates 2 bits.\n                                                                               : ... In instance Bin_BCD\n                 HUND = HUND + 2\'b11;\n                             ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/465671848/Project_files/Bin_bcd.v:20: Operator ADD expects 4 bits on the RHS, but RHS\'s CONST \'2\'h3\' generates 2 bits.\n                                                                               : ... In instance Bin_BCD\n                 TENS = TENS + 2\'b11 ;\n                             ^\n%Warning-WIDTH: data/full_repos/permissive/465671848/Project_files/Bin_bcd.v:22: Operator ADD expects 4 bits on the RHS, but RHS\'s CONST \'2\'h3\' generates 2 bits.\n                                                                               : ... In instance Bin_BCD\n                 ONES = ONES + 2\'b11 ;\n                             ^\n%Error: Exiting due to 3 warning(s)\n'
module Bin_BCD (
 input [7:0] bin_in ,
 output reg [`WIDTH-1:0] HUND , TENS , ONES 
);

integer i ;
always @ (bin_in)
  begin
   ONES = 4'b0000 ;
   TENS = 4'b0000;
   HUND = 4'b0000;
 
  for (i = 7; i>=0; i=i-1)
       begin
             if (HUND>=5)
                 HUND = HUND + 2'b11;
             if (TENS >=5)
                 TENS = TENS + 2'b11 ;
             if (ONES >=5)
                 ONES = ONES + 2'b11 ;
             
       HUND = HUND<<1;
       HUND[0] = TENS[3];
       TENS = TENS<<1 ;
       TENS[0] = ONES[3];
       ONES = ONES<<1 ;
       ONES[0] = bin_in[i] ;
  end
 end
endmodule
module Bin_BCD (
 input [7:0] bin_in ,
 output reg [`WIDTH-1:0] HUND , TENS , ONES 
);


integer i ;
always @ (bin_in)
  begin
   ONES = 4'b0000 ;
   TENS = 4'b0000;
   HUND = 4'b0000;
 
  for (i = 7; i>=0; i=i-1)
       begin
             if (HUND>=5)
                 HUND = HUND + 2'b11;
             if (TENS >=5)
                 TENS = TENS + 2'b11 ;
             if (ONES >=5)
                 ONES = ONES + 2'b11 ;
             
       HUND = HUND<<1;
       HUND[0] = TENS[3];
       TENS = TENS<<1 ;
       TENS[0] = ONES[3];
       ONES = ONES<<1 ;
       ONES[0] = bin_in[i] ;
  end
 end
endmodule