Explain bitwise left shift and right shift operators, Computer Engineering

Assignment Help:

Bitwise Left Shift and Right Shift Operators: <<, >>

shift-expression :

additive-expression

shift-expression << additive-expression shift-expression >> additive-expression

The bitwise shift operators shift their first operand left (<<) or right (>>) by the number of positions the second operand specifies.

Example

In the following example, the right shift operator moves the data bits two positions to the right, thus changing the value of nNumA:

// Example of the bitwise right shift operator

int nNumA=8;   // beginning value is 8

nNumA >> 2;    // ending value is 2

 


Related Discussions:- Explain bitwise left shift and right shift operators

Explain the advantages of computer, Explain the advantages of computer ...

Explain the advantages of computer Computer is one of the main components of an Information Technology network and getting increasing popularity. Nowadays, computer technology

Define the three prime processes of UML, Define the three prime processes o...

Define the three prime processes of uml The three prime processes were OMT (Rumbaugh), OOSE (Jacobson) and Booch. OMT was strong in analysis, while Booch was strong in design a

What is collective message passing, Q. What is Collective Message Passing? ...

Q. What is Collective Message Passing? In collective message passing all the processes of a group take part in communication. MPI offers a number of functions to apply the coll

Minterms, A minterm is an AND expression involving all input variables in e...

A minterm is an AND expression involving all input variables in either inverted or non-inverted form.For one particular row the associated mintermis the only minterm which equals l

What are the advantages of electronic payment system, What are the advantag...

What are the advantages of electronic payment system? Advantages of the electronic payment system are illustrated below: This gives good security schemes. Four important sec

Safety argument for good design, So far we have considered the problems of ...

So far we have considered the problems of poor ID in terms of the loss of productivity and efficiency to business. There is another important aspect to consider: the issue of safet

Write statement, Rounding off of values can be carried out using the write ...

Rounding off of values can be carried out using the write statement. Yes, Rounding off value can be out by using the write statement.

How many and gates are required to realize Y = CD+EF+G, How many AND gates ...

How many AND gates are required to realize Y = CD+EF+G ? Ans. Y = CD + EF + G for realize this two AND gates are needed (for CD and EF).

Knowledge representation - artificial intelligence, Knowledge Representatio...

Knowledge Representation: To recap, we now have some characterizations of "AI", that when an "AI" problem arises, you will be able to put all into context exactly, find the co

What is a serial port, What is a serial port?  A serial port transfers...

What is a serial port?  A serial port transfers and receives data single bit at a time.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd