Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1183288
  • 博文数量: 232
  • 博客积分: 7563
  • 博客等级: 少将
  • 技术积分: 1930
  • 用 户 组: 普通用户
  • 注册时间: 2008-05-21 11:17
文章分类

全部博文(232)

文章存档

2011年(17)

2010年(90)

2009年(66)

2008年(59)

分类: 嵌入式

2011-01-05 16:05:52

在std_1164库中只查到有bit转成std_ulogic,bit_vector 转成std_logic_vector.我现在想把一个bit赋给std_logic_vector类型的最后一位,请问有没有好的处理方法?谢谢

function  bit_to_std_logic(constant bit_in : bit) return std_logic is
  
  variable temp_bit : bit;
  variable temp_result : std_logic;

begin
  
  temp_bit := bit_in;
  if temp_bit = '1' then
     temp_result := '1';
  else
     temp_result := '0';
  end if;

  return(temp_result);

end bit_to_std_logic;

begin

   std_logic_vector_signal(0) <= bit_to_std_logic(bit_in);

end;

阅读(5348) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~