Express the following # in BCD using six digits

  • Thread starter Thread starter Duderonimous
  • Start date Start date
AI Thread Summary
The discussion focuses on converting the decimal number (99 7126) to Binary-Coded Decimal (BCD) using six digits. Participants clarify that BCD can be represented in packed or unpacked formats, with packed BCD using 4 bits per digit. The conversion from decimal to BCD for (99 7126) results in (1001 1001 0111 0001 0010 0110), which is confirmed to be six digits in packed BCD. For the second example, (43) in BCD is discussed, with the distinction between packed and unpacked formats highlighted. The consensus is that the conversion methods discussed are valid and the six-digit requirement is met in packed BCD.
Duderonimous
Messages
63
Reaction score
1

Homework Statement


Hello,

Express the following number in BCD using 6 digits:

(99 7126)base10

Homework Equations


Algorithm for changing (99 7126)base10→(N1)base8→(N2)base2

BCD table:
Decimal BCD
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001

The Attempt at a Solution


[/B]
(99 7126)base10→(N1)base8

997126/8=124640R6→d0
124640/8=15580R0→d1
15580/8=1947R4→d2
1947/8=243R3→d3
243/8=30R3→d4
30/8=3R6→d5
3/8=0R3→d6

N1=3633406

(3633406)base8→(N2)base2

N2= 011 110 011 011 100 000 110

In retorspect I realize that the above method is pointless.

I could directly convert the above number from decimal to BCD

but where does the "six-digits" factor. I would have much more then 6 digits when I convert that big number to BCD. Please help.
 
Physics news on Phys.org
Does does a 4 bit code count as 1 digit?

(99 7126)base10 to
(1001 1001 0111 0001 0010 0110)BCD

Does the above answer count as 6 digits in BCD?

The next problem is

(43)base10 to BCD in 6 digits

(0000 0000 0000 0000 0100 0011)BCD

Would this be BCD in 6 digits? Please help. Thanks
 
Last edited:
Duderonimous said:

Homework Statement


Hello,

Express the following number in BCD using 6 digits:

(99 7126)base10

Homework Equations


Algorithm for changing (99 7126)base10→(N1)base8→(N2)base2

BCD table:
Decimal BCD
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001

The Attempt at a Solution


[/B]
(99 7126)base10→(N1)base8

997126/8=124640R6→d0
124640/8=15580R0→d1
15580/8=1947R4→d2
1947/8=243R3→d3
243/8=30R3→d4
30/8=3R6→d5
3/8=0R3→d6

N1=3633406

(3633406)base8→(N2)base2

N2= 011 110 011 011 100 000 110

In retorspect I realize that the above method is pointless.

I could directly convert the above number from decimal to BCD

but where does the "six-digits" factor. I would have much more then 6 digits when I convert that big number to BCD. Please help.
I think you're on the wrong track here and are overthinking this. A decimal number can be converted to either unpacked BCD (each digit of the decimal number is stored in one byte) or packed BCD (each decimal digit stored in half a byte). You don't need to convert your decimal number into octal (base 8).

For example, in packed BCD, 9310 would be 1001 00112. In unpacked BCD 9310 would be 0000 1001 0000 00112.
 
  • Like
Likes Duderonimous
Ok. Then I guess the method I learned in class about converting decimal numbers to BCD is the packed BCD representation. So then could you read my second post? I understand the algorithm and converting to base 8 was unecessary. Is my thinking correct in the second post?
 
Duderonimous said:
Does does a 4 bit code count as 1 digit?

(99 7126)base10 to
(1001 1001 0111 0001 0010 0110)BCD

Does the above answer count as 6 digits in BCD?
Yes, six digits. Your (packed) BCD encoding is correct
Duderonimous said:
The next problem is

(43)base10 to BCD in 6 digits

(0000 0000 0000 0000 0100 0011)BCD

Would this be BCD in 6 digits? Please help. Thanks

Is it supposed to be packed BCD or unpacked BCD? If packed BCD, your answer looks good. If unpacked it would be 0000 0000 0000 0100 0000 0011 in binary.
 
  • Like
Likes Duderonimous
Duderonimous said:
Ok. Then I guess the method I learned in class about converting decimal numbers to BCD is the packed BCD representation. So then could you read my second post? I understand the algorithm and converting to base 8 was unecessary. Is my thinking correct in the second post?
Yes, what you have looks fine, now that you have clarified that you're doing packed BCD.
 
  • Like
Likes Duderonimous
Thank you sir!
 
Back
Top