5 | 7 | 2 | 4 | Face value |
103 | 102 | 101 | 100 | Positional Value (powers of 10) |
1000 | 100 | 10 | 1 | Resolved positional value |
To figure out the value of 5724, we do the following:
5 x 103 = 5 x 1000 = |
|
7 x 102 = 7 x 100 = |
700
|
2 x 101 = 2 x 10 = |
20
|
4 x 100 = 4 x 1 = |
4
|
5724
|
Binary Numbering systems:
The binary numbering system works much the same way as the decimal numbering
system except that now we are in base 2 so we only have 2 digits (0, 1). The
value of the number is still determined by the face value times the positional
value, but since we are in base 2, the positional values are the powers of 2.
Since the face values can only be 0 or 1, this means that the 0 or 1 is multiplied
by the positional place in which it is found.
Example: binary number 1011011
1 | 0 | 1 | 1 | 0 | 1 | 1 | Face value |
26 | 25 | 24 | 23 | 22 | 21 | 20 | Positional value |
64 | 32 | 16 | 8 | 4 | 2 | 1 | Resolved positional value |
The positional values are first shown in the powers of 2 and then as the resolved
number - in other words, 2 to the 6th is equal to 64.
Converting binary to decimal:
In the previous example to find the decimal equivalent for the number 1011011,
we do the following:
1 x 26 = 1 x 64 = |
64
|
0 x 25 = 0 x 32 = |
0
|
1 x 24 = 1 x 16 = |
16
|
1 x 23 = 1 x 8 = |
8
|
0 x 22 = 0 x 4 = |
0
|
1 x 21 = 1 x 2 = |
2
|
1 x 20 = 1 x 1 = |
1
|
91
|
Converting decimal to binary:
Before doing this it is important that we review the decimal equivalent for
the frequently used powers of 2:
20 = 1 | 21 = 2 | 22 = 4 | 23 = 8 | 24 = 16 | 25 = 32 |
26 = 64 | 27 = 128 | 28 = 256 | 29 = 512 | 210 = 1024 | etc. |
1
|
_____
|
_____
|
_____
|
_____
|
_____
|
_____
|
26
|
25
|
24
|
23
|
22
|
21
|
20
|
64
|
32
|
16
|
8
|
4
|
2
|
1
|
1
|
0
|
_____
|
_____
|
_____
|
_____
|
_____
|
26
|
25
|
24
|
23
|
22
|
21
|
20
|
64
|
32
|
16
|
8
|
4
|
2
|
1
|
1
|
0
|
1
|
_____
|
_____
|
_____
|
_____
|
26
|
25
|
24
|
23
|
22
|
21
|
20
|
64
|
32
|
16
|
8
|
4
|
2
|
1
|
1
|
0
|
1
|
1
|
_____
|
_____
|
_____
|
26
|
25
|
24
|
23
|
22
|
21
|
20
|
64
|
32
|
16
|
8
|
4
|
2
|
1
|
1
|
0
|
1
|
1
|
0
|
_____
|
_____
|
26
|
25
|
24
|
23
|
22
|
21
|
20
|
64
|
32
|
16
|
8
|
4
|
2
|
1
|
1
|
0
|
1
|
1
|
0
|
1
|
_____
|
26
|
25
|
24
|
23
|
22
|
21
|
20
|
64
|
32
|
16
|
8
|
4
|
2
|
1
|
1
|
0
|
1
|
1
|
0
|
1
|
1
|
26
|
25
|
24
|
23
|
22
|
21
|
20
|
64
|
32
|
16
|
8
|
4
|
2
|
1
|
Binary counting:
Now, we are going to learn to count in binary and relate counting in binary
to counting in decimal. 0 and 1 are the same values in binary and decimal but
then we come to add 1 to 1 and we discover that there is no 2 in binary. Essentially
we have run out of digits. We stop and think what we do in decimal when we run
out of digits and we get the pattern to use in binary. For example, in decimal
when we try to add 1 to 9, we run out of digits.
In decimal: |
9
|
In binary: |
1
|
|
+1
|
+1
|
|||
10
|
10
|
10
|
11
|
100
|
101
|
110
|
111
|
1000
|
+ 1
|
+ 1
|
+ 1
|
+ 1
|
+ 1
|
+ 1
|
+ 1
|
11
|
100
|
101
|
110
|
111
|
1000
|
1001
|
Decimal
|
Binary
|
0
|
0
|
1
|
1
|
2
|
10
|
3
|
11
|
4
|
100
|
5
|
101
|
6
|
110
|
7
|
111
|
8
|
1000
|
9
|
1001
|
10
|
1010
|
11
|
1011
|
12
|
1100
|
13
|
1101
|
14
|
1110
|
15
|
1111
|
16
|
10000
|
A | 3 | 5 | 9 | face value |
163 | 162 | 161 | 160 | positional value (powers of 16) |
4096 | 256 | 16 | 1 | resolved positional value |
A x 163 = | 10 x 4096 = |
40960
|
(note A is equivalent to decimal 10) |
3 x 162 = | 3 x 256 = |
768
|
|
5 x 161 = | 5 x 16 = |
80
|
|
9 x 160 = | 9 x 1 = |
9
|
|
|
|||
41817
|
160 = 1 | 161 = 16 | 162 = 256 | 163 = 4096 | 164 = 65536 |
A | _____ | _____ | _____ |
163 | 162 | 161 | 160 |
4096 | 256 | 16 | 1 |
A | 3 | _____ | _____ |
163 | 162 | 161 | 160 |
4096 | 256 | 16 | 1 |
A | 3 | 5 | _____ |
163 | 162 | 161 | 160 |
4096 | 256 | 16 | 1 |
A | 3 | 5 | 9 |
163 | 162 | 161 | 160 |
4096 | 256 | 16 | 1 |
Binary
|
Decimal
|
Hexadecimal
|
0
|
0
|
0
|
1
|
1
|
1
|
10
|
2
|
2
|
11
|
3
|
3
|
100
|
4
|
4
|
101
|
5
|
5
|
110
|
6
|
6
|
111
|
7
|
7
|
1000
|
8
|
8
|
1001
|
9
|
9
|
1010
|
10
|
A
|
1011
|
11
|
B
|
1100
|
12
|
C
|
1101
|
13
|
D
|
1110
|
14
|
E
|
1111
|
15
|
F
|
10000
|
16
|
10
|
10001
|
17
|
11
|
10010
|
18
|
12
|
Binary
|
Hexadecimal
|
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
|
1100/ | 1111 | 1100 is C and 1111 is F |
C
|
F
|
|
therefore the hexadecimal equivalent of 11001111 is CF |
11010101110101 = | 11/ | 0101/ | 0111/ | 0101 |
3
|
5
|
7
|
5
|
5
|
E
|
4
|
9
|
0101
|
1110
|
0100
|
1001
|
_ | _ | _ | _ | _ | _ | _ | _ |
z | o | n | e/ | d | i | g | it |
code | range |
00 | A - I |
01 | J - R |
10 | S - Z |
11 | numbers |
digit: | __ | __ | __ | __ |
23 | 22 | 21 | 20 | |
8 | 4 | 2 | 1 |
0 | 1 | 1 | 0 |
23 | 22 | 21 | 20 |
8 | 4 | 2 | 1 |
0 | 1 | 0 | 0 |
23 | 22 | 21 | 20 |
8 | 4 | 2 | 1 |
1 | 0 | 0 | 1 |
23 | 22 | 21 | 20 |
8 | 4 | 2 | 1 |
0 | 0 | 1 | 0 |
23 | 22 | 21 | 20 |
8 | 4 | 2 | 1 |
Binary
|
Hexadecimal
|
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
|
1. |
F = 11000110
|
1100
|
0110
|
in EBCDIC |
C
|
6
|
hexadecimal translation of EBCDIC | ||
2. |
M = 11010100
|
1101
|
0100
|
in EBCDIC |
D
|
4
|
hexadecimal translation of EBCDIC | ||
3. |
9 = 11111001
|
1111
|
1001
|
in EBCDIC |
F
|
9
|
hexadecimal translation of EBCDIC | ||
4. |
S = 11100010
|
1110
|
0010
|
in EBCDIC |
E
|
2
|
hexadecimal translation of EBCDIC |
Characters
|
EBCDIC Zone
|
Hexadecimal representation
|
A -I
|
1100
|
C
|
J - R
|
1101
|
D
|
S - Z
|
1110
|
E
|
numbers
|
1111
|
F
|
A = | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | Face value |
27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | Powers of 2 | |
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | Positional value from appropriate power of 2 |
Character | EBCDIC Equivalent | Character | EBCDIC Equivalent |
A | 193 | N | 213 |
B | 194 | O | 214 |
C | 195 | P | 215 |
D | 196 | Q | 216 |
E | 197 | R | 217 |
F | 198 | S | 226 |
G | 199 | T | 227 |
H | 200 | U | 228 |
I | 201 | V | 229 |
J | 209 | W | 230 |
K | 210 | X | 231 |
L | 211 | Y | 232 |
M | 212 | Z | 233 |
__ | __ | __ | __ |
23 | 22 | 21 | 20 |
8 | 4 | 2 | 1 |
0 | 0 | 0 | 0 |
23 | 22 | 21 | 20 |
8 | 4 | 2 | 1 |
1 | 0 | 0 | 1 |
23 | 22 | 21 | 20 |
8 | 4 | 2 | 1 |
__ | __ | __ | __ | __ | face value |
24 | 23 | 22 | 21 | 20 | positional value in powers of 2 |
16 | 8 | 4 | 2 | 1 | positional value in decimal |
__ | __ | __ | __ | 1 | face value |
24 | 23 | 22 | 21 | 20 | positional value in powers of 2 |
16 | 8 | 4 | 2 | 1 | positional value in decimal |
0 | 1 | 1 | 0 | 0 | face value |
24 | 23 | 22 | 21 | 20 | positional value in powers of 2 |
16 | 8 | 4 | 2 | 1 | positional value in decimal |
1 | 1 | 0 | 1 | 0 | face value |
24 | 23 | 22 | 21 | 20 | positional value in powers of 2 |
16 | 8 | 4 | 2 | 1 | positional value in decimal |
__ | __ | __ | __ | __ | __ | __ | face value |
26 | 25 | 24 | 23 | 22 | 21 | 20 | positional value in powers of 2 |
64 | 32 | 16 | 8 | 4 | 2 | 1 | positional value in decimal |
1 | 0 | 0 | 1 | 1 | 0 | 0 | face value |
26 | 25 | 24 | 23 | 22 | 21 | 20 | positional value in powers of 2 |
64 | 32 | 16 | 8 | 4 | 2 | 1 | positional value in decimal |
1 | 0 | 1 | 1 | 0 | 1 | 0 | face value |
26 | 25 | 24 | 23 | 22 | 21 | 20 | positional value in powers of 2 |
64 | 32 | 16 | 8 | 4 | 2 | 1 | positional value in decimal |
Character | ASCII Equivalent | Character | ASCII Equivalent |
A | 65 | N | 78 |
B | 66 | O | 79 |
C | 67 | P | 80 |
D | 68 | Q | 81 |
E | 69 | R | 82 |
F | 70 | S | 83 |
G | 71 | T | 84 |
H | 72 | U | 85 |
I | 73 | V | 86 |
J | 74 | W | 87 |
K | 75 | X | 88 |
L | 76 | Y | 89 |
M | 77 | Z | 90 |