module encode #(
	parameter REVERSE = 0
) (
	input [4:0] inputValue,
	input [4:0] rotor,
	output [4:0] outputValue,
	input [2:0] rotor_type,
	input [4:0] ring_position
);
	wire [4:0] calculated_input;
	wire [4:0] outval;
	
	calculate_val #(.INPUT(1)) cinput(.value(inputValue),.rotor(rotor),.out(calculated_input),.ring_position(ring_position));
	
	rotorEncode #(.REVERSE(REVERSE)) rotEncode(.code(calculated_input),.val(outval),.rotor_type(rotor_type));
	
	calculate_val #(.INPUT(0)) coutput(.value(outval),.rotor(rotor),.out(outputValue),.ring_position(ring_position));
endmodule