版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、process(clk,clr,pre,c) begin if(clr=1) then q_tmp=0; elsif(pre=1) then q_tmp=1; elsif rising_edge(clk) then if(ce=1) then q_tmp=d; else q_tmp=q_tmp; end if; end if; end process;end rtl;输入输入输出输出RSCEJKCQ1XXXX001XXX1000XXX无变化无变化00100X无变化无变化00101000111翻转翻转001101 if(r=1) then q_tmp=0; elsif(s=1) then q_t
2、mp=1; elsif rising_edge(clk) then if(ce=0) then q_tmp=q_tmp; else if(j=0 and k=1) then q_tmp=0; elsif(j=1 and k=0) then q_tmp=1; elsif(j=1 and k=1) then q_tmp=not q_tmp; end if; end if; end process;end rtl;输入输出RSCQ00无变化01110011无变化process(clk) begin if rising_edge(clk)then if (s = 1 and r = 0) then q
3、_tmp=1; elsif (s=0 and r=1) then q_tmp=0; elsif (s=0 and r=0) then q_tmp=q_tmp; else null; end if; end if; end process; end rtl;architecture Behavioral of mod5cnt isbegin process(clk,clr) begin if(clr=1) then q=000; elsif(rising_edge(clk) then if(q=100) then q=000; else q=q + 1; end if; end if; end
4、process;end Behavioral;architecture Behavioral of clkdiv issignal q : std_logic_vector(24 downto 0);begin process(clr,clk) begin if(clr=1) then q0); elsif(rising_edge(clk) then q = q + 1; end if; end process; clk190 = q(17); -190Hz clk48 = q(19); -47.7Hzend Behavioral;architecture Behavioral of ring
5、_shiftreg4 isbegin process(clr,clk) begin if(clr=1) then q=0001; elsif(rising_edge(clk) then q(3) = q(0); q(2 downto 0) = q(3 downto 1); end if; end process;end Behavioral;architecture Behavioral of debounce4 issignal delay1,delay2,delay3 : std_logic_vector(3 downto 0);begin process(cclk,clr,inp) be
6、gin if(clr=1) then delay1=0000; delay2=0000; delay3=0000; elsif(rising_edge(cclk) then delay1=inp; delay2=delay1; delay3=delay2; end if; end process; outp=delay1 and delay2 and delay3; end Behavioral;architecture Behavioral of clock_pluse issignal delay1,delay2,delay3 : std_logic;begin process(clr,c
7、clk) begin if(clr=1) then delay1=0; delay2=0; delay3=0; elsif(rising_edge(cclk) then delay1=inp; delay2=delay1; delay3=delay2; end if; end process; outp=delay1 and delay2 and (not delay3);end Behavioral;%100周期占空占空比architecture Behavioral of pwm4 issignal count : STD_LOGIC_VECTOR (3 downto 0);signal
8、set,reset : std_logic;Beginset = not (count(0) or count(1) or count(2) or count(3); process(clk,clr) begin if(clr=1) then count=0000;elsif(rising_edge(clk) then if(count=period1-1) then count=0000; else count=count + 1; end if; end if; end process;process(clk)begin if(rising_edge(clk) then if(set=1)
9、 then pwm=1; end if; if(reset=1) then pwm=0; end if; end if;end process;end Behavioral;图4.16 ROM的结构图图4.17 单端口RAM的结构十进制数十进制数二进制码二进制码Gray码码Johnson码码One-hot吗吗000000000000110010010010102010011011100301101011110004100110510111161101017111100architecture Behavioral of seqdeta istype state is(s0,s1,s2,s3,s
10、4); -状态声明signal present_state,next_state : state; beginprocess(clr,clk)begin if(clr=1) then -状态寄存器 present_state=s0; elsif rising_edge(clk) then present_state=next_state; end if;end process;architecture Behavioral of seqdetb istype state is(s0,s1,s2,s3); -定义状态signal present_state,next_state : state; beginprocess(clr,clk) -状态寄存器begin if(clr=1) then present_state=s0; elsif rising_edge(clk) t
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 关于新员工入职培训具体日程确认函5篇
- 远离火灾隐患安全意识牢记心,小学主题班会课件
- 健身教练运动训练方案设计指导书
- 世界文化之旅:开阔视野增进理解小学主题班会课件
- 邮件营销内容创意优化报告确认函(6篇)
- 2026年采购订单变更请求通知函(3篇)范文
- 外贸公司未及时结汇导致外汇损失协商补偿函7篇范文
- 增强防范意识远离传染病侵扰小学健康教育主题班会
- 人力资源招聘流程优化与员工培训指导
- 紧急催办订单支付进度函(4篇)
- 2025 急诊科创伤性休克患者教育查房课件
- 中铁快运考试试题及答案
- 透析病人心律失常的护理
- 锅炉节能管理制度
- T/CIMA 0044-2023蓝藻密度在线监测仪
- 工业互联网平台雾计算协同机制在智能城市交通拥堵治理中的应用报告
- 管培生协议劳动合同
- 译林版(2024)七年级上册英语期中综合测试卷(二)
- 物流行业货物检查一日三检两报告制度
- DL∕T 2577-2022 轴流转浆式水轮发电机组检修规程
- JJG 1189.3-2022 测量用互感器 第3部分:电力电流互感器检定规程
评论
0/150
提交评论