Computer Science, asked by rutujatayde1234, 7 months ago

explain double dabble method with suitable example

Answers

Answered by Anonymous
57

Answer:

In computer science, the double dabble algorithm is used to convert binary numbers into binary-coded decimal (BCD) notation. It is also known as the shift-and-add-3 algorithm, and can be implemented using a small number of gates in computer hardware, but at the expense of high latency.

Explanation:

Please mark me BRAINLIST

Answered by itzneel07
30

Answer:

Explanation: When the Double-Dabble process begins, all the BCD digits are zeros, and the binary

number is just a positive binary number. Let's say that the binary number is a 32-bit

number. We begin by shifting out all the leading zeros and subtracting those from the bit

count. If there are 15 leading zeros, then 32 minus 15 means there are 17 significant bits

left to process.

At this point, all the BCD digits are still zero and the BCD number is a valid BCD number.

Checking now for a "greater than 4" pre-correction would show that no pre-correction is

necessary. Shifting the binary number one bit to the left (the equivalent of multiplying the

binary number by 2 or the equivalent of adding the binary number to itself), we now get a

one shifted out of the high-order bit.

Now we shift the BCD digits left one bit (the equivalent of doubling the BCD number or the

equivalent of adding the BCD number to itself). This doubling of the BCD number means

that the low-order bit will always be zero, because the number will be even. Now we can

add the one digit shifted out of the binary number to the BCD number without any sort of

carry rippling down. The BCD number should now contain only valid BCD digits.

We loop back and do all the "greater than 4" pre-corrections we need to do for the BCD

digits. Then we shift the binary number one bit left, add the BCD number to itself plus the

digit shifted out of the binary number. Each time we do what is described in this paragraph,

we end with a valid BCD number.

After shifting out the entire binary number (ending with a binary zero), we should have the

entire binary number represented in a valid BCD number. QED.

❤❤

Attachments:
Similar questions