data/full_repos/permissive/435914753/Display_kbd/scan2display.v
1: b'%Warning-MULTITOP: data/full_repos/permissive/435914753/Display_kbd/scan2display.v:19: Multiple top level modules\n                                                                                     : ... Suggest see manual; fix the duplicates, or use --top-module to select top.\n                   ... Use "/* verilator lint_off MULTITOP */" and lint_on around source to disable this message.\n                                                                                     : ... Top module \'scan_2_7seg\'\nmodule scan_2_7seg (scan, ss);\n       ^~~~~~~~~~~\n                                                                                     : ... Top module \'scan_2_bin\'\nmodule scan_2_bin(ss, bin);\n       ^~~~~~~~~~\n                                                                                     : ... Top module \'bin2bcd\'\nmodule bin2bcd(bin, bcd);\n       ^~~~~~~\n                                                                                     : ... Top module \'bcd_2_7seg\'\nmodule bcd_2_7seg (bcd, display);\n       ^~~~~~~~~~\n%Error: Exiting due to 1 warning(s)\n'
module bin2bcd(bin, bcd);
input  [7:0] bin;
output [11:0] bcd;
reg [11:0] bcd;
reg [3:0] i;

always@(bin)
	begin 
		bcd=0;
		for(i=0; i<8; i=i+1)
		begin 
			bcd = {bcd[10:0],bin[7-i]};
			
			if(i<7 && bcd[3:0]>4)
				bcd[3:0] = bcd[3:0] +3;
			if(i<7 && bcd[7:4]>4)
				bcd[7:4] = bcd[7:4] +3;	
			if(i<7 && bcd[11:8]>4)
				bcd[11:8] = bcd[11:8] +3;
		end
		
	end
	

endmodule
module bin2bcd(bin, bcd);

input  [7:0] bin;
output [11:0] bcd;
reg [11:0] bcd;
reg [3:0] i;

always@(bin)
	begin 
		bcd=0;
		for(i=0; i<8; i=i+1)
		begin 
			bcd = {bcd[10:0],bin[7-i]};
			
			if(i<7 && bcd[3:0]>4)
				bcd[3:0] = bcd[3:0] +3;
			if(i<7 && bcd[7:4]>4)
				bcd[7:4] = bcd[7:4] +3;	
			if(i<7 && bcd[11:8]>4)
				bcd[11:8] = bcd[11:8] +3;
		end
		
	end
	

endmodule