Guest User

Untitled

a guest
Jun 22nd, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. function [31:0] log;
  2. input [127:0] in;
  3. integer i;
  4. reg counter;
  5. begin
  6. counter = 0;
  7. for(i=0;i<32;i=i+1)
  8. begin
  9. if(in!=0)
  10. counter = counter+1;
  11. in = in>>1;
  12. end
  13. log = counter;
  14. end
  15. endfunction
Add Comment
Please, Sign In to add comment