4.4k views

Booth's coding in $8$ bits for the decimal number $-57$ is:

1. $0-100+1000$
2. $0-100+100-1$
3. $0-1+100-10+1$
4. $00-10+100-1$

edited | 4.4k views

Convert $57$ to Binary & Get $2's$ complement. It is "$11000111$" & Attach one extra $0$ to right of it

$110001110$

To calculate booth code subtract right digit from left digit in every consecutive 2 digits.

So, $11\to 0$, $10 \to +1$. Finally, $10 \to +1$

There is another way to solve this question.

$0-100+100-1 \to$ If you check binary weigted sum of this code you will get $-57$. This is trick to quick check. Booth code is always equivalent to it's original value if checked as weighted code. If you check it before doing above procedure & if only one of option maps, you don't need to do above procedure, just mark the answer.

Here, $(-1) \times 64 + (+1) \times 8 + (-1) \times 1 = -57$.

by Boss (41.9k points)
edited
0
0
please explain why do we have to add a zero at the end of 2's complement
0
Go to Zaky Hamatcher CO book chapter 6
0
Selected answer says - "To calculate booth code substract right digit from left digit in every consecutive 2 digt".
Actually, we have to scan from right to left by appending a zero in the LSB. Then, subtract the left bit from the right bit all the way till MSB.

Further, a transition from 0 to 1 indicates that 'block of 1s' has started and a transition from 1 to 0 indicates that block of 1's has ended; similarly transition from 1 to 1 indicates we are still in the block of 1's.
+22

this may help

0

@meghna  that really helped

B  -57 i s represented as 1000111  on moving from 0 to 1 we get -1 and from 1 to 0 we get 1

so ans is b
by Boss (31.4k points)
0
'in 8 bits' its, 11000111 as given by Night's King below.

a) If ith bit is '1' and (i-1)th bit is '0' , we substitute ith bit with  '-1' .

b)  If ith bit is '0' and (i-1)th bit is '1' , we substitute ith bit with  '+1' .

c)  If ith bit is '0' and (i-1)th bit is '0' or  ith bit is '1' and (i-1)th bit is '1' then , we substitute ith bit with  '0'.

d) If LSB bit a0 is '1' , we assume that a-1 is there and = '0' and hence substitute it with '-1' .

57 = 00111001

In 2's compliment form, it is:  11000111 = -57

According to above rules: Booth Encoding Will Be: 0-100+100-1

Hence, Option B

Credit For The Quoted Explanation: @Habibkhan

by Active (2.7k points)
0
can u plz explain a bit further about d) LSB bit...
57 in 2's compliment form = 11000111
So Q=11000111, q(_1 in suffix)=0

We know in bit pairs 00 and 11= ASR, 01=+,ASR , 10=-,ASR
So now           Q      q_1
11000111  0
from right to left bit pair in reverse order                     (10)(11)(11)(01)(00)(00)(10)(11)
so booth coding for 8 bit decimal number -57 is ------
step 1=    -(1^0) (1^1) (1^1)  +(0^1) (0^0) (0^0) -(1^0) (1^1)
step 2=   - 1 0 0  + 1 0 0 - 1 0
step 3=reverse it= 0 - 1 0 0 + 1 0 0 - 1
by (43 points)
0
i don't understand:)
0
can please you explain more on step1,2,3 ?