欢迎来到天天文库
浏览记录
ID:57053901
大小:69.50 KB
页数:2页
时间:2020-07-31
《VHDL 3位6进制加法计数器.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、VHDL3位6进制加法计数器(异步清零,同步预置,时钟上升沿触发)的实现。LIBRARYieee;useieee.std_logic_1164.all;useieee.std_logic_arith.all;useieee.std_logic_unsigned.all;--*------------------实体描述--------------------------*--ENTITYsub_counterISPORT(clk:instd_logic;--输入时钟信号;clr:instd_logic;--异步清零,低电平有效;preset:instd_logic;-
2、-同步置位,低电平有效;D:instd_logic_vector(2downto0);--3位的输入;Q:outstd_logic_vector(2downto0);--3位输出;Carry:outstd_logic);--进位输出;Endsub_counter;--*-------------------END-----------------------------*----*---------------结构体描述---------------------------*--ARCHITECTUREarchOFsub_counterISsignali_cnt:st
3、d_logic_vector(2downto0);--用于暂时存储输出的信号beginP1:process(clk,clr)beginifclr='0'theni_cnt<="000";Carry<='0';elsifclk'eventandclk='1'thenifpreset='0'theni_cnt<=D;elsifpreset='1'theni_cnt<=i_cnt+1;ifi_cnt="110"thenCarry<='1';i_cut<="000";elseCarry<='0';endif;endif;endif;endprocessP1;P2:proces
4、s(i_cnt)beginQ<=i_cnt;endprocessP2;endarch;
此文档下载收益归作者所有