- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
经典VHDL程序
经典VHDL程序
波形发生器
Library IEEE ;
use IEEE.std_logic_1164.all ;
use IEEE.std_logic_arith.all ;
package waveform_pkg is
constant rom_width : integer := 6 ;
subtype rom_word is std_logic_vector ( 1 to rom_width) ;
subtype rom_range is integer range 0 to 12 ;
type rom_table is array ( 0 to 12) of rom_word ;
constant rom_data : rom_table := rom_table(
111010 ,
101000 ,
011000 ,
001000 ,
011010 ,
010011 ,
101110 ,
110100 ,
001010 ,
001000 ,
010110 ,
010101 ,
001111 ) ;
subtype data_word is integer range 0 to 100 ;
subtype data_range is integer range 0 to 12 ;
type data_table is array (0 to 12) of data_word ;
constant data : data_table := data_table(1,40,9,2,2,4,1,15,5,1,1,3,1) ;
end waveform_pkg ;
LIBRARY IEEE ;
USE IEEE.std_logic_1164.ALL ;
USE IEEE.std_logic_arith.ALL ;
USE work.waveform_pkg.all ;
entity smart_waveform is
port (
clock : in std_logic ;
reset : in boolean ;
waves : out rom_word
) ;
end ;
architecture rtl of smart_waveform is
signal step,next_step : rom_range ;
signal delay : data_word ;
begin
next_step = rom_rangehigh when step = rom_rangehigh else step + 1 ;
time_step : process
begin
wait until clockevent and clock = 1 and clocklast_value = 0;
if (reset) then
step = 0 ;
elsif (delay = 1) then
step = next_step ;
else
null ;
end if ;
end process ;
delay_step : process
begin
wait until clockevent and clock = 1 ;
if (reset) then
delay = data(0) ;
elsif (delay = 1) then
delay = data(next_step) ;
else
delay = de
您可能关注的文档
最近下载
- 2025年高考历史二轮复习配套讲义 训练8 选择题之巧用逻辑关系,秒选正确“选项”.docx VIP
- 地震勘探原理——解释理论基础精品课件.ppt VIP
- 唐诗三百首完整版本.docx VIP
- 烈火之剑攻略(图文完美攻略).pdf VIP
- 2025风湿免疫病患者结核病诊治及预防实践指南 .pdf VIP
- 仪表工作年终总结6篇.docx VIP
- 《香港特色小吃简介大全.docx VIP
- 新解读《GB_T 40362 - 2021电动牙刷 一般要求和检测方法》最新解读.pptx VIP
- 群文阅读《荷花淀》《小二黑结婚(节选)》《党费》优秀课件课件.pptx VIP
- 2025年信息系统安全专家内存取证在云环境中的应用专题试卷及解析.pdf VIP
原创力文档


文档评论(0)