SHARE
TWEET

Untitled

a guest Jul 26th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     task convd;
  2.         input [16:0] num;
  3.         output [(8*5)-1:0] str;
  4.         begin
  5.             str[39:32] = "0" + ((num/16'd10000) % 16'd10);
  6.             str[31:24] = "0" + ((num/16'd1000) % 16'd10);
  7.             str[23:16] = "0" + ((num/16'd100) % 16'd10);
  8.             str[15:8] = "0" + ((num/16'd10) % 16'd10);
  9.             str[7:0] = "0" + (num % 16'd10);
  10.             //@(posedge sys_clock); Adding this line makes all of str go to 0
  11.         end
  12.     endtask : convd
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top