//--------------------------------------------------------------------------------------------------
//
// Title       : PWMtranslator
// Design      : U4
// Author      : mbari###
// Company     : MBARI
//
//-------------------------------------------------------------------------------------------------
//
// File        : c:\projects\genosensor\2g\cplds\core\u4\src\PWMtranslator.v
// Generated   : Fri Dec 19 18:07:00 2003
// From        : interface description file
// By          : Itf2Vhdl ver. 1.20
//
//-------------------------------------------------------------------------------------------------
//
// Description : 
//
//-------------------------------------------------------------------------------------------------
`timescale 1ps / 1ps

//{{ Section below this comment is automatically maintained
//   and may be overwritten
//{module {PWMtranslator}}
module PWMtranslator ( RLS ,PWM ,FLS ,fBRK ,Brake ,HBRK ,PAH ,PBH ,MTRpwr ,PAL ,PBL ,DIR );

input RLS ;
wire RLS ;
input PWM ;
wire PWM ;
input FLS ;
wire FLS ;
input fBRK ;
wire fBRK ;
input Brake ;
wire Brake ;
input HBRK ;
wire HBRK ;
input MTRpwr ;
wire MTRpwr ;
input DIR ;
wire DIR ;

output PAH ;
wire PAH ;
output PBH ;
wire PBH ;
output PAL ;
wire PAL ;
output PBL ;
wire PBL ;

//}} End of automatically maintained section

// -- Enter your statements here -- //



wire BRK;

assign BRK = (fBRK | Brake | HBRK);

//PH(fBRK,Brake,DIR,PWM,PAH);	 
//PL(fBRK,Brake,DIR,PWM,PAL);	 
//PH(fBRK,Brake,!DIR,PWM,PBH);	 
//PH(fBRK,Brake,!DIR,PWM,PBL);	 

//on the low driver PAL and PBL these lines are transistor on when low.  The anding of the signal with
//MTRpwr will casue the low lines to be turned on.  This is OK because power is failing and will
//casue the motor to be locked while power fails.  This also means that we are not applying
//a voltage to a device which has power removed.  This will save on leakage current.
//FLS and RLS have been added initial to stop the motor from the ability to begin driven initial when 
//corresponding direciton is being asserted.  This will turn the topside driver off.

assign PAH = (PWM & !DIR & !BRK & RLS) & MTRpwr;
assign PAL = ((!PWM & DIR & !BRK) | (PWM & !DIR & !BRK)) & MTRpwr;
assign PBH = (PWM & DIR & !BRK & FLS) & MTRpwr;
assign PBL = ((!PWM & !DIR & !BRK) | (PWM & DIR & !BRK)) & MTRpwr;

endmodule

