verilog synthesizeable operators

Status
Not open for further replies.

naizath12

Junior Member level 1
Joined
May 28, 2009
Messages
18
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Location
India
Activity points
1,404
is <<(left shift) and >>(right shift) bitwise operators synthesizeable???
 

it is synthesizeable.
a << 3 works well.
a << b is not recommended and will use too much resource.

and you could use this : {a[5:0],3'b0}
it equals to a<<3
 
Yes it's synthesizable but not good for timing. Use the method the previous poster suggested. You probably need to use a big case statement to include all the possible shifting values though.

- Hung
 

Yes it's synthesizable but not good for timing.
Why? If you are using a variable shift factor, it should be clearly range restricted. But then, a modern design
compiler should be able to minimize the logic. I wouldn't expect different resource requirements for the high level
a << n statement versus a fully decoded case construct.
 


c[31:0] = a[31:0] << b[4:0] means
Code:
case(b)
    5'h0 : c = a;
    5'h1 : c = {a[30:0],1'b0};
    5'h2 : c = {a[29:0],2'b0};
    .
    .
    .
    5'h1f : c = {a[31],31'b0};
endcase
 

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