首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

各位帮我看看这个程序,我是个初学者,就是变量赋值老有问题;

各位帮我看看这个程序,我是个初学者,就是变量赋值老有问题;

library ieee;
use ieee.std_logic_1164.all;
package page is
   function min(x,y: in std_logic_vector)
     return std_logic_vector ;
   end page;
    
package body page is
 function min(x,y: in std_logic_vector) return std_logic_vector is
 variable temp:std_logic_vector(3 downto 0);
  begin
   if(x<y) then temp:=x;
   else temp:=y;
   end if;
   return temp;
  end  function min;
  procedure vector_to_int
  (signal s: in std_logic_vector(7 downto 0);
  result:inout integer ) is
  variable t:integer :=1;----------------?
  begin 
    for i in 1 to 7 loop
      t: = t*2;
      if(s(i)='1') then result:=result+1;
      end if;
      end loop;
     end procedure;
   end page;
 
yibu
result:=result+1
应该是这里的问题
result:=result+t

返回列表