huan.vhd

来自「DDS-320-func: 在采用 320x240 屏的设计实验箱上运行」· VHDL 代码 · 共 29 行

VHD
29
字号
--对两个波形相乘的结果进行判断,进一步处理
            library IEEE;
            use IEEE.std_logic_1164.all;
            use ieee.std_logic_unsigned.all;

            entity huan is
            port (
            clk:in bit;
            A: in STD_LOGIC_vector(15 downto 0);
            aout: out STD_LOGIC_vector(7 downto 0)
            );
            end huan;

            architecture mmm of huan is
            begin
            process(clk)
            begin
            IF (clk'EVENT AND clk = '1') THEN
               if(A(15)='1') then --如果结果的最高位为1,则用128减去乘法所得的结果
               aout<="10000000"-A(13 downto 7);
               else --如果结果的最高位为0,则将乘法所得的结果加上127,这样判断并处理,就可以将以调制的波形的零点设置为127,就可以满足pac20对数据的要求
               aout<="01111111"+A(13 downto 7);
               end if;
            end if;
            end process;
            end mmm;


⌨️ 快捷键说明

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