Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- task convd;
- input [16:0] num;
- output [(8*5)-1:0] str;
- begin
- str[39:32] = "0" + ((num/16'd10000) % 16'd10);
- str[31:24] = "0" + ((num/16'd1000) % 16'd10);
- str[23:16] = "0" + ((num/16'd100) % 16'd10);
- str[15:8] = "0" + ((num/16'd10) % 16'd10);
- str[7:0] = "0" + (num % 16'd10);
- //@(posedge sys_clock); Adding this line makes all of str go to 0
- end
- endtask : convd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement