+0  
 
0
86
6
avatar

binary shift right of two places on the binary number 00110100. 

 

Describe a shift that can be used to double the value of the binary number 00100100. 

 

Complete a 2 place right shift on the binary number 11001011. 

 

verry confused plz help plx plz plz i watchd every video got iit wrong  plz help

 Jun 26, 2020
 #1
avatar+26620 
+1

Since it is a BINARY number ....every position to the left is TWICE the one to the right    (edited)

example    010    is twice  001       100 is twice 010 

so shift the number to the left ONE space to double it

00100100    to double it   shift it one space left   

01001000

 

Binary shift right two places

00110100

00001101

 Jun 26, 2020
edited by ElectricPavlov  Jun 26, 2020
edited by ElectricPavlov  Jun 26, 2020
edited by ElectricPavlov  Jun 26, 2020
edited by ElectricPavlov  Jun 26, 2020
 #2
avatar+8340 
+1

A story:

Imagine a wall being placed on the right of a binary number.

Whenever a number gets left shifted, a zero comes out of the wall to fill the gap between the wall and the number.

Whenever a number gets right shifted, the last digit just goes through the wall and never come back again.

 

Now, let's try left shifting and right shifting some numbers.

 

right shift of two places on 00110100.

 

The bar denotes the "wall", and blue digits means the digit is gone.

 

\(00110100\Big|\)

right shift once

\(0011010\Big|\color{blue}0\)

right shift once more

\(001101\Big|\color{blue}00\)

 

The result should be \(001101\), but because you needs 8 bits for a byte, it becomes \(00001101\). We add zeroes in front when we don't have enough digits.

 

Hints for the others:

Q2) Think of what a left shift and a right shift really does on the value of the binary number by trying out few examples.

Q3) Similar to Q1.

 

EDIT: Italicized text is what I changed.

 Jun 26, 2020
edited by MaxWong  Jun 26, 2020
 #3
avatar
0

how do you got the 4 0s at the front for 8 bit

?

Guest Jun 26, 2020
 #4
avatar+8340 
0

We need 8 digits, but we only had 6, which is 001101. 

 

When we don't have enough digits, we add zeroes in front of the number. This is because doing this does not affect the value of the number.

 

We add 2 zeroes in front, so it gives 00001101.

MaxWong  Jun 26, 2020
 #5
avatar
0

we are doing a right shift so we dont add it to the right

Guest Jun 26, 2020
 #6
avatar+8340 
0

Yeah of course, we don't add to the right :)

MaxWong  Jun 26, 2020

9 Online Users