xiasitai 发表于 2011-7-30 11:05:46

求教:如何用VHDL编程实现两个相位相差90度的方波啊

RT,如何用VHDL编程实现两个相位相差90度的方波啊,求达人指导。

liujilei311 发表于 2011-7-31 10:42:35

你是说两路脉冲进行正交吧,这个简单,在用modelsim仿真时对激励信号,可以人为设置其正交的。。。。。。。

xiasitai 发表于 2011-8-1 19:42:36

回复 2# liujilei311


    我要的是输出额,不是激励额

liujilei311 发表于 2011-8-3 08:08:15

我知道,这和激励信号的设置有关的。。。。。。。。

wenlimin 发表于 2011-8-12 22:44:15

不知这个能不能满足你的要求
library ieee;
use ieee.std_logic_1164.all;
entity counter20 is
        port (clk:in std_logic;
                        rst:in std_logic;
                        y1:out std_logic;
                        y2:out std_logic
                        );
end counter20;
architecture hav of counter20 is
        signal y1_temp:std_logic;
        signal y2_temp:std_logic;
begin
        y1<=y1_temp;
        y2<=y2_temp;
process(clk,rst)
       
       
        variable counter:integer range 0 to 1;
        begin
        if (rst='1') then
                y1_temp<='0';
                y2_temp<='0';
                counter:=0;
        else
                if (clk'event and clk='1')then
                        if (counter=0)then
                                y1_temp<=not y1_temp;
                                counter:=counter+1;
                       
                       
                        elsif counter=1 then
                                y2_temp<=not y2_temp;
                                counter:=0;
                        end if;
             end if;
        end if;
end process;
                       
end architecture;

liujilei311 发表于 2011-8-15 07:56:03

恩,学习一下!!!!!!!!!!!!

xiasitai 发表于 2011-10-10 22:39:37

回复 5# wenlimin


    我自己实现了,不过还是i非常感谢额
页: [1]
查看完整版本: 求教:如何用VHDL编程实现两个相位相差90度的方波啊