Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3 . ( 2 0 points ) Recall from class that BCD stands for Binary Coded Decimal. It is a representation of decimal integers by
points
Recall from class that BCD stands for Binary Coded Decimal. It is a representation of decimal integers by encoding each digit with a bit string. In some more advanced calculating devices, the calculations are done in binary and then they are converted to BCD in order to print the result in decimal. There is an algorithm called Double Dabble that converts binary into BCD Here is a summary of the algorithm and an example:
You first initialize your binary number to the right of a divider.
Shift the number to the left one bit at a time, filling in bit registers.
If at any point in the shifting, the number in one of the bit registers is greater than or equal to add three to that register, then continue.
Terminate when the entire binary number has been shifted to the left of the divider.
Consider the example with the initial binary number: :
Initialize
Shift
Shift
Since we add
Shift.
Shift..
O
Since we add
Shift.
Since we add
Since we add
Shift.
Shift.
Shift.
Since we add
Shift. Terminate.
a points Perform this algorithm on the binary number:
b points If a straight binary number n is bits long, what is the maximum number of bits required for the BCD representation of n
c points Why do you add Hint: every time you shift to the left, you essentially double the integer to the left of the divider. What is the result of adding then doubling?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started