找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 1666|回复: 0
收起左侧

FFT变换的IP核的vhdl源代码

[复制链接]
ID:704585 发表于 2021-1-15 14:01 | 显示全部楼层 |阅读模式
51hei.png
  1. library ieee ;
  2. use ieee.std_logic_1164.all ;
  3. use ieee.std_logic_arith.all ;
  4. use work.butter_lib.all ;

  5. entity control_main is
  6. port (
  7.        a_small , sign_a , sign_b : in std_logic ;
  8.        sign_out , add_sub , reset_all : out std_logic ;
  9.        en_sub , en_swap , en_shift , addpulse , normalise : out std_logic ;
  10.        fin_sub , fin_swap , finish_shift , add_finish , end_all : in std_logic ;
  11.        clock_main , clock , reset , enbl , zero_num , change: in std_logic ) ;
  12. end control_main ;

  13. architecture rtl of control_main is
  14. signal current_state , next_state : state ;
  15. begin
  16. process (current_state , add_finish , finish_shift , end_all , enbl , clock_main , fin_sub , fin_swap , zero_num , change)
  17. begin

  18. case current_state is
  19. when reset1 =>
  20.   if( enbl = '1' and clock_main = '1') then
  21.   normalise <= '0' ;
  22.   addpulse <= '0' ;
  23.   reset_all <= '1' ;
  24.   next_state <= reset2 ;
  25.   elsif ( enbl = '0') then
  26.   next_state <= reset7 ;-- last state to exit
  27.   else
  28.   next_state <= reset1 ;
  29.   end if ;

  30. when reset2 =>
  31.   reset_all <= '0' ; -- else values willnot cchange
  32.   en_sub <= '1' ;
  33.   en_swap <= '1' ;
  34.   next_state <= reset3 ;

  35. when reset3 =>
  36.   if (zero_num = '1') then
  37.   next_state <= reset5 ;
  38.   en_sub <= '0' ;
  39.   en_swap <= '0' ;
  40.   elsif(fin_sub= '1') then
  41.   if(fin_swap = '1') then
  42.   en_shift <= '1' ;
  43.   en_sub <= '0' ;
  44.   en_swap <= '0' ;
  45.   next_state <= reset4 ;
  46.   end if ;
  47.   else
  48.   next_state <= reset3 ;
  49.   end if ;
  50.   
  51. when reset4 =>
  52. if (finish_shift = '1') then
  53. en_shift <= '0' ;
  54. addpulse <= '1' ;
  55. next_state <= reset5 ;
  56. else
  57. next_state <= reset4 ;
  58. end if ;

  59. when reset5 =>
  60. if (zero_num = '1') then
  61. normalise <= '1' ;
  62. next_state <= reset6 ;
  63. elsif (add_finish = '1') then
  64. normalise <= '1' ;
  65. addpulse <= '0' ;
  66. next_state <= reset6 ;
  67. else
  68. next_state <= reset5 ;
  69. end if ;

  70. when reset6 =>
  71. if (end_all = '1' and clock_main = '1') then
  72. normalise <= '0' ;
  73. next_state <= reset6 ;
  74. elsif (end_all = '1' and clock_main = '0') then
  75. next_state <= reset1 ;
  76. else
  77. next_state <= reset6 ;
  78. end if ;

  79. when reset7 =>
  80. next_state <= reset7 ;

  81. when others =>
  82. next_state <= reset1 ;

  83. end case ;
  84. end process ;

  85. process(clock , reset , change)
  86. begin
  87. if(change = '1') then
  88. current_state <= reset1 ;
  89. elsif (reset = '1') then
  90. current_state <= reset1 ;
  91. elsif (clock= '1' and clock'event) then
  92. current_state <= next_state ;
  93. end if ;
  94. end process ;

  95. process (a_small , sign_a , sign_b)
  96. begin
  97. if (sign_a = '0' and sign_b = '0') then
  98. sign_out <= '0' ;
  99. add_sub <= '1' ;

  100. elsif (sign_a = '1' and sign_b = '1') then
  101. sign_out <= '1' ;
  102. add_sub <= '1' ;

  103. elsif (a_small = '1' and sign_a = '0') then
  104. sign_out <= '1' ;
  105. add_sub <= '0' ;

  106. elsif (a_small = '0' and sign_a = '1') then
  107. sign_out <= '1' ;
  108. add_sub <= '0' ;

  109. else
  110. sign_out <= '0' ;
  111. add_sub <= '0' ;
  112. end if ;

  113. end process ;

  114. end rtl ;
复制代码


FFT变换的IP核的源代码.zip

35.22 KB, 下载次数: 14, 下载积分: 黑币 -5

FFT变换的IP核的源代码.zip

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表