中文翻译成英文

中文翻译成英文,第1张

Abstract

1990's , the international have mounted the electron and the more advanced country of computer art , have been probing new electronic circuit design procedures actively , have carried out thorough transforming , have got the enormous success and in the field of design procedures , implement etc.The technology designs a field in the electron, programming logic component (if CPLD , the FPGA) application, already get broad popularizing , these components have brought extremely large flexibility to extremely large flexibility. These components can pass the software programming but the design carrying out the heavy structure , thereby feasible hardware's on whose hardware structure and mechanics can go to the lavatory like that like software design rapid. All these has changed the tradition digital system design procedures , has designed process and has designed concept tremendously, have boosted EDA technology promptness developing.

EDA is the abbreviation of electron design automation (Electronic Design Automation) , concept complying with computer-aid design (CAD) , computer-aid manufacturing (CAM) , computer-aid testing (CAT) and computer-aid project (CAE) in the beginning of 1990's develops but comes. The EDA technology is to take computer as implement , the designer goes ahead in EDA software platform , uses hardware describe that language HDL to be completed designing a document , accomplishes logic compiling voluntarily from the computer , melts letter , division , synthesis , optimization , layout , arrangement of wire and simulates and then, Until marrying to specially appointed target chip matches compiling , logic, mapping and programming time be loaded with etc. works. EDA technology turn up , extremely large have improved the wiring design efficiency and may * nature , the labour intensity having lightened a designer.

Circuit designing that QUARTUS| | developing platform in EDA makes use of VHDL language design numerical control frequency division implement on 6.0 originally time, the principle making use of numerical control frequency division designs that music hardware performs a circuit , LPM-ROM being custom-made stores and the music data , take that "Liang Zhu " and "moon represent my two heart " music as example , the music data memory has been reached right away to LPM-ROM, to realize music's coming pure hardware means perform effect. As long as revising music data stored by LPM-ROM, with the person if it were the music music data, makes LPM-ROM customarily other again again , link up to performance being able to realize other music right away in procedure.

Keywords: FPGA/CPLD , music hardware perform circuit , VHDL language design , QUARTUS| | 6.0

希望能帮到你~~

正好做了一个音乐程序,贡献出来给你吧,希望你能满意。

电路连接很简单,在P3.0端口接个蜂鸣器,不过效果一般。如果想效果好点,就加个放大电路,接个小功率喇叭就行。因为这里发电路不方便,所以如果需要放大电路,可加我QQ:7468485。

音乐程序的设计原理和程序如下:

设计原理

⑴ 总体原理:

乐曲中不同的音符,实质就是不同频率的声音。通过单片机产生不同的频率的脉冲信号,经过放大电路,由蜂鸣器放出,就产生了美妙和谐的乐曲册亮。

⑵ 单片机产生不同频率脉冲信号的原理:

1)要产生音频脉冲,只要算出某一音频的脉冲(1/频率),然后将此周期除以2,即为半周期的时间,利用定时器计时这个半周期的时间,每当计时到后就将输出脉冲的I/O反相,然后重复计时此半周期的时间再对I/O反相,就可以在I/O脚上得到此频率的脉冲。

2)利用8051的内部定时器使其工作在计数器模式MODE1下,改变计数值TH0及TL0以产生不同频率的方法如下:

例如,频率为523Hz,其周期天/523 S=1912uS,因此只要令计数器计时956uS/1us=956,在每计数956次时就将I/O反接,就可得到中音DO(532Hz)。

计数脉冲值与频率的关系公式如下:

N=Fi/2/Fr

(N:计数值,Fi:内部计时一次为1uS,故其频率为1MHz,Fr:要产生的频率 )

⑶ 其计数值的求法如下:

T=65536-N=65536-Fi/2/Fr

计算举例:

设K=65536,F=1000000=Fi=1MHz,求低音DO(261Hz)、中音DO(523Hz)、高音DO(1046Hz)的计数值。

T=65536-N=65536-Fi/2/Fr=65536-1000000/2/Fr=65536-500000/Fr

