EveryCircuit
Powering up...
Circuit
Public
Private
Unlisted
Save

Convert HEXA to BCD using The Double Dabble algorithm

@sandfree
1 year ago
https://everycircuit.com/circuit/6531361875820544
The Double Dabble algorithm: 1. - A binary register (stores the original binary number).    - A BCD register (stores the result, initially zero).    - A counter (set to the number of bits in the binary number). In our example, that equals 6 2. For each bit (from MSB to LSB):    - Shift left the binary and BCD registers.    - Check each BCD digit (4-bit nibble):      - If a digit is ≥5 (0101), add 3 (0011) to it.    - Decrement the counter.
Comments
Post