HEX 101 math

Discussion in 'Models, Animations, and Particle Effects' started by XVicious, May 1, 2015.

Remove all ads!
  1. XVicious

    XVicious Established Member

    Joined:
    Jun 21, 2013
    Messages:
    427
    Likes Received:
    8
    INTRODUCTION TO HEX

    Hex 101 - base numbers overview

    -hex is a base 16 expression of numberical values.
    regular numbers are base 10, i.e. 1 10 20 30 40 (decimal).
    hex was derived from binary coded decimal (BCD)

    binary coded decimal placement bit value
    8 4 2 1
    --------
    1 1 1 1 = 15
    F = 15
    F = 1 1 1 1 binary

    hex characters
    0 1 2 3 4 5 6 7 8 9 A B C D E F

    hex numerical value equavalent
    0 - 9 = 0 - 9
    A = 10
    B = 11
    C = 12
    D = 13
    E = 14
    F = 15
    ---------------------------------
    byte = 8 bits
    byte of hex FF example
    FF = 255 decimal (unsigned; no negative or algebraic numbers)
    FF = 1111 1111 binary

    0F = 15 decimal
    0F = 0000 1111 binary

    ----------------------------------
    word OF hex 16 bits or 2 Bytes
    FF FF
    1111 1111 1111 1111 binary
    usigned decimal
    FFFF = 65535 dec
    ----------------------------------
    so hex values weight are give by the least on the very right
    to the most to the farther left.
    opposite of decimal values

    ; why? because hex was derived from binary and the fact is
    binary is weighted the same way.

    binary bit values are in the format of 2 ^ n (POWER OF 2 )
    2^0 = 1
    2^1 = 2
    2^2 = 4
    2^3 = 8
    2^4 = 16
    2^5 = 32
    2^6 = 64
    2^7 = 128
    2^8 = 256
    2^9 = 512
    AND SO ON...
    bit placement values
    512 256 128 64 32 16 8 4 2 1

    binary
    0010 0000 0000 = 512

    02 00 hex = 512

    note
    0010 = 2 in hex
    but sence the 02 hex is farther left in 0x0200h the decimal
    weight value is greater equaling 512 decimal
    ------------------------------------------
    binary brief ( nibble = 4 bits) to HEX
    0000 = 0
    0001 = 1
    0010 = 2
    0011 = 3
    0100 = 4
    0101 = 5
    0110 = 6
    0111 = 7
    1000 = 8
    1001 = 9
    1010 = A
    1011 = B
    1100 = C
    1101 = D
    1110 = E
    1111 = F

    bits are added to total sum
    -----------------------
    ascii and hex dec character equavalents
    [​IMG]

    end of indroduction.
     
    Last edited: May 1, 2015
  2. XVicious

    XVicious Established Member

    Joined:
    Jun 21, 2013
    Messages:
    427
    Likes Received:
    8
    If I missed anything, feel free to fill in the blanks
    for algebra and real number conversions
     
Our Host!