﻿<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="thpdoc.xsl"?>
<page id="__hex" suffix=" Function">
  <subsection>Explicitly defines a logic vector constant.</subsection>
  <code>logic[] __hex(string value);</code>
  The <kw>__hex</kw>() function allows explicitly defining logic vector constants using their hexadecimal representation. It is useful in conjunction with type inference and for declaring large constants (larger than 32 bits).
  <section name="Remarks">
  <p>Note that you can initialize vectors of size 32 and less with normal C++ style integral constants (e.g. 15, 0xF or 0b1111).</p>
  </section>
  <examples>
	<example>
		<code>entity Test
{
	signal auto xxx = __hex("010"), yyy = 0x010;
	signal logic[12] xx2 = __hex("010"), yy2 = 0x010;
}</code>
	Generated VHDL code:
<code>	signal xxx : std_logic_vector(11 downto 0) := X"010";
	signal yyy : integer := 16;
	signal xx2 : std_logic_vector(11 downto 0) := X"010";
	signal yy2 : std_logic_vector(11 downto 0) := X"010";</code>
	</example>
  </examples>
  <seealso id="const"/>
  <seealso id="__bin"/>
</page>