⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 int_to_vector_suo.vhd

📁 整型到字符型的转换
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;

entity int_to_vector_suo is
    port(input:in integer range 0 to 255;
          q:out std_logic_vector(7 downto 0));
end int_to_vector_suo;

architecture behave of int_to_vector_suo is
begin
   process(input)
   variable tmp,t:integer;
   begin
	t:=input;
     for i in 0 to 7 loop
       tmp:=t/2;
       if((t rem 2)=1)then
			q(i)<='1';
		else
			q(i)<='0';
		end if;
       t:=tmp;
     end loop;
   end process;
end behave;

⌨️ 快捷键说明

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