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

Advantages of e-commerce, One of the resources we used was Ajeet Khurana's ...

One of the resources we used was Ajeet Khurana's article that talks about the advantages of e-commerce. It was helpful to gain some background on the variety of benefits the electr

Classical approach - canonical genetic algorithm, Classical approach - Cano...

Classical approach - Canonical genetic algorithm: However returning to the classical approach, as there example, whether solving a particular problem involved finding a set of

Rule in a single direction - equivalences rules, Rule in a single direction...

Rule in a single direction - equivalences rules: Hence there the power to replace  sub expressions always allows use to prove theorems with equivalences: as given in the above

Define a segment index or an internal index, The field that contains a segm...

The field that contains a segment index or an internal index is called ? Ans. Target datum consists of a segment index or an internal index.

Designing logic circuits, When designing a logic circuit with multipleoutpu...

When designing a logic circuit with multipleoutputs it is usual to treat it as several circuitseach with one output. So for our example wewould design three circuits; one with outp

What are the characteristics of the e-cash, What are the characteristics of...

What are the characteristics of the E-Cash? These kinds of payments, turning the Internet within a transaction oriented forum, need mediums which are easy and cheap (through a

First-order inference rules - artificial intelligence, First-Order Inferenc...

First-Order Inference Rules -artificial intelligence: Now we have a perfect definition of a first-order model is,in the same way, we may define soundness for first-order infere

Collision free network, Hello Sir/Mam, Actually i am trying to implement th...

Hello Sir/Mam, Actually i am trying to implement the concept of MAC layer protocols in NS2..... But unfortunately i am not able to do that.... and not even able to get the code fo

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