What is the difference between $size and $bits operator in verilog.?
if I’ve variables, [9:0]a,[6:0]b,[31:0]c.
c <= [($size(a)+$size(b)-1]-:$bits(b)];
What will be the output at ‘c’ from the above expression?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
$sizeshall return the number of elements in the dimension, which is equivalent to$high - $low + 1. It is relative to the dimension, not only bit counts. If the type is 1D packed array or integral type, it is equal to$bits.$bitssystem function returns the number of bits required to hold an expression as a bit stream.It returns 0 when called with a dynamically sized type that is currently empty. It is an error to use the
$bitssystem function directly with a dynamically sized type identifier.I have no idea about your question,
c <= [($size(a)+$size(b)-1]-:$bits(b)];. Is it a valid expression in RHS? Are you talking about the array range expression,[n +: m]or[n -: m]?