04-26-2013, 01:22 AM
(This post was last modified: 04-26-2013, 01:23 AM by newomaster.)
Okay, so a few people have asked me to make an explanation video on my youtube for this, so I did. I thought I would also post it here for the community as well.
My Video: https://www.youtube.com/watch?v=x8oPR61sdg0
The doubledabble algrorithm basically states: shift n times (n being bits in the binary starting number) if the total in any of the BCD digits is over 4, then add 3 before shifting again.
BCD number binary starting number
0000 0000 11111 starting number (31 in binary)
0000 0001 11110 First shift
0000 0011 11100 Second shift
0000 0111 11000 Third shift
0000 1010 11000 Ones digit was over 4, add 3 before shifting again.
0001 0101 10000 Fourth shift
0001 1000 10000 Ones digit was over 4, add 3 before shifting again.
0011 0001 00000 Fifth shift
answer: 0011 0001 or 31 (yay it worked)
My Video: https://www.youtube.com/watch?v=x8oPR61sdg0
The doubledabble algrorithm basically states: shift n times (n being bits in the binary starting number) if the total in any of the BCD digits is over 4, then add 3 before shifting again.
BCD number binary starting number
0000 0000 11111 starting number (31 in binary)
0000 0001 11110 First shift
0000 0011 11100 Second shift
0000 0111 11000 Third shift
0000 1010 11000 Ones digit was over 4, add 3 before shifting again.
0001 0101 10000 Fourth shift
0001 1000 10000 Ones digit was over 4, add 3 before shifting again.
0011 0001 00000 Fifth shift
answer: 0011 0001 or 31 (yay it worked)