FSUIPC: Lua Tutorial
For Microsoft Flight Simulator and GoFlight Equipment

 

Home
About Lua
Executing Code
Binary
Hexadecimal
Bits & Bytes
Memory Offsets
Variables
The Code
The Editor
Get Started
FlightSim
Cleaning Up
Assignments

 

Hexadecimal

    Hexadecimal is a mathematical system based on 16. So what happens when we get to 10? It turns into the letter A, which represents 10.

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

    Simple eh?  OK, maybe not... open your calculator again and enter your birth year. Now click the Hex button. Mine comes out to 7B1. Wait!!! Stop everything!!! How the heck do you get a three digit "number" out of a four digit number???

Simple, it's the letters. Keep in mind, we can fit more numbers into a single spot. Let's go back to the calculator and enter our age. I'm 42!!! And I get 2A!!!

Let's count it up
0 = 0
1 = 1
2 = 2
3 = 3
4 = 4
5 = 5
6 = 6
7 = 7
8 = 8
9 = 9
A = 10
B = 11
C = 12
D = 13
E = 14
F = 15
10 = 16
11 = 17
12 = 18
13 = 19
14 = 20
15 = 21
16 = 22
17 = 23
18 = 24
19 = 25
1A = 26
1B = 27
1C = 28
1D = 29
1E = 30
1F = 31
20 = 32
21 = 33
22 = 34
23 = 35
24 = 36
25 = 37
26 = 38
27 = 39
28 = 40
29 = 41
2A = 42
2B = 43
2C = 44
2D = 45
2E = 46
2F = 47
30 = 48

    Do you see a pattern? 10, 20 30?  16, 32, 48... Each first place number is 16 times more.

    So what moron decided to go by binary and hexadecimal. This guy did! But it's a good system to fit more data in smaller spaces.

    So let's move on...

 


Written by
Joseph "Skittles" Cardana
skittles(at)anadrac.com
Updated: 2011-08-25 07:49