add_phase.vhd

来自「基于VHDL+FPGA的DDS信号发生设计」· VHDL 代码 · 共 26 行

VHD
26
字号
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity add_phase is 
port(
clk:in std_logic;
fc:in std_logic_vector(15 downto 0);
adderss:out std_logic_vector(15 downto 0)
);end add_phase;
architecture add_phase of add_phase is
signal phase: std_logic_vector (15 downto 0);
 begin
 process(clk)
begin
    if clk'event and clk='1'then
if phase<="1111111111111111"then
   phase<=phase+fc; 
else 
 phase<="0000000000000000";
end if;
adderss<=phase;--out 16 bit adderss 
end if;
end process;
end add_phase;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?