module shift_right(sxt,a,b,shift_right); input sxt; input [31:0] a; input [4:0] b; output [31:0] shift_right; wire [31:0] w,x,y,z; wire sin; assign sin = sxt & a[31]; assign w = b[0] ? {sin,a[31:1]} : a; assign x = b[1] ? {{2{sin}},w[31:2]} : w; assign y = b[2] ? {{4{sin}},x[31:4]} : x; assign z = b[3] ? {{8{sin}},y[31:8]} : y; assign shift_right = b[4] ? {{16{sin}},z[31:16]} : z; endmodule