The Utility of the Left Shift and Right Shift Operators

Study the applications of the left shift and right shift operators.

Application of the left shift and right shift operators

When we create a file in Windows, the following formula is applied to it:

(Year−1980)∗512+Month∗32+Day(Year-1980)*512+Month*32+Day

A 2-byte resultant number is then stored on the disk. For every file, date and time are stored as 2-byte entries. In this 2-byte number, the left most 7 bits contain the year, the middle 4 bits contain the month, and the right most 5 bits contain the day. The distribution of bits for time is shown in the figure given below:

Get hands-on with 1200+ tech skills courses.