正在加载图片...
333数据类型的转换 转换方法:函数转换法、类型标识符转换法和常量转换法 1、函数转换法 即利用一些转换函数进行对象数据类型的转换。 在 std_logic_1164中定义了四个转换函数 a.to_ stdlogicvector(a)将对象a由 bit vector类型转换为 std_logic_vector b.to_ bitvector(a)将对象 a tstd_logic_vector类型转换为 bit vector c.to_ stdlogic(a)将对象a由b类型转换为 std_ logic类型 d.to_bi(a)将对象a由 std_logic类型转换为b类型 ★在设计ⅥHDL程序过程中,若要调用程序包中的转换函数,必须在调用前 进行程序包使用的说明。 如:要调用 std_logic_unsigned程序包中的转换函数 library ieee use ieee std_logic_1164. all: use ieee std_logic_unsigned. all3.3.3数据类型的转换 转换方法:函数转换法、类型标识符转换法和常量转换法 1、函数转换法 即利用一些转换函数进行对象数据类型的转换。 在std_logic_1164中定义了四个转换函数: a. to_stdlogicvector(a) 将对象a由bit_vector类型转换为std_logic_vector b. to_bitvector(a) 将对象a由std_logic_vector类型转换为bit_vector c. to_stdlogic(a) 将对象a由bit类型转换为std_logic类型 d. to_bit(a) 将对象a由std_logic类型转换为bit类型 ★在设计VHDL程序过程中,若要调用程序包中的转换函数,必须在调用前 进行程序包使用的说明。 如:要调用std_logic_unsigned程序包中的转换函数 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all;
向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有