Advertisement
Guest User

aaaaaaaaaa

a guest
Apr 25th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. function Bit#(32) barrelRShift(Bit#(32) in, Bit#(5) sftSz, Bit#(1) sft_in);
  2. Bit#(32) s = signExtend(sft_in);
  3. if (sftSz[0] == 1) ret = {s[0], in[31: 1]};
  4. else ret = in;
  5. if (sftSz[0] == 1) ret = {s[1: 0], in[31: 2]};
  6. else ret = s0;
  7. if (sftSz[0] == 1) ret = {s[3: 0], in[31: 4]};
  8. else ret = s1;
  9. if (sftSz[0] == 1) ret = {s[7: 0], in[31: 8]};
  10. else ret = s2;
  11. if (sftSz[0] == 1) ret = {s[15: 0], in[31: 16]};
  12. else ret = s3;
  13. return s4;
  14. endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement