title: Dividing a constant by an std_logic_vector
body: <p>I would like to know the proper way to divide the following:</p>
  
  <p>I have the following:</p>
  
  <pre><code>constant freq : integer := 50000000;
  constant minute : integer := 60;
  ...
  variable sum : std_logic_vector(31 downto 0) := (others =&gt; '0');
  </code></pre>
  
  <p>sum is changed within a process, many times.
  When I'm done changing "sum", I need to calculate: freq*minute / sum.</p>
  
  <p><strong>I can't use numeric_std, I've been asked to use only std_logic_unsigned, std_logic_arith</strong> (I know, they're no good, but bare with it).</p>
  
  <p>I figured I should do the division in integers, so I tried using the following but the results are incorrect:</p>
  
  <pre><code>suminteger := conv_integer(sum);
  RPM_integer := (minute * freq) / suminteger; -- result is always less than 256
  RPM_int &lt;= conv_std_logic_vector(RPM_integer,8);
  </code></pre>
  
  <p>Is there any way to make this calculated with the above mentioned libraries? thanks!</p>