Binary, Hexadecimal & Anding.

Discussion in 'General Cisco Certifications' started by hexF5, Jun 22, 2007.

  1. hexF5

    hexF5 New Member

    2
    0
    11
    I'm currently doing the 1st semester of CCNA.
    And i'm finding that my maths is letting me down on Binary, Hexadecimal & Anding.
    Any good way's to practice these or good ways to remeber when adding or taking away & free.

    Got subnetting secrets booklet & how to subnet, but after a possible dummies way to do it all!

    Thanks in advance.
     
    Certifications: A+
    WIP: CCNA
  2. hbroomhall

    hbroomhall Petabyte Poster Gold Member

    6,624
    117
    224
    This question has come up before, and there are a number of posts which try and explain it differently.

    Search the forum for 'subnetting'.

    Harry.
     
    Certifications: ECDL A+ Network+ i-Net+
    WIP: Server+
  3. r.h.lee

    r.h.lee Gigabyte Poster

    1,011
    52
    105
    hexF5,

    Let's break down your problem into two sections:
    1. Number Systems
    2. Boolean Algebra

    First, number systems. This is a review of the "decimal number system." So you know that in the decimal number system, the possible digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. If the decimal number is single digit, then we use the "1s" column as follows:

    Code:
    1s
    =
    0
    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    Now, what happens when you try to add '1' to '9'? Simple, you reset the '9' to '0', then put a '1' to the left of the '0' to form "10." This is shown in the following table.

    Code:
    10s 1s
    === ==
    0   0
    0   1
    0   2
    0   3
    0   4
    0   5
    0   6
    0   7
    0   8
    0   9
    1   0
    
    Now, this might seem "stupidly logical" but it's basically the same thing with the binary number system and the hexadecimal number systems.

    With the binary number system, the possible digits are 0 and 1. That's it! It's not as "complicated" as the decimal system. So let's run through the first digit of a binary number.

    Code:
    1s
    =
    0
    1
    
    Just like in the decimal system where you go up to '9' and run out of digits, in binary you "run out of digits" once you reach '1'. So what do you do? Just like adding '1' to '9' in the decimal system, you reset the '1' to '0' and put a '1' to the left.

    Code:
    2s 1s
    == ==
     0  0
     0  1
     1  0
    
    Now, if the binary number system is relatively simpler than the decimal number system, then the hexadecimal number system is relatively more complicated than the decimal number system. See, the decimal number system has 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 as possible digits. The hexademical number system has 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F as possible digits. So just like the decimal and binary number systems I've mentioned above, here is how the hexadecimal number system works for the first digit.

    Code:
    1s
    ==
    0
    1
    2
    3
    4
    5
    6
    7
    8
    9
    A
    B
    C
    D
    E
    F
    
    Just like before, when you want to add '1' to 'F', you reset the 'F' to '0' then put a '1' to the left as follows.

    Code:
    16s 1s
    === ==
    0    0
    0    1
    0    2
    0    3
    0    4
    0    5
    0    6
    0    7
    0    8
    0    9
    0    A
    0    B
    0    C
    0    D
    0    E
    0    F
    1    0
    
    Now, notice the pattern that the far right digit, no matter whch number system, is the "1s" column. That's because each number system has what is know as a "base." The base for the decimal number system is 10. The way to remember is "DECimal" has the same prefix as "DECathelon." A DECathelon contains 10 sporting events. Similarly, the base for the binary number system is 2. The way to remember is "BInary" has the same prefix as "BIcycle" which has two wheels. The base for the hexadecimal is 16. The way to remember is that it has "HEX" and "DEC" in it. A HEXagon is the six sided shape that nuts and bolts come in. "DEC" was previously mentioned as 10. So reasonably, "HEXaDECimal" has something to do with '6' and '10'. Hey, let's just add them up to '16.'

    The importance of knowing what the "base" of a number system is because that is what determines the columns for the number system. For example:
    The decimal number system.
    Code:
     10^2 10^1 10^0
     ||   ||   ||
    100   10    1
    
    The binary number system
    Code:
    2^2 2^1 2^0
    ||  ||  ||
    4   2   1
    
    The hexadecimal number system
    Code:
    16^2 16^1 16^0
    ||   ||   ||
    32   16    1
    
    Now, let's talk about Boolean Algbra with concentration on the "AND" process. For this, it's good to understand and imagine a flashlight circuit.
    Code:
       Electrical Switch
               |
               v
     +--------+/ +-----------+
     |                       |
     |                       +-
     |                         3 <-- bulb
     |                       +-
     |                       |
     +-----[+ -][+ -]--------+
                  ^
                  |
                Batteries
    
    This is basically an electrical representation of a single binary digit. So when you have the switch in the off position you get the result of a dark light bulb. So think of the switch as a binary digit, either off or on, or 0 or 1 respectively in binary. Well, the Boolean Algebra of AND requires two bits, so let's add another switch to the flashlight circuit.

    Code:
            Switch #1  Switch #2
               |        |
               v        v
     +--------+/ +----+/ +---+
     |                       |
     |                       +-
     |                          3 <-- bulb
     |                       +-
     |                       |
     +-----[+ -][+ -]--------+
                  ^
                  |
                Batteries
    
    Now, let's start off with both switches in the off position. Without actually building this circuit, you can tell that the bulb is going to be off too. So switch #1 represents the first bit, switch #2 represents the second bit, and the bulb represents the results of the AND process. So in this case...
    Code:
    0
    AND
    0
    ===
    0
    
    Now, let's turn switch #2 on. That represents "0 AND 1." Once again, the bulb is going to be off because 0 AND 1 is 0.
    Code:
    0
    AND
    1
    ===
    0
    
    Now, let's turn switch #2 off and turn switch #1 on. That represents "1 AND 0." Once again, the bulb is going to be off because 1 AND 0 is 0.
    Code:
    1
    AND
    0
    ===
    0
    
    Now, let's keep switch #1 on and turn switch #2 on also. That represents "1 AND 1." Whoa, wait a sec, THE BULB IS FINALLY ON! That's because 1 AND 1 is 1.
    Code:
    1
    AND
    1
    ===
    1
    
    So in summary, the Boolean Algebra for the AND process are...
    Code:
    0 & 0 = 0
    0 & 1 = 0
    1 & 0 = 0
    1 & 1 = 1
    
    Now, at this point, Boolean Algebra is NOT the same as the binary numbering system. For example, 1 + 1 = 10 in the binary number system but 1 & 1 = 1 with the AND process.

    I hope this helps.
     
    Certifications: MCSE, MCP+I, MCP, CCNA, A+
    WIP: CCDA
  4. mrobinson52

    mrobinson52 Security Maven Gold Member

    194
    9
    74
    The Flashlight metaphor is the first time that Anding has made sense to me! Thanks! :D
     
    Certifications: A+, Network+, MCSA:Security, Security+
    WIP: CISSP
  5. MrNerdy

    MrNerdy Megabyte Poster

    544
    4
    0
    Practice, practice, practice & more practice and then it sinks in (just!:dry )
     
    Certifications: ECDL, CiscoIT1 & A+
    WIP: Girlfriend & Network+
  6. r.h.lee

    r.h.lee Gigabyte Poster

    1,011
    52
    105
    MrNerdy,

    Let's remember that only "perfect practice leads to perfection."
     
    Certifications: MCSE, MCP+I, MCP, CCNA, A+
    WIP: CCDA

Share This Page

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.