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


// -------------------------------------------------------------
// 
// Module: controllerHdl_Inverse_Park_Transform
// Source Path: controllerHdl/Field_Oriented_Control/Open_Loop_Control/Transform_dq_to_ABC/Inverse_Park_Transform
// Hierarchy Level: 5
// 
// -------------------------------------------------------------

`timescale 1 ns / 1 ns

module controllerHdl_Inverse_Park_Transform
          (
           direct_voltage,
           quadrature_voltage,
           sin_coefficient,
           cos_coefficient,
           alpha_voltage,
           beta_voltage
          );


  input   signed [17:0] direct_voltage;  // sfix18_En12
  input   signed [17:0] quadrature_voltage;  // sfix18_En12
  input   signed [17:0] sin_coefficient;  // sfix18_En16
  input   signed [17:0] cos_coefficient;  // sfix18_En16
  output  signed [17:0] alpha_voltage;  // sfix18_En10
  output  signed [17:0] beta_voltage;  // sfix18_En10


  wire signed [35:0] Product2_out1;  // sfix36_En28
  wire signed [35:0] Product3_out1;  // sfix36_En28
  wire signed [35:0] alpha_voltage_1;  // sfix36_En28
  wire signed [17:0] Convert_Data_Type_out1;  // sfix18_En10
  wire signed [35:0] Product_out1;  // sfix36_En28
  wire signed [35:0] Product1_out1;  // sfix36_En28
  wire signed [35:0] beta_voltage_1;  // sfix36_En28
  wire signed [17:0] Convert_Data_Type1_out1;  // sfix18_En10

  // Inverse Park Transform
  // 
  // Converts orthogonal rotating reference frame (dq) to two-phase orthogonal stationary reference frame (alpha, beta)


  // <S40>/Product2
  assign Product2_out1 = direct_voltage * cos_coefficient;



  // <S40>/Product3
  assign Product3_out1 = quadrature_voltage * sin_coefficient;



  // <S40>/Add1
  assign alpha_voltage_1 = Product2_out1 - Product3_out1;



  // <S40>/Convert_Data_Type
  controllerHdl_Convert_Data_Type_block2   u_Convert_Data_Type   (.In1(alpha_voltage_1),  // sfix36_En28
                                                                  .Out1(Convert_Data_Type_out1)  // sfix18_En10
                                                                  );

  assign alpha_voltage = Convert_Data_Type_out1;

  // <S40>/Product
  assign Product_out1 = direct_voltage * sin_coefficient;



  // <S40>/Product1
  assign Product1_out1 = quadrature_voltage * cos_coefficient;



  // <S40>/Add
  assign beta_voltage_1 = Product_out1 + Product1_out1;



  // <S40>/Convert_Data_Type1
  controllerHdl_Convert_Data_Type1   u_Convert_Data_Type1   (.In1(beta_voltage_1),  // sfix36_En28
                                                             .Out1(Convert_Data_Type1_out1)  // sfix18_En10
                                                             );

  assign beta_voltage = Convert_Data_Type1_out1;

endmodule  // controllerHdl_Inverse_Park_Transform

