Express the following # in BCD using six digits

  • Thread starter Duderonimous
  • Start date
Remember to always clarify what type of BCD representation you're using (packed or unpacked) when doing these conversions.
  • #1
Duderonimous
63
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
  • #2
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:
  • #3
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
  • #4
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?
 
  • #5
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
  • #6
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
  • #7
Thank you sir!
 
  • #8
You're welcome!
 

1. What is BCD and how is it used in scientific research?

BCD stands for Binary-Coded Decimal and it is a way of representing numbers in binary form using decimal digits. In scientific research, BCD is often used for storing and manipulating numerical data in a more efficient and accurate way than using traditional binary or decimal systems.

2. How do you convert a number to BCD using six digits?

To convert a number to BCD using six digits, you need to first break down the number into individual digits. Then, each digit is converted to its binary form and arranged in groups of four. These groups are then converted back to decimal form to create the final BCD representation.

3. Can BCD be used for all types of numbers?

BCD is primarily used for representing decimal numbers, so it is not suitable for numbers with fractions or complex numbers. However, BCD can be used to represent both positive and negative numbers.

4. What are the advantages of using BCD in scientific calculations?

BCD has a higher accuracy compared to traditional binary systems, as it can represent decimal numbers without any rounding errors. It also allows for easier and faster arithmetic operations, making it ideal for scientific calculations where precision is crucial.

5. Are there any limitations to using BCD?

One limitation of BCD is that it requires more storage space compared to binary or decimal systems, as each digit is represented by four bits instead of one. This can lead to larger file sizes and slower processing times. Additionally, BCD is not commonly used in modern computing systems, so it may not be compatible with certain software or hardware.

Back
Top