title: Type vs Subtype and down vs to for Integers in VHDL
body: <p>What is the difference between <code>type</code> and <code>subtype</code> in VHDL and where should I use them ?   </p>
  
  <p>My understanding is that <code>subtype</code> is just narrowed down version of one of the primary types, such as <code>integer</code>: <code>subtype small_integer is integer range -128 to 127;</code> All the operations possible on primary type, are also possible on <code>subtypes</code>(of course, with certain limitations) . Also, it is better to use <code>subtypes</code> to prevent errors.</p>
  
  <p>So what is the purpose of the <code>type</code> ?  </p>
  
  <p>What is the difference between <code>donwto</code> and <code>to</code> for the <code>integers</code> ? (To get the point across, here is an example)<br>
  <code>subtype bit_index is integer range 31 downto 0;<br>
   subtype bit_index is integer range 0 to 31;</code>  </p>
  
  <p>Thanks !</p>