The basics of binary

 

Adding two binary numbers together is like adding decimal numbers, except 1 + 1 = 10 (in binary, that is), so you have to carry the one to the next column: some examples:

    0001
+ 0100
  —-
  0101 (no carries to get this)

    0001
+ 0001
  —-
  0010 (1 plus 1 is 10, carry the 1 to the next column)

    0011
+ 0011
  —-
  0110 (1 + 1 = 10, so carry; then 1 + 1 + 1 = 11, so carry again)

Base 10:

0000 = 0
0001 = 1
0010 = 2
0011 = 3
0100 = 4
0101 = 5
0110 = 6
0111 = 7
1000 = 8
1001 = 9

1 bit (b) = 0 or 1 = one binary digit

  • 1 kilobit ( kb) = 10^3 bits = 1,000 bits
  • 1 Megabit (Mb) = 10^6 bits = 1,000,000 bits
  • 1 Gigabit (Gb) = 10^9 bits = 1,000,000,000 bits 
     
  • or….
  • 8bits = 1byte

    1024bytes=1kb

    1024kbites=1mb

    1024mbs=1gb

    1024gb=1tb

     The Standard ASCII Character Set

             Today we learned about ASCII and the relationship between words and binary codes. Here is a chart:

        Least Significant Bits
        0
    0000
    1
    0001
    2
    0010
    3
    0011
    4
    0100
    5
    0101
    6
    0110
    7
    0111
    8
    1000
    9
    1001
    A
    1010
    B
    1011
    C
    1100
    D
    1101
    E
    1110
    F
    1111
    M
    o
    s
    tS
    i
    g
    n
    i
    f
    i
    c
    a
    n
    tB
    i
    t
    s

     

    0
    000
    NUL
    (0)
    00
    SOH
    (1)
    01
    STX
    (2)
    02
    ETX
    (3)
    03
    EOT
    (4)
    04
    ENQ
    (5)
    05
    ACK
    (6)
    06
    BEL
    (7)
    07
    BS
    (8)
    08
    HT
    (9)
    09
    LF
    (10)
    0A
    VT
    (11)
    0B
    FF
    (12)
    0C
    CR
    (13)
    0D
    SO
    (14)
    0E
    SI
    (15)
    0F
    1
    001
    DLE
    (16)
    10
    DC1
    (17)
    11
    DC2
    (18)
    12
    DC3
    (19)
    13
    DC4
    (20)
    14
    NAK
    (21)
    15
    SYN
    (22)
    16
    ETB
    (23)
    17
    CAN
    (24)
    18
    EM
    (25)
    19
    SUB
    (26)
    1A
    ESC
    (27)
    1B
    FS
    (28)
    1C
    GS
    (29)
    1D
    RS
    (30)
    1E
    US
    (31)
    1F
    2
    010
    SP
    (32)
    20
    !
    (33)
    21

    (34)
    22
    #
    (35)
    23
    $
    (36)
    24
    %
    (37)
    25
    &
    (38)
    26

    (39)
    27
    (
    (40)
    28
    )
    (41)
    29
    *
    (42)
    2A
    +
    (43)
    2B
    ,
    (44)
    2C
    -
    (45)
    2D
    .
    (46)
    2E
    /
    (47)
    2F
    3
    011
    0
    (48)
    30
    1
    (49)
    31
    2
    (50)
    32
    3
    (51)
    33
    4
    (52)
    34
    5
    (53)
    35
    6
    (54)
    36
    7
    (55)
    37
    8
    (56)
    38
    9
    (57)
    39
    :
    (58)
    3A
    ;
    (59)
    3B
    <
    (60)
    3C
    =
    (61)
    3D
    >
    (62)
    3E
    ?
    (63)
    3F
    4
    100
    @
    (64)
    40
    A
    (65)
    41
    B
    (66)
    42
    C
    (67)
    43
    D
    (68)
    44
    E
    (69)
    45
    F
    (70)
    46
    G
    (71)
    47
    H
    (72)
    48
    I
    (73)
    49
    J
    (74)
    4A
    K
    (75)
    4B
    L
    (76)
    4C
    M
    (77)
    4D
    N
    (78)
    4E
    O
    (79)
    4F
    5
    101
    P
    (80)
    50
    Q
    (81)
    51
    R
    (82)
    52
    S
    (83)
    53
    T
    (84)
    54
    U
    (85)
    55
    V
    (86)
    56
    W
    (87)
    57
    X
    (88)
    58
    Y
    (89)
    59
    Z
    (90)
    5A
    [
    (91)
    5B
    \
    (92)
    5C
    ]
    (93)
    5D
    ^
    (94)
    5E
    _
    (95)
    5F
    6
    110
    `
    (96)
    60
    a
    (97)
    61
    b
    (98)
    62
    c
    (99)
    63
    d
    (100)
    64
    e
    (101)
    65
    f
    (102)
    66
    g
    (103)
    67
    h
    (104)
    68
    i
    (105)
    69
    j
    (106)
    6A
    k
    (107)
    6B
    l
    (108)
    6C
    m
    (109)
    6D
    n
    (110)
    6E
    o
    (111)
    6F
    7
    111
    p
    (112)
    70
    q
    (113)
    71
    r
    (114)
    72
    s
    (115)
    73
    t
    (116)
    74
    u
    (117)
    75
    v
    (118)
    76
    w
    (119)
    77
    x
    (120)
    78
    y
    (121)
    79
    z
    (122)
    7A
    {
    (123)
    7B
    |
    (124)
    7C
    }
    (125)
    7D
    ~
    (126)
    7E
    DEL
    (127)
    7F

     

     

    
    Method 2:
    
    So, how can I convert the binary number 1101 to a good-old decimal number? The best way to this is construct a table in which you can do some simple arithmetic operations to solve the conversion! Let’s try it! 
    
    1.         First, I want to write the binary number in a row, separating the digits into columns: 
    
    Number 1 1 0 1
    2.          3.        Next, I want to decide whether each digit placeholder is “ON” or “OFF.” The reason for this will become a little clearer in a few minutes, but for right now just remember that a “1″ is “ON” and a “0″ is “OFF.” When we calculate the exponential expressions, we don’t have to calculate any digit placeholders that are turned off:
    Number 1 1 0 1
    ON/OFF ON ON OFF ON
    4.         5.        In the third step, we write the exponential expressions (”powers of two”) that represent each placeholder and multiply each expression by 1. We do this only for the placeholders that are turned ON. For the placeholders which are turned OFF, we simply bring down the zero from the number itself:
    Number 1 1 0 1
    ON/OFF ON ON OFF ON
    Exponential Expression 23*1 22*1 0 20*1
    6.         7.        Now, we can calculate the exponents to get a simple multiplication expression for each placeholder. Again, we do this only for placeholders which are turned “ON.” Again, we bring down the zero if the placeholder is turned “OFF”:
    Number 1 1 0 1
    ON/OFF ON ON OFF ON
    Exponential Expression 23*1 22*1 0 20*1
    Calculated Exponent 8*1 4*1 0 1*1
    8.          9.       In the fifth step, we solve the multiplication expressions from step #4. Again, we bring down any zeros for placeholders which are turned OFF:
    Number 1 1 0 1
    ON/OFF ON ON OFF ON
    Exponential Expression 23*1 22*1 0 20*1
    Calculated Exponent 8*1 4*1 0 1*1
    Solved Multiplication 8 4 0 1
    10.       11.       In the final step, we add all the multiplication answers from step #5 together to get our decimal number!
    Number 1 1 0 1
    ON/OFF ON ON OFF ON
    Exponential Expression 23*1 22*1 0 20*1
    Calculated Exponent 8*1 4*1 0 1*1
    Solved Multiplication 8 4 0 1
    Add to Calculate Decimal Value 8+4+0+1=13
      Let’s take a look at another conversion. This time, we’ll try 101101:
    Number 1 0 1 1 0 1
    ON/OFF ON OFF ON ON OFF ON
    Exponential Expression 25*1 0 23*1 22*1 0 20*1
    Calculated Exponent 32*1 0 8*1 4*1 0 1*1
    Solved Multiplication 32 0 8 4 0 1
    Add to Calculate Decimal Value 32+0+8+4+0+1=45
          Why not try some on your own? Convert the following from binary to decimal. Click the answers link for each table for that table’s correct answers:
    Number 1 1 1
    ON/OFF      
    Exponential Expression      
    Calculated Exponent      
    Solved Multiplication      
    Add to Calculate Decimal Value  
    Answer  
     
    Number 1 0 1 1
    ON/OFF        
    Exponential Expression        
    Calculated Exponent        
    Solved Multiplication        
    Add to Calculate Decimal Value  
    Answer
     
    Number 1 0 1 1 1
    ON/OFF          
    Exponential Expression          
    Calculated Exponent          
    Solved Multiplication          
    Add to Calculate Decimal Value  
    Answer
     
    Number 1 1 1 1 0 0
    ON/OFF            
    Exponential Expression            
    Calculated Exponent            
    Solved Multiplication            
    Add to Calculate Decimal Value  
    Answer
     
    [Top of the Page]
        Method 3: Binary numbers all consist of combinations of the two digits ‘0′ and ‘1′. These are some examples of binary numbers: 1 10 1010 11111011 11000000 10101000 00001100 01011101 Engineers and mathematicians sometimes call the binary numbering system a base-two system because binary numbers only contain two digits. By comparison, our normal decimal number system is a base-ten system. Hexadecimal numbers (discussed later) are a base-sixteen system. Converting From Binary to Decimal Numbers All binary numbers have equivalent decimal representations and vice versa. Our handy Binary-Decimal Number Converter performs these calculations automatically for you. To convert binary and decimal numbers manually, you must apply the mathematical concept of positional values. The positional value concept is simple: With both binary and decimal numbers, the actual value of each digit depends on its position (how “far to the left”) within the number. For example, in the decimal number 124, the digit ‘4′ represents the value “four,” but the digit ‘2′ represents the value “twenty,” not “two.” The ‘2′ represents a larger value than the ‘4′ in this case because it lies further to the left in the number. Likewise in the binary number 1111011, the rightmost ‘1′ represents the value “one,” but the leftmost ‘1′ represents a much higher value (”sixty-four” in this case). In mathematics, the base of the numbering system determines how much to value digits by position. For base-ten decimal numbers, multiply each digit on the left by a progressive factor of 10 to calculate its value. For base-two binary numbers, multiply each digit on the left by a progressive factor of 2. Calculations always work from right to left. In the above example, the decimal number 123 works out to: 3 + (10 * 2) + (10*10 * 1) = 123 and the binary number 1111011 converts to decimal as: 1 + (2 * 1) + (2*2 * 0) + (4*2 * 1) + (8*2 * 1)+ (16*2 * 1) + (32*2 * 1) = 123 Therefore, the binary number 1111011 is equal to the decimal number 123. Converting From Decimal to Binary Numbers To convert numbers in the opposite direction, from decimal to binary, requires successive division rather than progressive multiplication. Our Binary-Decimal Number Converter also performs these calculations automatically for you. To manually convert from a decimal to a binary number, start with the decimal number and begin dividing by the binary number base (base “two”). For each step the division results in a remainder of 1, use ‘1′ in that position of the binary number. When the division results in a remainder of 0 instead, use ‘0′ in that position. Stop when the division results in a value of 0. The resulting binary numbers are ordered from right to left. For example, the decimal number 109 converts to binary as follows: 109 / 2 = 54 remainder 1 54 / 2 = 27 remainder 0 27 / 2 = 13 remainder 1 13 / 2 = 6 remainder 1 6 / 2 = 3 remainder 0 3 / 2 = 1 remainder 1 1 / 2 = 0 remainder 1 Therefore the decimal number 109 equals the binary number 1101101.

    ~ by marksblogcentral on December 12, 2008.

    Leave a Reply