title: Behavior of VHDL comparison operator with integer argument
body: <p>Consider the following example, compiling with VHDL-2008 support.</p>
  
  <pre><code>library ieee;
  use ieee.numeric_std.all;
  ...
  if (to_unsigned(0, 3) &lt;= 8) then
     StatementsA
  end if;
  if (to_unsigned(1, 3) &lt;= 8) then
     StatementsB
  end if;
  </code></pre>
  
  <p>In my experience, <code>StatementsA</code> get executed, but not <code>StatementsB</code>.
  Logically I would expect that both statements get executed since 0 and 1 are both less than 8. My theory is that 8 is interpreted as a 3 bit number, and the top bit is being lost, creating the value of 0.</p>
  
  <p><strong>Questions</strong></p>
  
  <ol>
  <li>Is this the intended behavior of VHDL?</li>
  <li>What is the logic/reasoning behind this? Why wouldn't the size of the comparison automatically be resized to the required size of the integer?</li>
  <li>What is a logical &amp; safe practice to encourage in order to avoid situations like this?</li>
  </ol>