Systems, Numeric Codes, and Conversions
Systems, Numeric Codes, and Conversions
( 0)
623 =6x10 +2 )2x10
( +3x10
1) (
623 = 6 hundreds + 2 tens + 3 units
page 1
UNIT 1 FUNDAMENTALS OF LOGIC CIRCUITS
+ −
−
Ec.1
Where:
: ú
: í ó
: í
:
The binary system (base 2) only has the digits 0 and 1.Table1.1mour
0000
DECIMALBINARY
0 0
1 1
2 10
3 11
4 100
5 101
6 110
7 111
8 1000
9 1001
The major use of the binary system (mainly in computers) comes from the
simplicity of the basic digits 0 and 1. Since there are only two digits, it is possible to
represent in a computer by a switch: ON state or on (1) or OFF
the off (0).
1.1.3 Octal number system
page 2
UNIT 1 FUNDAMENTALS OF LOGIC CIRCUITS
DECIMALHEXADECIMAL
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 A
11 B
12 C
13 D
14 E
15 F
Procedure:
page 3
UNIT 1 FUNDAMENTALS OF LOGICAL CIRCUITS
Procedure:
• The whole decimal number is divided by the base to convert and the remainder
it will be the least significant digit of the sought amount.
• The quotient is divided as many times as necessary until it becomes
to zero, the resulting remainders of each division will be the following digits
of the sought amount.
• The process must stop when the quotient becomes zero for
thus the last remainder will be the most significant digit.
page 4
UNIT 1 FUNDAMENTALS OF LOGIC CIRCUITS
56 2
28 0 LSB
14 0
7 0
3 1
1 1
0 1MSB
Therefore:
5610=1110002
9584 8
1198 0 LSB
149 6
18 5
2 2
0 2 MSB
Therefore:
225608
9684 16
605 4 LSB
37 D
2 5
0 2MSB
page 5
UNIT 1 FUNDAMENTALS OF LOGIC CIRCUITS
Therefore:
968410= 25D416
Procedure:
• Each digit is multiplied by the base raised to the negative power that it has.
occupying the digit within the amount.
• A summation of the results of the previous multiplications is made.
Procedure:
• The decimal fraction is multiplied by the base and the resulting integer will be the
digit that will comprise the sought fractional amount being the
First integer found the most significant digit.
• The process should be stopped when the fraction becomes 0 or when
a minimum of 0 successive multiplications is reached.
page 6
UNIT 1 FUNDAMENTALS OF LOGIC CIRCUITS
0.3765 x2
0.7530 x2
1.5060 x2
1.0120 x2
0.0240 x2
0.0480 x2
0.0960 x2
0.1920 x2
0.3840 x2
0.7680 x2
1.5360
0.3745 x8
2.9960 x8 Therefore: 0.374510 = 0.27757473318
7.9680 x8
7.7440 x8
5.9520 x8
7.6160 x8
4.9280 x8
7.4240 x8
3.3920 x8
3.1360 x8
1.0880
page 7
UNIT 1 FUNDAMENTALS OF LOGIC CIRCUITS
0.4487 x16
7.1792 x16 Therefore: 0.448710 = 0.72DE00D1B716
2.8672 x16
D.8752 x16
E.0032 x16
0.0512 x16
0.8192 x16
D.1072 x16
1.7152 x16
B.4432 x16
7.0912
Procedure:
p. 8
UNIT 1 FUNDAMENTALS OF LOGIC CIRCUITS
Procedure:
6 7 3 . 1 2 48 therefore:
110 111 011 . 001 010 1002 673.1248 = 110111011.0010101002
Procedure:
• It is similar to the conversion from binary to octal, except that the number is divided.
in groups of four digits.
Procedure:
• It is identical to the conversion from octal to binary except that the binary number
it is divided into groups of four digits.
Example 17: convert the hexadecimal number 606.D1AC16 to binary
page 9
UNIT 1 FUNDAMENTALS OF LOGIC CIRCUITS
6 0 6 . D 1 A C16
010 0000 0110. 1101 0001 1001 11002
Procedure:
3 6 5 . 6 4 28 therefore:
011 110 101 . 011 100 0102 365.6428 = F5.D116
0 1111 0101 . 1101 0001 02
F 5 . D 116
Procedure:
• The conversion from hexadecimal to octal is similar to the conversion from octal to
hexadecimal, what changes is the partition of the hexadecimal number in
binary in groups of 3 digits.
C A F E . 0 C A16
1100 1010 1111 1110 . 0000 1100 10102
1 100 101 011 111 110 . 000 011 0010102
1 4 5 3 7 6 . 0 3 1 28
Therefore: CAFE.0CA16= 145376.03128
page 10
UNIT 1 FUNDAMENTALS OF LOGIC CIRCUITS
1.3 Codes
1. Numeric codes
Alphanumeric codes
3. Error detection codes
Numerical Codes
They are those that allow us to represent a decimal number through a group.
of bits. They can be classified as follows, see theTable1.3:
page 11
UNIT 1 FUNDAMENTALS OF LOGICAL CIRCUITS
The first bit of the gray code is equal to the first binary bit, the first bit remains
to the left.
2. The bits of the binary number are compared in pairs (the 1st with the 2nd, and the 2nd with the
3°, etc), if both bits are the same the result is 0, if they are different it is 1.
Step 2 is repeated until the conversion is complete.
Binary 1101112
Gray 101100
page 12
UNIT 1 FUNDAMENTALS OF LOGIC CIRCUITS
The first gray bit will give rise to the first binary bit, the first bit is at the
left.
If the second gray bit is 0, the second binary bit will be equal to the first.
binary digit. If the second gray bit is 1, then the second binary bit
it will be the inverse of the first binary bit.
3. If the third gray bit is 0, the third binary bit will be equal to the second digit.
binary. If the third gray bit is 1, then the third binary bit will be the opposite of
second binary bit... and so on until finished.
Gray 101100
Binary 110111
page 13