请问各位大侠,能够告知一下VHDL中的ARITH包、UNSIGNED包和SIGNED包的功能呢?程序中总是调用这些包,可实在是不清楚调用的原因。。。
比如说,如下这个程序,UNSIGNED包的作用是什么呢?
- LIBRARY IEEE;
- USE IEEE.STD_LOGIC_1164.ALL;
- USE IEEE.STD_LOGIC_UNSIGNED.ALL;
- ENtiTY JOYSTICK IS
- PORT(
- CLK: IN STD_LOGIC;
- RESET: IN STD_LOGIC;
- DATA: IN STD_LOGIC_VECTOR(4 DOWNTO 0);
- LED: OUT STD_LOGIC_VECTOR(3 DOWNTO 0)
- );
- END JOYSTICK;
- ARCHITECTURE LED OF JOYSTICK IS
- BEGIN
- process( DATA )
- begin
- if(DATA= "11110") then
- LED <= "0001";
- elsif(DATA= "11101") then
- LED <= "0010";
- elsif(DATA= "11011") then
- LED <= "0011";
- elsif(DATA= "10111") then
- LED <= "0100";
- elsif(DATA= "01111") then
- LED <= "0101";
- else LED <= "0000";
- end if;
- end process;
- END LED;
复制代码
• std_logic_1164 (std_logic types & related functions),这个是标准逻辑类型和相关函数运算包
• std_logic_arith (arithmetic functions),这个是运算函数包
• std_logic_signed (signed arithmetic functions)这个是有符号数运算函数包
• std_logic_unsigned (unsigned rithmetic functions),这个是无符号数运算函数包
一周热门 更多>