title: Assigning an integer to a register
body: <p>I am new to Verilog so I am having problems making conversions between different bases or types. More specifically I am trying to assign an integer to a 9 bit long register. The register will represent a signed integer in binary. I am trying to do something like this.</p>
  
  <pre><code>integer i = -10;
  reg [8:0] r;
  
  always @(posedge clk)
    begin
      r &lt;= i;
    end
  </code></pre>
  
  <p>P.S. I am using Verilog with Xilinx ISE v12.4</p>