低音DO的T=65536-500000/262=63627

中音DO的T=65536-500000/523=64580

高音DO的T=65536-500000/1047=65059

⑷ C调个音符频率与计数值T的对照表如下表所示:

表9.1 C调各音符频率与计数值T的对照表

音符 频率(Hz) 简谱码T值 音符 频率(Hz) 简谱码T值

低1DO 262 63628 #4FA# 740 64860

#1DO# 277 63731 中5SO 784 64898

低2RE 294 63835 #5SO# 831 64923

#2RE# 311 63928 中6LA 880 64968

低3M 330 64103 #6 932 64994

低4FA 349 64103 中7SI 988 65030

#4FA# 370 64260 高1DO 1046 65058

低5SO 392 64260 #1DO# 1109 65085

#5SO# 415 64331 高2RE 1175 65110

低6LA 440 64400 #2RE# 1245 65124

#6 466 64463 高3M 1318 65157

低7SI 494 64524 高4FA 1397 65178

中1DO 523 64580 #4FA# 1480 65198

⑸ 每个音符使用1个字节,字节的高4位代表音符的高低,低4位代表音符的节拍,下表为节拍码的对照。但如果1拍为0.4秒,1/4拍是0.1秒,只要设运键定延迟时间就可求得节拍的时间。假设1/4节拍为1DELAY,则1拍应为4DELAY,以此类推。所以只要求得1/4拍的DELAY时间,其余的节拍就是它的倍数,如下表为1/4和1/8节拍的时间设定。

表9.2 节拍码对照表

1/4节拍 1/8节拍

节拍码 节拍数 节拍码 节拍数

1 1/4拍 1 1/8拍

2 2/4拍 2 1/4拍

3 3/4拍 3 3/8拍

4 1拍 4 1/2拍

5 1又1/4拍 5 5/8拍

6 1又1/2拍 6 3/4拍

7 1又3/4拍 7 7/8拍

8 2拍 8 1拍

9 2又1/4拍 9 1又1/8拍

A 2又1/2拍 A 1又1/4拍

B 2又3/4拍 B 1又3/8拍

C 3拍 C 1又1/2拍

D 3又1/4拍 D 1又5/州悄宽8拍

E 3又1/2拍 E 1又3/4拍

F 3又3/4拍 F 1又7/8拍

表9.3 各调节拍的时间设定表

1/4节拍 1/8节拍

曲调值 DELAY 曲调值 DELAY

调4/4 125毫秒 调4/4 62毫秒

调3/4 187毫秒 调3/4 94毫秒

调2/4 250毫秒 调2/4 125毫秒

⑹ 建立音乐的步骤:

1)先把吧乐谱的音符找出,然后由上表建立T值表的顺序。

2)把T值表建立在TABLE1,构成发音符的计数值放在“TABLE”。

3)简谱码(音符)为高位,节拍为(节拍数)为低4位,音符节拍码放在程序的“TABLE”处。

表9.4 简谱对应的简谱码、T值、节拍数

简谱 发音 简谱码 T值 节拍码 节拍数

5 低5SO 1 64260 1 1/4拍

6 低6LA 2 64400 2 2/4拍

7 低7SI 3 64524 3 3/4拍

1 中1DO 4 64580 4 1拍

2 中2RE 5 64684 5 1又1/4拍

3 中3M 6 64777 6 1又2/4拍

4 中4FA 7 64820 7 1又3/4拍

5 中5SO 8 64898 8 2拍

6 中6LA 9 64968 9 2又1/4拍

7 中7SI A 65030 A 2又2/4拍

1 高1DO B 65058 B 2又3/4拍

2 高2RE C 65110 C 3拍

3 高3M D 65157 D 3又1/4拍

4 高4FA E 65178 E 3又2/4拍

5 高5SO F 65217 F 3又3/4拍

不发音 0

1/4拍的延迟时间=187毫秒

DELAY:MOV R7,#2

D2: MOV R4,#187

D3: MOV R3,#248

DJNZ R3,$

