When to use the VHDL library std_logic_unsigned and numeric_std?

I am using VHDL-200X in ISE. I always use these types of data, such as std_logic_vector, std_logic, integer, booleanand real. Always use std_logic_vectorconvert to integerand reverse. My teammates are asking me to use these three parts library IEEE.

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

But someone said do not use IEEE.STD_LOGIC_UNSIGNED.ALLinstead IEEE.NUMERIC_STD.ALL. Because you have everything you need in numeric_std, and STD_LOGIC_UNSIGNED- not a standard library. Here .

I'm embarrassed and can anyone help?

+4
source share
2 answers

std_logic_arith std_logic_**signed. numeric_std, . , IEEE, . Synopsys Mentor Graphics.

std_logic_vector . , , , .

integer :

  • 'X'
  • 32
    ( 64- ?)
+11

@Pabbles. OTOH, . , , , ( numeric_std_unsigned):

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

RTL signed unsigned , . .

RTL std_logic_vector, std_logic_unsigned . , (=,/=, <, < =, > , > -). :

if A = "00001" then 
. . . 
if B = X"1A" then 

, A 5 ? , B 8 ? , FALSE. std_logic_unsigned, , . std_logic_unsigned, testbench .

"=" RTL, , - :

Sel <= '1' when Addr > X"3FFF" else '0' ; 

A - 16 , . , A 16 ? (). IE: "100" > "01111" TRUE.

std_logic_unsigned . . std_logic_unsigned FALSE. std_logic_unsigned, , .

, std_logic_unsigned, , , , , ( , std_logic_unsigned), , . , std_logic_unsigned .

, VHDL-2008 numeric_std_unsigned, , .

, (<, < =, > , > =) , std_logic_vector, , , - . , "=" .

VHDL-2008 "? =", "?/=", "? > ",... , . (? =,?/=) , , , . (? > ,? > =,? <, < =) , numeric_std numeric_std_unsigned, , .

+4

Source: https://habr.com/ru/post/1683784/


All Articles