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.

[Matlab] >>(right shift) and <<(left shift)

Status
Not open for further replies.

davyzhu

Advanced Member level 1
Joined
May 23, 2004
Messages
494
Helped
5
Reputation
10
Reaction score
2
Trophy points
1,298
Location
oriental
Activity points
4,436
matlab shift

Hi all,

How >>(right shift) and <<(left shift) 2'complement number
(both positive and negative integer).

Is x>>2 equal to floor(x/4)?

And is x<<2 equal to x*4?

Best regards,
Davy
 

matlab left shift

Hi hr_rezaee,

Thanks!

The bitshift C = bitshift(A, k) returns the value of A shifted by k bits. Input argument A must be an unsigned integer or an array of unsigned integers.

But I need the signed version.

I used to use floor(x/(2^n)) to emulate x>>n, is it right?

Best regards,
Davy
 

matlab shift left

Hi,

I copy the x >> y definition from a video standard (H.264).

Arithmetic right shift of a two's complement integer representation of x by y binary digits. This function is defined only for positive integer values of y. Bits shifted into the MSBs as a result of the right shift have a value equal to the MSB of x prior to the shift
operation.

Did matlab provide a arithmetic shift function?

Best regards,
Davy
 
matlab bit shift

Hi
I don't know but study "Simulink Reference>Shift Arithmetic" and "Simulink Fixed Point>shifts".
they can help you.
regards
 

matlab shift function

why dont u check MATLAB help for exact answer.u will find brief explanation there
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top