DJNZ R4,D3

DJNZ R7,D2

RET

4.程序范例

ORG 0000H ;主程序起始地址

SJMP START ;跳至主程序

ORG 000BH ;TIMER0中断起 始地址

LJMP TIM0 ;跳至TIMER0中断子程序

START: MOV TMOD,#01H ;设T0在M1

MOV IE,#82H ;中断使能

START0:MOV 30H,#00 ;取简谱码指针

NEXT: MOV A,30H ;简谱码指针载入A

MOV DPTR,#TAB ;至TAB取简谱码

MOVC A,@A+DPTR ;

MOV R2,A;渠道的简谱码暂存于R2

JZ END0 ;是否渠道00(结束码)

ANL A,#0FH ;不是,则取低4位(节拍码)

MOV R5,A ;将节拍码存入R5

MOV A,R2 ;将取到的简谱码再载入A

SWAP A ;高低4位交换

ANL A,#0FH ;取低4位(音符码)

JNZ SING ;取到的音符码是否为0?

CLR TR0 ;开始,则不发音

SJMP D1 ;跳至D1

SING: DEC A ;取到的音符码减1(不含0)

MOV 22H,A ;存入(22H)

RL A ;乘2

MOV DPTR,#TAB1 ;至TABLE1取相对的高位字节计数值

MOVC A,@A+DPTR ;

MOV TH0,A ;取到的高位字节存入TH0

MOV 21H,A ;取到的高位字节存入(21H)

MOV A,22H ;在载入取到的音符码

RL A ;乘2

INC A ;加1

MOVC A,@A+DPTR ;至TABLE1取相对的低位字节计数值

MOV TL0,A ;取到的低位字节存入TL0

MOV 20H,A ;取到的低位字节存入(20H)

SETB TR0 ;启动TIMER0

D1: LCALL DELAY ;其本单位时间1/4拍187毫秒

INC 30H ;取简谱码指针加1

JMP NEXT ;取下一个简谱码

END0: CLR TR0 ;停止TIMER0

JMP START0 ;重复循环

TIM0: PUSH ACC ;将A的值暂存于堆栈

PUSH PSW ;将PSW的值暂存于堆栈

MOV TL0,20H ;重设计数值

MOV TH0,21H ;

CPL P3.0 ;将P3.0位反相,控制蜂鸣器发声

POPPSW ;至堆栈取回PSW的值

POP ACC ;至堆栈取回A的值

RETI

DELAY:MOV R7,#02

D2: MOV R4,#187

D3: MOV R3,#248

DJNZ R3,$

DJNZ R4,D3

DJNZ R7,D2

RET

TAB1:;决定节拍

DW 64260,64400,64521,64580

DW 64684,64777,64820,64898

DW 64968,65030,65058,65110

DW 65157,65178,65217

TAB: ;乐曲名称《梁祝》

DB 02H,82H,62H,52H,48H,02H,52H,32H,22H,18H

DB 83H,91H,72H,62H,51H,61H,71H,61H,83H,61H

DB 81H,51H,61H,71H,61H,51H,46H,82H,32H,52H

DB 22H,42H,16H,21H,41H,18H,0E4H,13H,21H,43H

DB 51H,21H,41H,12H,83H,81H,61H,81H,58H,53H

DB 61H,31H,22H,13H,21H,42H,52H,0E2H,42H,21H

DB 11H,91H,41H,18H,63H,81H,32H,52H,21H,41H,

DB 16H,0E4H,11H,21H,31H,51H,26H,11H,21H,43H

DB 51H,82H,62H,52H,61H,51H,42H,21H,11H,0E4H

DB 44H,21H,41H,21H,11H,0E1H,11H,21H,41H,18H

DB 61H,81H,51H,61H,51H,41H,32H,21H,41H,18H

DB 08H,0H,04H;曲子最后静音5拍长的时间

DB 00H ;乐曲结束

END


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12347564.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-24
下一篇 2023-05-24

发表评论

登录后才能评论

评论列表(0条)

保存