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.

SHL, SAR, SHL, SAL doubt

Status
Not open for further replies.
Advanced Member level 6
Joined
Dec 4, 2012
Messages
4,280
Helped
822
Reputation
1,654
Reaction score
791
Trophy points
1,393
Location
Bangalore, India
Visit site
Activity points
0
In C/C++ SHL and SHR operators <<, >> move bits to left or right like below.

If x is a char variable and contains 0b11100000 then x = x << 1 and x = x >> 1 shifts bits one place to left and right so the result is x = 0b11000001 and 0b011100000. Right?

In assembly language it tells that it will pad zeroes to right or left like it becomes 0b11000000 and 0b00111000.
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top