data/full_repos/permissive/172602559/FPGA_Lab_2-Arithmetic_Circuit/Arithmetic Circuit/ArithmeticCircuit.v
1: b'%Error: Cannot find file containing module: Circuit,data/full_repos/permissive/172602559\n        ... Looked in:\n             data/full_repos/permissive/172602559/FPGA_Lab_2-Arithmetic_Circuit/Arithmetic/Circuit,data/full_repos/permissive/172602559\n             data/full_repos/permissive/172602559/FPGA_Lab_2-Arithmetic_Circuit/Arithmetic/Circuit,data/full_repos/permissive/172602559.v\n             data/full_repos/permissive/172602559/FPGA_Lab_2-Arithmetic_Circuit/Arithmetic/Circuit,data/full_repos/permissive/172602559.sv\n             Circuit,data/full_repos/permissive/172602559\n             Circuit,data/full_repos/permissive/172602559.v\n             Circuit,data/full_repos/permissive/172602559.sv\n             obj_dir/Circuit,data/full_repos/permissive/172602559\n             obj_dir/Circuit,data/full_repos/permissive/172602559.v\n             obj_dir/Circuit,data/full_repos/permissive/172602559.sv\n%Error: Cannot find file containing module: data/full_repos/permissive/172602559/FPGA_Lab_2-Arithmetic_Circuit/Arithmetic\n%Error: Cannot find file containing module: Circuit/ArithmeticCircuit.v\n%Error: Exiting due to 3 error(s)\n'
module ArithmeticCircuit(A, B, S1, S2, Cin, Cout, F);
input [3:0] A, B;
input S1, S2, Cin;
output Cout;
output[3:0] F;

reg [3:0] F;
reg Cout;


always @(*)
begin
	if (S1 == 0 && S2 == 0 && Cin == 0)
		{Cout,F} = A + B;
	if (S1 == 0 && S2 == 1 && Cin == 0)
		{Cout, F} = A + ~B;
	if (S1 == 1 && S2 == 0 && Cin == 0)
		{Cout, F} = ~A + B;
	if (S1 == 1 && S2 == 1 && Cin == 0)
		{Cout, F} = ~B;
	
	
	if (S1 == 0 && S2 == 0 && Cin == 1)
		{Cout, F} = A + B + 1;
	if (S1 == 0 && S2 == 1 && Cin == 1)
		{Cout, F} = A + ~B + 1;
	if (S1 == 1 && S2 == 0 && Cin == 1)
		{Cout, F} = ~A + B + 1;
	if (S1 == 1 && S2 == 1 && Cin == 1)
		{Cout, F} = ~B + 1;
end
	
endmodule
module ArithmeticCircuit(A, B, S1, S2, Cin, Cout, F);

input [3:0] A, B;
input S1, S2, Cin;
output Cout;
output[3:0] F;

reg [3:0] F;
reg Cout;


always @(*)
begin
	if (S1 == 0 && S2 == 0 && Cin == 0)
		{Cout,F} = A + B;
	if (S1 == 0 && S2 == 1 && Cin == 0)
		{Cout, F} = A + ~B;
	if (S1 == 1 && S2 == 0 && Cin == 0)
		{Cout, F} = ~A + B;
	if (S1 == 1 && S2 == 1 && Cin == 0)
		{Cout, F} = ~B;
	
	
	if (S1 == 0 && S2 == 0 && Cin == 1)
		{Cout, F} = A + B + 1;
	if (S1 == 0 && S2 == 1 && Cin == 1)
		{Cout, F} = A + ~B + 1;
	if (S1 == 1 && S2 == 0 && Cin == 1)
		{Cout, F} = ~A + B + 1;
	if (S1 == 1 && S2 == 1 && Cin == 1)
		{Cout, F} = ~B + 1;
end
	
endmodule