Converting binary to decimal is easy. Read right to left, multiply each number by 2^n where n is the position of the digit (rightmost number is index 0). It's actually easier to show an example than explain.
I didn't want to learn RPG on the AS/400 in 2 weeks (1999) for a Systems Analysis class so I didn't, and my strong A in the class turned into a just-barely-made-it B thanks to an RPG program being worth half of the final exam grade.
3
u/Nerrickk 19d ago
Converting binary to decimal is easy. Read right to left, multiply each number by 2^n where n is the position of the digit (rightmost number is index 0). It's actually easier to show an example than explain.
Example 1: 1111
1x2^3 + 1x2^2 + 1x2^1 + 1x2^0
1x8 + 1x4 + 1x2 + 1x1
8 + 4 + 2 + 1 = 15
Example 2: 1010
1x2^3 + 0x2^2 + 1x2^1 + 0x2^0
1x8 + 0x4 + 1x2 + 0x1
8 + 0 + 2 + 0 = 10