The Gateway to Computer Science Excellence

+34 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.

+8 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

+7 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.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.4k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.4k
- Admissions 595
- Exam Queries 573
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

50,741 questions

57,243 answers

198,013 comments

104,606 users