data/full_repos/permissive/509335294/alu_control.v
data/verilator_xmls/bc30249e-0bdf-4995-899a-e6fc21d691c5.xml
module alu_control	(
								input[1:0]	aluopcode,
								input[3:0]	funct,
								input clk,	
								output reg [3:0] sel
								);
								
initial begin
	sel <= 4'b0;
end


always@(*)begin
	if(aluopcode == 2'b00)
		begin
			case(funct)
				4'b0000 : begin 
								sel <= 4'b0000; 

								end
								
				4'b0001 : begin 
								sel <= 4'b0001;  

								end
				
				4'b0010 : begin 
								sel <= 4'b0100;  

								end
				
				4'b0011 : begin 
								sel <= 4'b0101;  

								end
				
				4'b0100 : begin 
								sel = 4'b0110;  

								end
				
				4'b0101 : begin 
								sel <= 4'b0010;  

								end
				
				4'b0110 : begin 
								sel <= 4'b0011;  

								end
				
			endcase
		end
	else if(aluopcode == 2'b01)
					begin 
					sel <= 4'b1000;   

					end
			else if(aluopcode == 2'b10)
							begin 
							sel <= 4'b1001;  

							end
					else if(aluopcode == 2'b11)
									begin 
									sel <= 4'b1010;  

									end
							else begin 
										$display("debug: alu_control - no valid code received!");
										sel <= 4'b0000;
								end

end

endmodule
module alu_control	(
								input[1:0]	aluopcode,
								input[3:0]	funct,
								input clk,	
								output reg [3:0] sel
								);

								
initial begin
	sel <= 4'b0;
end


always@(*)begin
	if(aluopcode == 2'b00)
		begin
			case(funct)
				4'b0000 : begin 
								sel <= 4'b0000; 

								end
								
				4'b0001 : begin 
								sel <= 4'b0001;  

								end
				
				4'b0010 : begin 
								sel <= 4'b0100;  

								end
				
				4'b0011 : begin 
								sel <= 4'b0101;  

								end
				
				4'b0100 : begin 
								sel = 4'b0110;  

								end
				
				4'b0101 : begin 
								sel <= 4'b0010;  

								end
				
				4'b0110 : begin 
								sel <= 4'b0011;  

								end
				
			endcase
		end
	else if(aluopcode == 2'b01)
					begin 
					sel <= 4'b1000;   

					end
			else if(aluopcode == 2'b10)
							begin 
							sel <= 4'b1001;  

							end
					else if(aluopcode == 2'b11)
									begin 
									sel <= 4'b1010;  

									end
							else begin 
										$display("debug: alu_control - no valid code received!");
										sel <= 4'b0000;
								end

end

endmodule