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

How codes represent data for scientific calculations?, Q. How codes represe...

Q. How codes represent data for scientific calculations? How codes are in fact used to represent data for scientific calculations? The computer is a discrete digital device

Define the while loop, The while Loop The while loop repeats a statemen...

The while Loop The while loop repeats a statement until the test at the top proves false. As an example, here is a function to return the length of a string. int string_leng

Initialize new pvm processes, Q. Initialize new PVM processes? pvm_spa...

Q. Initialize new PVM processes? pvm_spawn( char *task, char **argv, int flag, char *where, int ntask, int *tids ) Initialize new PVM processes. Task a character st

What is the role of ir and pc, What is the role of IR and PC?  Instruct...

What is the role of IR and PC?  Instruction Register (IR) having the instruction being implemented. Its output is available to the control circuits, which make the timing signa

Which types of software programs are usually supported, Which types of soft...

Which types of software programs are usually supported? Our organization is unique in that we are very flexible and can meet most client requires relative to the integration of

By which each connected device is assigned a time slot, Using             ...

Using                    each connected device is assigned a time slot whether or not the device has anything to send. (A) WDM                                        (B)  FDM

Explain the criteria to classify data structures, Explain the criteria to c...

Explain the criteria to classify data structures used for language processors? The data structures utilized in language processing can be classified upon the basis of the subse

What is program-controlled i/o, What is program-controlled I/O? In prog...

What is program-controlled I/O? In program controlled I/O the processor repeatedly checks a status flags to achieve the needed synchronization among the processor and an input

Determine the advantages of bcd adder, Determine the advantages of BCD Adde...

Determine the advantages of BCD Adder Now let us see the arithmetic addition of two decimal digits in the BCD, with a possible carry from previous stage. As each input digit do

An example subroutine call, Create your own Subprogram that does *not* use ...

Create your own Subprogram that does *not* use any input parameters. You decide the theme. You should give the pseudocode and an example Subroutine call. Be sure to give an overvie

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