集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 3710|回复: 9

VHDL 问题

[复制链接]
recoba7 发表于 2010-12-2 11:53:32 | 显示全部楼层 |阅读模式
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity counter_1024 is
        port(datain : in std_logic_vector(7 downto 0);
                        clk, clr, en, updn, bcdwr : in std_logic;
                        dataout : out std_logic_vector(7 downto 0) := "00000000";
                        c : out std_logic := '0');
end counter_1024;

architecture beh of counter_1024 is
begin
        process(clk, en)--, clr, bcdwr, updn)
                --variable data : std_logic_vector(8 downto 0) := "000000000";
        begin
                if (en = '1' ) then
                        c <= '1';
                        dataout(7 downto 0) <= "00000000";
                       
                --else c <='0';
                end if;
        end process;
end;       

可时序分析图中似乎不符合if语句,恳请请各位高手指教啊!谢谢

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?我要注册

x
dyeleven 发表于 2010-12-2 12:20:19 | 显示全部楼层
回复 1# recoba7


    你程序中没有标明en=0的情况,系统默认在输出加了一个锁存器

评分

1

查看全部评分

weibode01 发表于 2010-12-2 12:25:44 | 显示全部楼层
好深奥的VHDL,Verilog好学,呵
 楼主| recoba7 发表于 2010-12-2 15:37:57 | 显示全部楼层
难怪我加了个else语句后能恢复正常。追问下,我初始化c为0,可前面en=0的那一部分c怎么不为0啊?
 楼主| recoba7 发表于 2010-12-2 15:40:17 | 显示全部楼层
刚开始学这语言,先基本弄懂吧,呵呵
nonghero 发表于 2010-12-5 20:09:59 | 显示全部楼层
CLK都没用,怎么可能仿真正确。
 楼主| recoba7 发表于 2010-12-6 10:11:17 | 显示全部楼层
看清楚再说。。。
nonghero 发表于 2010-12-6 23:11:14 | 显示全部楼层
process(clk, en)--, clr, bcdwr, updn)
                --variable data : std_logic_vector(8 downto 0) := "000000000";
        begin
                if (en = '1' ) then
                        c <= '1';
                        dataout(7 downto 0) <= "00000000";
                       
                --else c <='0';
                end if;
        end process;

楼上的CLK在哪里用到了,请指明。CLK为什么会出现在敏感表中。你的程序太深奥了,难怪我看不懂。
yanxin85085 发表于 2010-12-13 23:25:55 | 显示全部楼层
clk没用到啊,还有,现在产生了锁存器,电平敏感。
zhangxiaoshen 发表于 2010-12-13 23:28:36 | 显示全部楼层
好深奥的VHDL,Verilog好学,呵
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

QQ|小黑屋|手机版|Archiver|集成电路技术分享 ( 京ICP备20003123号-1 )

GMT+8, 2024-6-14 23:56 , Processed in 0.072735 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表