GATE Computer ScienceHardGATE CS (PYQ pattern)
The double-dabble algorithm converts the 8-bit binary number 10110111 (183) to BCD. Before each of the 8 shifts, every BCD digit that is 5 or more has 3 added to it. How many such 'add 3' corrections (counted per digit) occur in total?
- A. 2
- B. 3
- C. 4
- D. 5
Correct answer: B. 3
Trace the algorithm: before each shift, add 3 to every BCD digit that is at least 5. Over the 8 shifts this happens 3 times in total, ending with 0001 1000 0011 = 183.
More Digital Logic questions
- A CRC-8 uses the generator polynomial x⁸ + x² + x + 1 (0x107), initial register value 0 and no final XOR. What is the CRC of the single…
- The Internet checksum (one's complement of the 16-bit one's complement sum) of the words 0xF0F0, 0x0F0F, 0x8001, 0xFFFF is 0x7FFE. Which…
- The (8, 4) extended Hamming code is the (7, 4) Hamming code with an overall even-parity bit appended. How many of its 16 codewords have…
- A 4 × 4 block of data bits is protected by two-dimensional even parity: a parity bit per row, a parity bit per column and a corner bit…
- Which of the following are true? (Python-style double precision for I, III, IV; single precision rounding for II.) I. adding 0.1 to a…
- A 5-bit asynchronous up-counter Q4..Q0 (Q4 the MSB) has its active-low asynchronous clear driven by a 3-input NAND of Q4, Q1 and Q0. The…