Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

shifting value in binary instead of decimal in rtl

fragnen

Full Member level 3
Joined
Apr 3, 2019
Messages
182
Helped
0
Reputation
0
Reaction score
1
Trophy points
18
Activity points
1,299
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.
 
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?
 

LaTeX Commands Quick-Menu:

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top