8 bit hex demcial number to bit 8 bit decimal number

Discussion in 'Homework Help' started by jokester4u, Mar 21, 2013.

  1. jokester4u

    Thread Starter New Member

    Nov 3, 2012
    26
    0
    how do i convert 8 bit hex demcial number to bit 8 bit decimal number using logic gates?
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,365
    This question is not clear.
    An 8-bit hexadecimal number and an 8-bit decimal number are both the same. No conversion is required.

    There are 10 types of people in the world, those who understand binary and those who don't.
     
  3. Robin Mitchell

    Well-Known Member

    Oct 25, 2009
    734
    200
    I take what he is asking is how does one take an 8 bit binary number and converts it to an easy to read decimal number like for example, FF converts to 255.

    The answer is that you dont bother with logic gates or any from the standard series such as the 4000. You are best off using a PIC or AVR and driving three 7 segment displays.
     
  4. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,365
    The question is not clear.
    An 8-bit number can represent positive integers from 0 to 255.
    To represent this as binary coded decimal (BCD) digits you would require three BCD digits.
    Hence you would required at least 10 bits of BCD, not eight.
     
  5. jokester4u

    Thread Starter New Member

    Nov 3, 2012
    26
    0
    my task is take 49 as 8 bit hexadecimal number. design the hard ware and verify the output using logic gates to convert them to its equivalent 8 bit decimal number.
     
  6. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,365
    You are still not clear. You have to be precise with your wording.

    Is 49 = 0100 1001

    or 49 = 0011 0001
     
  7. jokester4u

    Thread Starter New Member

    Nov 3, 2012
    26
    0
    its 00110001

    i checked it on internet how to calculate it manually?
     
  8. jokester4u

    Thread Starter New Member

    Nov 3, 2012
    26
    0
    hex decimal to binary is 0100 1001
    decimal to binary is 00110001

    my question is for hex decimal then its the first one
     
  9. panic mode

    Senior Member

    Oct 10, 2011
    1,321
    304
    ok, so you need to do conversion between binary decimal and BCD and you need to do conversion using combinational logic.

    manually you would say

    bindec_value = 49;
    bcd_digit0 = bindec_value mod 10;
    bcd_digit1 = bindec_value div 10;

    so you can get the job done by implementing mod and div functions for example. you could reduce it since 10 is a constant. but this is not efficient approach.

    better way is to deduce 8 functions (one for each bit of output). for example lsb is same in both cases (i just handed you sollution to 1/8 of the problem)
     
  10. jokester4u

    Thread Starter New Member

    Nov 3, 2012
    26
    0
    i aint get anything. can you make 1 for me the rest i will do by my self
     
  11. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Search for binary to BCD and BCD to binary

    there are several methods around, it's not trivial with logic gates.

    Binary is what you are calling "Hex"
    BCD is what you are calling "Binary"

    BCD is Binary Coded Decimal, where each group of 4 bits represents a base 10 integer number between 0 and 9, so it can be "read" 4 bits at a time into common human numbers (base 10). BCD is not common these days. There used to be a BCD to binary logic IC. If you look for the datasheet, you'll see the solution.

    Binary (not BCD) can be displayed as hex, or decimal, or any format, and uses the "full span" of available binary digit space.
     
  12. absf

    Senior Member

    Dec 29, 2010
    1,493
    372
    Binary to BCD converter?

    Take a look at the 74185 datasheet here -

    http://www.utm.edu/staff/leeb/DM74185.pdf

    Allen
     
    Last edited: Mar 21, 2013
Loading...