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

Status
Not open for further replies.

fragnen

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

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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top