Left shift means : The number to the left of the operator is shifted the number of places specified by the number to the right.
like 1010110<<2
it would be after left shift 101011000
In general shifting N places left is the same as multiplying by 2 to the power N (written as 2N)
A left shift 1 place is the same as multiplying by 2
A left shift 2 place is the same as multiplying by 4
see this example , number is 00100101
shift left 2 places
input |
0 |
0 |
1 |
0 |
0 |
1 |
0 |
1 |
result |
1 |
0 |
0 |
1 |
0 |
1 |
0 |
0 |