data/full_repos/permissive/211316121/lab5_2/to_BCD.v
 line:14: before: "("
data/verilator_xmls/450c6e91-7e44-4a71-be62-cac6877ed836.xml
module to_BCD(
input [7:0] n,
output reg [9:0] b
    );
    reg [17:0] s;
    integer i;
    
    always@(*)
    begin
        for(i=0;i<17;i=i+1)
            s[i]=0;
        s[10:3]=n;
        
        repeat(5)
        begin
            if(s[11:8]>4)  s[11:8]=s[11:8]+3;
            if(s[15:12]>4)  s[11:8]=s[15:12]+3;           
            s[17:1]=s[16:0];
         end       
         b=s[17:8];
     end       
endmodule
module to_BCD(
input [7:0] n,
output reg [9:0] b
    );

    reg [17:0] s;
    integer i;
    
    always@(*)
    begin
        for(i=0;i<17;i=i+1)
            s[i]=0;
        s[10:3]=n;
        
        repeat(5)
        begin
            if(s[11:8]>4)  s[11:8]=s[11:8]+3;
            if(s[15:12]>4)  s[11:8]=s[15:12]+3;           
            s[17:1]=s[16:0];
         end       
         b=s[17:8];
     end       
endmodule