// -------------------------------------------------------------
// 
// File Name: hdl_prj\hdlsrc\controllerPeripheralHdlAdi\controllerHdl\controllerHdl_Wrap_2pi_Once.v
// Created: 2014-09-08 14:12:04
// 
// Generated by MATLAB 8.2 and HDL Coder 3.3
// 
// -------------------------------------------------------------


// -------------------------------------------------------------
// 
// Module: controllerHdl_Wrap_2pi_Once
// Source Path: controllerHdl/Field_Oriented_Control/Open_Loop_Control/Generate_Position_And_Voltage_Ramp/Electrical_Velocity_To_Position/Wrap_2pi_Once
// Hierarchy Level: 6
// 
// -------------------------------------------------------------

`timescale 1 ns / 1 ns

module controllerHdl_Wrap_2pi_Once
          (
           x,
           wrap
          );


  input   signed [31:0] x;  // sfix32_En27
  output  signed [31:0] wrap;  // sfix32_En27


  wire signed [31:0] Two_Pi1_out1;  // sfix32_En27
  wire Relational_Operator_relop1;
  wire signed [31:0] Two_Pi3_out1;  // sfix32_En27
  wire Relational_Operator1_relop1;
  wire signed [31:0] Two_Pi2_out1;  // sfix32_En27
  wire signed [31:0] Add2_out1;  // sfix32_En27
  wire signed [31:0] Switch1_out1;  // sfix32_En27
  wire signed [31:0] Two_Pi_out1;  // sfix32_En27
  wire signed [31:0] Add1_out1;  // sfix32_En27
  wire signed [31:0] Switch_out1;  // sfix32_En27

  // Wrap 2pi Once


  // <S25>/Two Pi1
  assign Two_Pi1_out1 = 32'sb00110010010000111111011010101001;



  // <S25>/Relational Operator
  assign Relational_Operator_relop1 = (x >= Two_Pi1_out1 ? 1'b1 :
              1'b0);



  // <S25>/Two Pi3
  assign Two_Pi3_out1 = 32'sb00000000000000000000000000000000;



  // <S25>/Relational Operator1
  assign Relational_Operator1_relop1 = (x < Two_Pi3_out1 ? 1'b1 :
              1'b0);



  // <S25>/Two Pi2
  assign Two_Pi2_out1 = 32'sb00110010010000111111011010101001;



  // <S25>/Add2
  assign Add2_out1 = x + Two_Pi2_out1;



  // <S25>/Switch1
  assign Switch1_out1 = (Relational_Operator1_relop1 == 1'b0 ? x :
              Add2_out1);



  // <S25>/Two Pi
  assign Two_Pi_out1 = 32'sb00110010010000111111011010101001;



  // <S25>/Add1
  // 
  // <S25>/Position_Hi_Data_Type
  assign Add1_out1 = x - Two_Pi_out1;



  // <S25>/Switch
  assign Switch_out1 = (Relational_Operator_relop1 == 1'b0 ? Switch1_out1 :
              Add1_out1);



  assign wrap = Switch_out1;

endmodule  // controllerHdl_Wrap_2pi_Once

