⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mp3.txt

📁 基于PAL16BIT的基本程序,MP3的控制程序及音量调节程序.主要涉及GLITCH FREE DESIGN. 适合初学者.
💻 TXT
字号:
This is a simulate system for the mp3 player including main control system and volume control system.

For the main control system, it’s a state machine with 6 states, 2 control flags and 3 outputs. The 6 states are WAIT, PLAY, PREVIEWS SONG, NEXT SONG, STOP and TEMP for glitch free design. The first flag is play and it works when the mp3 player is waiting for orders. The other is FG which contains 2 bits and it works when the mp3 player is playing.

The other part is the volume control system. It’s an up down counter and it counts from 0 to 5 which stand for the output volume level. 


Program for main control state machine:
Name       Christian, Yin;
Partno     XXXXX;
Date       XX/XX/XX;
Revision   XX;
Designer   XXXXX;
Company    XXXXX;
Assembly   XXXXX;
Location   XXXXX;
Device     XXXXX;

/******************************************************************/
/*                                                                */
/*                                                                */
/*                                                                */
/******************************************************************/
/*  Allowable Target Device Types:                                */
/******************************************************************/

/**  Inputs  **/

Pin 5        = play      ;      /*                                */
Pin 6        = F         ;      /*                                */
Pin 7        = G         ;      /*                                */


/**  Outputs  **/

Pin 12       = out1      ;      /*                                */
Pin 13       = A         ;      /*                                */
Pin 14       = B         ;      /*                                */
Pin 15       = C         ;      /*                                */
Pin 16       = D         ;      /*                                */
Pin 17       = X         ;      /*                                */
Pin 18       = Y         ;      /*                                */


/** Declarations and Intermediate Variable Definitions **/






/**  Logic Equations  **/
SEQUENCE[A,B,C,D]{
present 'b'0010                                                     /*state-wait*/
         if play next 'b'0000 out X;default next 'b'0010;
present 'b'0000                                                     /*state-play*/
         if  F &  G next 'b'1000;
         if !F &  G next 'b'0100;
         if !F & !G next 'b'0001;
         default    next 'b'0000;
present 'b'0001 next 'b'0011 out Y;                                   /*state-stop*/
present 'b'0011 next 'b'0010;                                        /*state-temp*/
present 'b'0100 next 'b'0000;                                        /*state-previous song*/
present 'b'1000 next 'b'0000;                                        /*state-next song*/
present 'b'1111 next 'b'0010;
present 'b'1100 next 'b'0010;
present 'b'1101 next 'b'0010;
present 'b'1011 next 'b'0010;
present 'b'0111 next 'b'0010;
present 'b'0101 next 'b'0010;
present 'b'0110 next 'b'0010;
present 'b'1001 next 'b'0010;
present 'b'1010 next 'b'0010;
}
out1=X&!Y;


Program for the volume control state machine:
Name       XXXXX;
Partno     XXXXX;
Date       XX/XX/XX;
Revision   XX;
Designer   XXXXX;
Company    XXXXX;
Assembly   XXXXX;
Location   XXXXX;
Device     XXXXX;

/******************************************************************/
/*                                                                */
/*                                                                */
/*                                                                */
/******************************************************************/
/*  Allowable Target Device Types:                                */
/******************************************************************/

/**  Inputs  **/

Pin 5        = U      ;      /*                                */


/**  Outputs  **/

Pin 12       = A         ;      /*                                */
Pin 13       = B         ;      /*                                */
Pin 14       = C         ;      /*                                */
Pin 15       = E         ;      /*                                */
Pin 16       = F         ;      /*                                */
Pin 17       = G         ;      /*                                */


/** Declarations and Intermediate Variable Definitions **/






/**  Logic Equations  **/
SEQUENCE[A,B,C]{
present 'b'000                                                    /*state-wait*/
         if U next 'b'001;default next 'b'000;
present 'b'001                                                     /*state-play*/
         if U next 'b'011;default next 'b'000;
present 'b'011
         if U next 'b'111;default next 'b'001;
present 'b'111
         if U next 'b'110;default next 'b'011;
present 'b'110
         if U next 'b'100;default next 'b'111;
present 'b'100
         if U next 'b'100;default next 'b'110;
}
E=A&!C;
F=B&C;
G=(!B&C)#(A&C)#(A&!B);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -