1,883 views
1 1 vote

pls someone explain

How to left shift this number ?

1010110<<2

Answer 1: shifting to the left means adding extra 0's as rightmost bits so in this case it means 101011000 now digit will be 1011000 

but 1010110 represents 86 in decimal and left shift by 2 means multiply with 4 to the decimal number and now result 344 =101011000 now m confused ?

1 Answer

Best answer
1 1 vote

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
selected by
Position:
Show:

Related questions

3 3 votes
2 2 answers
516
516 views
Vishnu__ asked Jan 20
516 views
P and Q are 32 bit registers used to store IEEE single precision floating point notations (32 bit).Let content of P and Q are P = C0400000H and Q = 40400000H. The P * Q r...
2 2 votes
1 answers 1 answer
1.1k
1.1k views
Sandeep Singh asked Jan 19, 2016
1,102 views
Consider the addition of the two numbers 10001110 and 10000000 in an 8-bit ALU. Which of the following best summarizes the result and the status of the Z(zero), S(sign), ...
1 1 vote
0 0 answers
92
92 views
naveendewangan asked Jul 28
92 views
Let f₃₂ be the number of distinct numbers that can be represented in 4-byte IEEE-style floating point and u₃₂ be the number of distinct numbers that can be represented as...
5 5 votes
2 2 answers
172
172 views
GO Classes asked Jun 9
172 views
An $8$-bit pattern represents $-45$ in $2$'s complement form. If the same bit pattern is interpreted as a $1$'s complement number, what decimal value does it represent?$-...