Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

How to create a Binary-to-BCD converter

How would I begin to create a Binary to BCD converter and write to code for it. Here is what I have to do. Design a logic circuit in AHDL that will convert a 5-bit binary input bin[4..0] into its equivalent 2-digit (only 6 output bits are needed) BCD value bcd[5..0]. The converter can handle numbers from 010 through 3110. Use a truth table to define this function. Please help

Lew

10 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Design a logic circuit in AHDL that will convert a 5-bit binary input bin[4..0] into its equivalent 2-digit (only 6 output bits are needed) BCD value bcd[5..0]. The converter can handle numbers from (0 through 31 decimal). Use a truth table to define this function

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Design a 2-bit binary adder using AHDL. the circuit will add the 2-bit numbers labled A2 A1 and B2 B1 to produce the 3-bit sum S3 S2 S1. There is a half and a full adder join together with one XOR with a HAND gate with C1 that connetd to a full adder with two XOR, two HAND and one OR.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Design a logic circuit that, when enabled with an active-high signal name en, will detect four different ranges of values for a 5-bit input number. the inputs are labled num4 through num0 and the outputs are labled range1 through range4. Range1, range2, and range3 each produce active-high outputs, while range4 produces an active-low out-put signal. Write Boolean expressions for each of the outputs. Hint: Use the greater-than-or-equal-to (>=) and less-than-or-equal-to(<=) symbols in the Boolean expression to detect the desired range of input value for each output

    outputs values detected

    range 1 4-12

    range 2 15-20

    range 3 18-24

    range 4 26-30

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    How would I begin to create a Binary to BCD converter and write to code for it. Here is what I have to do. Design a logic circuit in AHDL that will convert a 5-bit binary input bin[4..0] into its equivalent 2-digit (only 6 output bits are needed) BCD value bcd[5..0]. The converter can handle numbers from 010 through 3110. Use a truth table to define this function. Please help

    Lew

    --- Quote End ---

    Can you send answer to sothernyankee
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Also, I don't have the answer as of yet! I will get back to you as soon as I get it!!