The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

+11 votes

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

- $0-100+1000$
- $0-100+100-1$
- $0-1+100-10+1$
- $00-10+100-1$

+24 votes

Best answer

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$

So, answer is (B).

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$.

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.

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.

+7 votes

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

so ans is b

+4 votes

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 a

_{0}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

+3 votes

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

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

- All categories
- General Aptitude 1.4k
- Engineering Mathematics 5.9k
- Digital Logic 2.3k
- Programming & DS 4.2k
- Algorithms 3.6k
- Theory of Computation 4.6k
- Compiler Design 1.7k
- Databases 3.3k
- CO & Architecture 2.9k
- Computer Networks 3.3k
- Non GATE 1.2k
- Others 1.3k
- Admissions 506
- Exam Queries 480
- Tier 1 Placement Questions 22
- Job Queries 64
- Projects 15

40,749 questions

47,471 answers

145,586 comments

62,234 users