title: verilog 16b barrel circular shift why it doesn't work?
body: <pre><code>module Rotator(shift,lr,in,out);
  
  input [3:0]  shift;
  input [15:0] in;
  input   [15:0] out;
  input lr;
  
  wire [15:0] la, ra, lb,rb, lc,rc, ld,rd;
  
  //left shift:2^n
  
  assign la = shift[0] ? { in[14:0],in[15]} : in; //&lt;&lt;1
  assign lb = shift[1] ? { la[13:0],la[15:14]} : la; //&lt;&lt;2
  assign lc = shift[2] ? { lb[11:0],lb[15:12]}: lb; //&lt;&lt;4
  assign ld = shift[3] ? { lc[7:0], lc[15:8]}:lc; //&lt;&lt;8
  
  //right shift:2^n
  
  assign ra = shift[0]? { in[0], in[15:1]}: in;  //&gt;&gt;1
  assign rb = shift[1]? { ra[1:0], in[15:2]}: ra; //&gt;&gt;2
  assign rc = shift[2]? { rb[3:0], in[15:4]}: rb; //&gt;&gt;4
  assign rd = shift[3]? { rc[7:0], in[15:8]}:rc; //&gt;&gt;8
  
  assign out = lr? ld : rd;
  
  endmodule
  </code></pre>
  
  <p>i'm tring to make 16b barrel rotator. but the result does not change along with shift value
  i think the parts that i emphasize are issue. please give me advice </p>