shifting value in binary instead of decimal in rtl

Status
Not open for further replies.

fragnen

Full Member level 4
Joined
Apr 3, 2019
Messages
211
Helped
0
Reputation
0
Reaction score
2
Trophy points
18
Visit site
Activity points
1,490
Can the shifting value in the shift operator which is shown below be binary?

<<, >>.

For example, in the below the shifting value 4'b0101 is in binary. Is it valid to write synrhesizble rtl code with the shifting value in binary as shown below?

assign d = b << 4'b0101 to shift b left by 5 bits and then assign to d.

The reason for asking this question is because normally we see shifting value to be in decimal in synrhesizble rtl code.
 

1) why don’t you just try it?
2) why do you even want to do this?
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…