Bitwise Operation: Left Shift and Right Shift

Left Shift Logical Left Shift and Arithmetic Left Shift zeros are shifted in to replace the discarded bits inserts value 0 bits into the least significant bit works for both signed as well as unsigned numbers logical and arithmetic left shift have same effect Left Shift Operator (<<) Same as multiplying value by 2^count (new_value …

Bitwise Operation: Left Shift and Right Shift Read More »

Signed Numbers: Two’s Complement

In mathematics, negative numbers in any base are represented by prefixing them with a minus sign (“−”). However, in computer hardware, numbers are represented only as sequences of bits, without extra symbols.  Two’s complement is one of the method to represent signed numbers using  binary numeral system, which uses only two symbols: typically “0” (zero) and “1” (one). Negative …

Signed Numbers: Two’s Complement Read More »