1、endl; END return 0;把上述程序编译后,在DOS命令行下执行命令:sin.exe sin.mif;将生成的sin.mif 文件。sin.mif文件:DEPTH=256;ADDRESS_RADIX=HEX;DATA_RADIX=HEX;CONTENTBEGIN 0 : 7f; 1 : 82; 2 : 85; 3 : 88; 4 : 8b; 5 : 8f; 6 : 92; 7 : 95; 8 : 98; 9 : 9b; a : 9e; b : a1; c : a4; d : a7; e : aa; f : ad; 10 : b0; 11 : b3; 12 : b6; 13 : b8
2、; 14 : bb; 15 : be; 16 : c1; 17 : c3; 18 : c6; 19 : c8; 1a : cb; 1b : cd; 1c : d0; 1d : d2; 1e : d5; 1f : d7; 20 : d9; 21 : db; 22 : dd; 23 : e0; 24 : e2; 25 : e4; 26 : e5; 27 : e7; 28 : e9; 29 : eb; 2a : ec; 2b : ee; 2c : ef; 2d : f1; 2e : f2; 2f : f4; 30 : f5; 31 : f6; 32 : f7; 33 : f8; 34 : f9; 3
3、5 : fa; 36 : fb; 37 : 38 : fc; 39 : fd; 3a : 3b : fe; 3c : 3d : 3e : 3f : 40 : ff; 41 : 42 : 43 : 44 : 45 : 46 : 47 : 48 : 49 : 4a : 4b : 4c : 4d : 4e : 4f : 50 : 51 : 52 : 53 : 54 : 55 : 56 : 57 : 58 : 59 : 5a : 5b : 5c : 5d : 5e : 5f : 60 : 61 : 62 : 63 : 64 : 65 : 66 : 67 : 68 : 69 : 6a : 6b : 6c
4、 : 6d : 6e : 6f : 70 : 71 : 72 : 73 : 74 : 75 : 76 : 77 : 78 : 79 : 7a : 7b : 7c : 7d : 7e : 7f : 80 : 81 : 7c; 82 : 79; 83 : 76; 84 : 73; 85 : 6f; 86 : 6c; 87 : 69; 88 : 66; 89 : 63; 8a : 60; 8b : 5d; 8c : 5a; 8d : 57; 8e : 54; 8f : 51; 90 : 4e; 91 : 4b; 92 : 48; 93 : 46; 94 : 43; 95 : 40; 96 : 3d;
5、 97 : 3b; 98 : 38; 99 : 36; 9a : 33; 9b : 31; 9c : 2e; 9d : 2c; 9e : 29; 9f : 27; a0 : 25; a1 : 23; a2 : 21; a3 : 1e; a4 : 1c; a5 : 1a; a6 : 19; a7 : 17; a8 : 15; a9 : 13; aa : 12; ab : 10; ac : f; ad : d; ae : c; af : a; b0 : 9; b1 : 8; b2 : 7; b3 : 6; b4 : 5; b5 : 4; b6 : 3; b7 : b8 : 2; b9 : 1; b
6、a : bb : 0; bc : bd : be : bf : c0 : c1 : c2 : c3 : c4 : c5 : c6 : c7 : c8 : c9 : ca : cb : cc : cd : ce : cf : d0 : d1 : d2 : d3 : d4 : d5 : d6 : d7 : d8 : d9 : da : db : dc : dd : de : df : e0 : e1 : e2 : e3 : e4 : e5 : e6 : e7 : e8 : e9 : ea : eb : ec : ed : ee : ef : f0 : f1 : f2 : f3 : f4 : f5
7、: f6 : f7 : f8 : f9 : fa : fb : fc : fd : fe : ff :END3、存放波形数据ROM的设计。利用MegaWizard Plug-In manager定制正弦信号数据ROM宏功能块,并将以上的波形数据加载于此ROM中。设计步骤如下:打开MegaWizard Plug-In manager初始对话框。在Tools菜单中选择MegaWizard Plug-In manager产生一个对话框,选择Create a new custom.项,即定制一个新的模块。单击Next按钮后,在所产生的对话框的左栏选择Storage项下的LPM_ROM,再选择Cyclo
8、ne器件和VHDL语言方式;最后输入ROM文件存放的路径和文件名单击Next按钮。选择ROM控制线、地址线和数据线。在弹出的对话框中选择地址线位宽和ROM中数据数分别为8和256;选择地址锁存控制信号clock。选择指定路径上的文件sin.mif,最后单击Next按钮,再单击Finish 按钮后完成ROM定制,产生VHD代码文件。sin.vhd代码:- megafunction wizard: %LPM_ROM%- GENERATION: STANDARD- VERSION: WM1.0- MODULE: lpm_rom - =- File Name: sin.vhd- Megafunctio
9、n Name(s):- lpm_rom- *- THIS IS A WIZARD GENERATED FILE. DO NOT EDIT THIS FILE!- Copyright (C) 1988-2000 Altera Corporation- Any megafunction design, and related net list (encrypted or decrypted),- support information, device programming or simulation file, and any other- associated documentation or information provided by Altera or a partner- under Alteras Megafunction Partnership Program may be used only to- program PLD devices (but not masked PLD devices) from Altera. Any other- use of such megafunction design, net list, support informa
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1