+ 1

what is 101 in 8 bit binary left shifted by 2?

Sorry i just want to make sure i’m correct. 101 left shifted by 2 is 10100 Thus 01010000 because its 8 bit?

27th Mar 2019, 9:55 AM
banna101
8 Antworten
+ 2
101 left shiftet by 2 is 20 in decimal. So it is 00010100. Everytime you shift left it is the same as doubeling the decimal value by two.
27th Mar 2019, 11:23 AM
Dragonxiv
Dragonxiv - avatar
+ 1
Thank youuu
27th Mar 2019, 4:26 PM
banna101
+ 1
And as for right shift For example 101 in 8 bit binary right shifted by 2 would be 00000001 ?
27th Mar 2019, 4:28 PM
banna101
+ 1
What about 101111101101 in 8 bit binary right shifted by 2? Would it be 1011111011 But would i limit to 8 bit by removing extra bit from the right side? Al 11011111110?
27th Mar 2019, 4:31 PM
banna101
+ 1
Don’t mind Al
27th Mar 2019, 4:32 PM
banna101
+ 1
The answers should always be binary. So the final answer is 11101101? It’s the same as left shift. You limit to 8 bit binary by removing extra bit at the left?
27th Mar 2019, 4:39 PM
banna101
0
banna101 Correct
27th Mar 2019, 4:29 PM
Dragonxiv
Dragonxiv - avatar
0
The problem is that the result is bigger than a 8 bit number. If you foce it into an 8 bit number it depends on the language you are using. As far as i know it would cut the leftmost numbers.
27th Mar 2019, 4:33 PM
Dragonxiv
Dragonxiv - avatar