Essential Computer Science: Binary, OS Kernel, Von Neumann, Assembly
Classified in Computers
Written on in English with a size of 53.68 KB
Binary Operations and Number Systems
Bitwise Shift Operations
Left Shift
The left shift operator (<<
) shifts bits to the left, filling the vacated positions on the right with zeros. This is equivalent to multiplying the number by powers of two.
Right Shift
The right shift operator (>>
) shifts bits to the right. There are two types:
- Logical Right Shift: Fills the vacated positions on the left with zeros.
- Arithmetic Right Shift: Fills the vacated positions on the left with the most significant bit (sign bit) of the original number, preserving the sign for signed integers.
Decimal to Binary Conversion
To convert a decimal number to binary, repeatedly divide the decimal number by 2. Record the remainder (which will be either 0 or 1) from right... Continue reading "Essential Computer Science: Binary, OS Kernel, Von Neumann, Assembly" »