Numeric std

Numeric std

numeric_std

numeric_std is a library package defined for VHDL

This package provides arithmetic functions for vectors. Overrides of std_logic_vector are defined for signed and unsigned arithmetic.

It is typically included at the top of a design unit:

    library ieee;
use ieee.std_logic_1164.all; -- standard unresolved logic UX01ZWLH-
use ieee.numeric_std.all; -- for the signed, unsigned types and arithmetic ops


The alternative numeric package ieee.std_logic_arith should not be used for new designs [1] [2]
This package does not provide overrides for mixing signed and unsigned functions.


This package includes definitions for the following (not all of which are synthesizable): [3]
sign changing operators

  • abs
  • -

arithmetic operators

  • +
  • -
  • *
  • /
  • rem
  • mod

Note: the second argument of /, rem, or mod must be nonzero.
comparison operators

  • >
  • <
  • <=
  • >=
  • =
  • /=

shift and rotate functions

  • SHIFT_LEFT
  • SHIFT_RIGHT
  • ROTATE_LEFT
  • ROTATE_RIGHT
  • sll
  • srl
  • rol
  • ror

resize function

  • RESIZE(v,n)

Note: when increasing the size of a signed vector the leftmost bits are filled with the sign bit, while truncation retains the sign bit along with the (n-1) rightmost bits. For an unsigned vector, a size increase fills the leftmost bits with zero, while truncation retains n rightmost bits.
conversion functions

  • TO_INTEGER
  • TO_UNSIGNED
  • TO_SIGNED

Note: The latter two functions each require a second argument specifying the length of the resulting vector.
logical operators

  • not
  • and
  • or
  • nand
  • nor
  • xor
  • xnor

match function

  • STD_MATCH

Note: compares argument vectors element by element, but treats any bit with the value '-' as matching any other STD_ULOGIC value. Returns false if any argument bit is 'U', 'X', 'W', or 'Z'.
special translation function

  • TO_01

Note: 'H' is translated to '1' and 'L' is translated to '0'; this function takes an optional second argument XMAP, which can be any of the std_logic values, but defaults to '0'. Any value besides 01LH in the input argument results in all bits being set to XMAP, with a warning issued.

References

  1. ^ [1]
  2. ^ also search on the string "std_logic_arith deprecated"
  3. ^ 1076.3 IEEE Standard VHDL Synthesis Packages

Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Библиотека Boost — Boost Тип библиотека (программирование) Написана на С++ ОС Кроссплатформенный Версия Boost 1.39.0 02.05.2009 …   Википедия

  • Boost (библиотека) — Boost Тип библиотека (программирование) Написана на С++ Операционная система Кроссплатформенный Последняя версия Boo …   Википедия

  • Boost — Тип библиотека (программирование) Написана на С++ Операционная система Кроссплатформенный Последняя версия Boost 1.52.0 (05.11.2012) …   Википедия

  • Comparison of programming languages (mapping) — Programming language comparisons General comparison Basic syntax Basic instructions Arrays Associative arrays String operations …   Wikipedia

  • MUMPS — This article is about the programming language. For other uses, see Mumps (disambiguation). MUMPS Paradigm(s) Procedural Appeared in 1966 Designed by Neil Pappalardo Stable release ANSI X11.1 1995 (December 8, 1995; 15 years ago …   Wikipedia

  • C++ standard library — In C++, the Standard Library is a collection of classes and functions, which are written in the core language. The Standard Library provides several generic containers, functions to utilise and manipulate these containers, function objects,… …   Wikipedia

  • Bluetooth — This article is about the electronic protocol. For the medieval King of Denmark, see Harald I of Denmark. Bluetooth logo Bluetooth is a proprietary open wireless technology standard for exchanging data over short distances (using short wavelength …   Wikipedia

  • Augmented Backus–Naur Form — In computer science, Augmented Backus–Naur Form (ABNF) is a metalanguage based on Backus–Naur Form (BNF), but consisting of its own syntax and derivation rules. The motive principle for ABNF is to describe a formal system of a language to be used …   Wikipedia

  • C++11 — C++11, also formerly known as C++0x,[1] is the name of the most recent iteration of the C++ programming language, replacing C++TR1, approved by the ISO as of 12 August 2011.[2] The name is derived from the tradition of naming language versions by …   Wikipedia

  • Document Type Definition — (DTD) is a set of markup declarations that define a document type for SGML family markup languages (SGML, XML, HTML). DTDs were a precursor to XML schema and have a similar function, although different capabilities. DTDs use a terse formal syntax …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”