cordic算法vhdl实现

上传人:小** 文档编号:94145752 上传时间:2019-08-02 格式:DOC 页数:5 大小:53KB
返回 下载 相关 举报
cordic算法vhdl实现_第1页
第1页 / 共5页
cordic算法vhdl实现_第2页
第2页 / 共5页
cordic算法vhdl实现_第3页
第3页 / 共5页
cordic算法vhdl实现_第4页
第4页 / 共5页
cordic算法vhdl实现_第5页
第5页 / 共5页
亲,该文档总共5页,全部预览完了,如果喜欢就下载吧!
资源描述

《cordic算法vhdl实现》由会员分享,可在线阅读,更多相关《cordic算法vhdl实现(5页珍藏版)》请在金锄头文库上搜索。

1、LIBRARY ieee;USE ieee.std_logic_1164.all;USE ieee.std_logic_arith.all;USE ieee.STD_LOGIC_UNSIGNED.all;ENTITY cordicCOS_SIN ISPORT(clk :IN std_logic;deg_in :IN std_logic_vector (13 downto 0);cos :OUT std_logic_vector(15 downto 0);sin :OUT std_logic_vector(15 downto 0);END cordicCOS_SIN;architecture r

2、lt_cordicCOS_SIN of cordicCOS_SIN isconstant c1:std_logic_vector(13 downto 0):=CONV_STD_LOGIC_VECTOR(4096,14);constant c2:std_logic_vector(13 downto 0):=CONV_STD_LOGIC_VECTOR(2048,14);constant c3:std_logic_vector(13 downto 0):=CONV_STD_LOGIC_VECTOR(1209,14); -arctan(1/2)constant c4:std_logic_vector(

3、13 downto 0):=CONV_STD_LOGIC_VECTOR(639,14); -arctan(1/4)-constant x0:std_logic_vector(15 downto 0):=CONV_STD_LOGIC_VECTOR(19895,16);signal x0 :std_logic_vector(15 downto 0);signal y1,x1 :std_logic_vector(15 downto 0);signal y2,x2:std_logic_vector(15 downto 0);signal y3,x3:std_logic_vector(17 downto

4、 0);signal y4,x4:std_logic_vector(19 downto 0);signal p1,p2,p3,p4 :std_logic_vector(13 downto 0);beginx0 = conv_std_logic_vector(26980,16);-step 1-process(clk)begin if rising_edge(clk) then if deg_in(13) =1 then y1 = x0000 -x0;else y1 = x0;end if;end if;end process;process(clk)begin if rising_edge(c

5、lk) then x1 0); end if;end process;process(clk)begin if rising_edge(clk) then if deg_in(13) =1 then p1 = deg_in + c1;else p1 = deg_in - c1;end if;end if;end process;-step 2-process(clk)begin if rising_edge(clk) then if p1(13) =1 then y2 = y1 - x1;else y2 = y1 + x1;end if;end if;end process;process(c

6、lk)begin if rising_edge(clk) then if p1(13) =1 then x2 = x1 + y1;else x2 = x1 - y1;end if; end if;end process;process(clk)begin if rising_edge(clk) then if p1(13) =1 then p2 = p1 + c2;else p2 = p1 - c2;end if;end if;end process;-step 3-process(clk)begin if rising_edge(clk) then if p2(13) =1 then y3

7、= (y2(15) & y2 &0) -(x2(15) & x2(15) & x2);else y3 = (y2(15) & y2 &0) + (x2(15) & x2(15) & x2);end if;end if;end process;process(clk)begin if rising_edge(clk) then if p2(13) =1 then x3 = (x2(15) & x2 & 0) + (y2(15) & y2(15) & y2 );else x3 = (x2(15) & x2 & 0) - (y2(15) & y2(15) & y2 );end if; end if;

8、end process;process(clk)begin if rising_edge(clk) then if p2(13) =1 then p3 = p2 + c3;else p3 = p2 - c3;end if;end if;end process;-step 4-process(clk)begin if rising_edge(clk) then if p3(13) =1 then y4 = (y3 & 00) -(x3(17) & x3(17) & x3);else y4 = (y3 & 00) +(x3(17) & x3(17) & x3);end if;end if;end

9、process;process(clk)begin if rising_edge(clk) then if p3(13) =1 then x4 = (x3 & 00) + (y3(17) & y3(17) & y3 );else x4 = (x3 & 00) - (y3(17) & y3(17) & y3 );end if; end if;end process;process(clk)begin if rising_edge(clk) then if p3(13) =1 then p4 = p3 + c4;else p4 = p3 - c4;end if;end if;end process;cos=x4(19 downto 4);sin=y4(19 downto 4);end rlt_cordicCOS_SIN;

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 商业/管理/HR > 管理学资料

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号