Question about converting hex to decimal, binary to hex, etc

jsondjsond Member Posts: 66 ■■□□□□□□□□
I have just started my ccna traing and would like to know which conversions are necessary to know for the exam. Obviously binary to decimal and decimal to binary is necessary and I can do that fairly quickly. But out of the following, which (or all) are necessary:

BIN to HEX and HEX to BIN?...There is a helpful post below about this so I would guess yes.

HEX to DEC and DEC to HEX? These I am having problems with. I am continuing to search for more explanatons as the ones I have read so far are confusing. HEX to DEC I can do but the only method that I have found that I understand takes some time...and DEC to HEX I am lost at this point on how to do.

I hope this isn't too broad of a question but any help would be appreciated. My main issues are:

Is it absolutely necessary to be able to convert HEX to DEC and DEC to HEX? All the others I can do and fairly quickly. But before I take too much time trying to learn those 2 I want to make sure its necessary for the exam.

Thanks in advance for any help.

Comments

  • porengoporengo Member Posts: 343
    The quick answer to your questions is...yes, you need to know those conversions. Perhaps the following link can help:

    http://www.techexams.net/forums/viewtopic.php?t=6881
  • jsondjsond Member Posts: 66 ■■□□□□□□□□
    jsond wrote:

    BIN to HEX and HEX to BIN?...There is a helpful post below about this so I would guess yes.

    thanks porengo! However that thread only mentions about HEX to BIN and BIN to HEX and that was the one I mentioned when I said there was a helpful post below..and it was a big help.

    However my main issue is converting DEC to HEX, as im still having problems with it. I can do HEX to DEC but the method I found takes me a while.

    So my main question is if you have to know DEC to HEX and HEX to DEC (all other conversions I can do) . I believe you probably need to, I just wanted to know for sure.
  • Omar78Omar78 Member Posts: 9 ■□□□□□□□□□
    The way i do it is like this..

    DEC > HEX

    this is easy because you just go to DEC to BIN to HEX e.g

    DEC = 66 and we want it in HEX

    convert 66 to BIN

    01000010
    8421 8421
    split into two: 0100 0010

    we have 4 in the left column and 2 in the right column which equals 42 in HEX

    easy? :)

    now HEX to DEC

    42 in HEX to DEC


    16 1
    4 2
    | |
    | |
    | ___ 1 x 2 = 2
    |______16 x 4 = 64

    add the two together = 66 in DEC

    hop eit helps..
  • jsondjsond Member Posts: 66 ■■□□□□□□□□
    thanks Omar that was helpful.

    The funny thing is I was just thinking that if I cannot convert DEC to HEX straight up (since the tut's I found are confusing) then I would do just like you said and convert DEC to BIN 1st and then covert the BIN to HEX. That is what I have been doing I just was hoping for a faster way. But to me that is easy. Maybe not the fastest way but it works for me.

    As far as your explanation about HEX to DEC, that is also the way I have been doing it but that was the one I mentioned takes time for me and wasn't sure if there was a faster way. I just worry I will take too much time if the HEX # is something like 2531 becasue then I have to:

    1 x 1 = 1
    3 x 16 = 48
    5 x 256 = 1280
    2 x 4096 = 8192

    add all the remainders: 1 + 48 + 1280 + 8192 = 9521(DEC)

    That is the way I have been doing it but takes me a little bit to figure out 5 x 256 and 2 x 4096, etc. In other words any HEX # that is more than 2 digits might take me some time. But either way what works works, I just don't want to spend too much time calculating since time is precious on this exam from what I have read.

    Thanks again!
  • emaddaouemaddaou Registered Users Posts: 1 ■□□□□□□□□□
    Hi guys, I read this thread and it was very helpful. During my studies for CCNA I'm writing all my steps and I'm finalizing them as free study and help source for anyone studying IP Network Fundamentals. In Particular about conversion among the base systems, I have created like 6 short articles explaining the Base Systems 10, 2, and 16, and the conversion methods among all the three types: Decimal, Binary, and Hexadecimal. you can find them at this link: Understanding IP Networks Fundamentals - CCNA HUB good luck with your Studies. Imad Daou at CCNA HUB
  • theodoxatheodoxa Member Posts: 1,340 ■■■■□□□□□□
    Decimal -> Hex:

    12806
    12806 / 16 = 800.375; 0.375 x 16 = (6)
    800 / 16 = 50; 0.0 x 16 = (0)
    50 / 16 = 3.125, 0.125 x 16 = (2)
    (3)

    0x3206

    Divide the decimal number by 16. write down the remainder. Repeat, writing down the remainder each time (from right to left - This is one case for programming where a stack comes in very handy) until the whole number = 0.

    BTW, this should work for any base, just substitute the base for 16.

    493 / 2 = 246 + (1)
    246 / 2 = 123 + (0)
    123 / 2 = 61 + (1)
    61 / 2 = 30 + (1)
    30 / 2 = 15 + (0)
    15 / 2 = 7 + (1)
    7 / 2 = 3 + (1)
    3 / 2 = 1 + (1)
    1 / 2 = 0 + (1)

    111101101
    R&S: CCENT CCNA CCNP CCIE [ ]
    Security: CCNA [ ]
    Virtualization: VCA-DCV [ ]
Sign In or Register to comment.