小弟初涉FPGA,跪求大侠帮助!!

[复制链接]
1631|5
手机看帖
扫描二维码
随时随地手机跟帖
izefei|  楼主 | 2010-7-27 16:49 | 显示全部楼层 |阅读模式
FPGA, ck, ST, ic, COM
本帖最后由 izefei 于 2010-7-28 10:41 编辑

小弟想实现如下图所示电路结构(图在程序下方),就是:Clock时钟上升沿到来时,Output就翻转一次。我用了很多方法,可就是用modelsim仿真老是不对,如下是我的一个方法,请路过的大侠们给指点下,或者给小弟一个可行的程序,不胜感激!!!:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_unsigned.all;

entity com is------com实现的是图中com部分,即翻转功能
    port(
        Input,Clock:in std_logic;
        Output:  out std_logic
        );
end com;
architecture behav of com is
begin   
    process(Clock)
    begin
        if(Clock'event and Clock'last_value='0' and Clock='1')then
            Output<=not Input;
        end if;
    end process;
end architecture behav;



library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_unsigned.all;
entity comup is ---------------comup调用的com进行元件例化
    port(
        Clock:in std_logic;
        Output:  out std_logic
        );
end comup;
architecture behav of comup is
component com is
    port(
        Input,Clock:in std_logic;
        Output:  out std_logic
        );
end component;
signal temp:std_logic:='0';
begin
Output<=temp;
com1:com port map(temp,Clock,temp);
end architecture behav;
截图00.jpg

相关帖子

ar_dong| | 2010-7-28 09:24 | 显示全部楼层
Clock='1'不是边沿触发,达不到上升沿效果
回去好好看书

使用特权

评论回复
izefei|  楼主 | 2010-7-28 10:38 | 显示全部楼层
大侠,(Clock'event  and Clock'last_value='0' and Clock='1')和Clock='1'结果是一样的!麻烦大侠能不能给个这方面程序啊!谢啦b] 2# ar_dong

使用特权

评论回复
rockzone| | 2010-7-28 11:10 | 显示全部楼层
改成rising edge(Clock)

使用特权

评论回复
izefei|  楼主 | 2010-7-28 13:23 | 显示全部楼层
哪位大侠能给写一个正确的程序代码啊!拜托啦

使用特权

评论回复
欧阳青云| | 2010-8-1 14:36 | 显示全部楼层
别指望别人会帮你写程序,别人只能给你提供思路

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

0

主题

80

帖子

1

粉丝