EMAC PRIMER Instruction Manual page 8

Table of Contents

Advertisement

(bit number)
number (2
). The binary number 11111111 can be converted to decimal by knowing the weights of each bit, as in
the example below:
bit #
7
6
5
4
3
2
1
0
sum of bits * weights
The three forms of numbers we will use in this manual are binary, hexadecimal (hex, for short) and decimal. Below is a
table of the binary, and hex equivalents of the decimal numbers 0 through 20.
DECIMAL
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Hexadecimal is used to represent binary values because it is very easy to convert numbers from binary to hexadecimal.
For example, to convert the following binary number to hexadecimal:
Start from the right digit and put the number into groups of four binary digits (bits). If there are not enough bits in the
number to make a full four bits in the group on the left side, add zeros to the left of the number.
Now replace the binary groups with their hexadecimal equivalents using the table above and you will get the following
result:
It is just as easy to convert hex to binary. Merely replace each hex digit with the corresponding 4 binary digits from the
table above and you have your binary number, for example:
In this manual you will see the words "least significant" or "low order" and "most significant" or "high order". These refer to
the mathematical weight of the part of a number that is being described. In all number systems the digit on the left end is
the most significant or high order digit and the digit on the right end is the least significant or low order digit. For example in
the binary number 00010010, the bit on the left end is the most significant bit and the bit on the right end is the least
significant bit. In the hex word 01FF the left two digits are the most significant byte (MSB) and the two right digits are the
weight
value
= decimal result
2
*
1
7
2
6
*
1
2
5
*
1
2
4
*
1
2
*
1
3
2
*
1
2
2
1
*
1
2
0
*
1
HEX
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
10
11
12
13
14
0101 1011 0110 1011
1111 1100 0001 1000
= 128
=
64
=
32
=
16
=
8
=
4
=
2
=
1
= 255
BINARY
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
10000
10001
10010
10011
10100
101101101101011
5
B
6
B
HEX
F
C
1
8
BINARY
8

Advertisement

Table of Contents
loading

Table of Contents