Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
A Digital Watch
Number Systems
and Codes
Numbering System
Decimal
Binary
Octal
Hexadecimal
used in
computers
and digital
systems
Base 16
Any base can be used and numbers changed from one base
to another to change representation. The Mayans used a
Base 20 system, the Babylonians used Base 60!!!
aN,aN-1,.,a1,a0 . a-1,a-2,..,a-K
represents the following number
23
22
21
20
2-1
Binary Point
2-2
2-3
1
Least Significant Bit
(LSB)
456
= 1110010002
2 228-------0 remainder
2 114-----0
Write the
2 57----0
remainder
from bottom
2 28--1
to top
2 14---0
2 7----0
2 3----1
2 1---1
0---1
0.9375
x2
1.8750 ---1
0.8750
x2
1.7500 --- 1
0.75
x 2
1.50------- 1
0.5
x2
1.0 -------1
Continue till 0 is obtained in fraction part
42.937510 =101010.11112
x2
0.096----0
x2
0.192--------0
0.192
x2
0.384----0
x2
0.768--- 0
x2
1.536----1
0.536
x2
1.072----1
0.072
x2
0.144---- 0
x 2
0.288----0
25.01210 =11001.00000011002
(approximately)
Ex :
Ex :
5
Ex. 100.1012 = 4.58
= 237.3 16
16 567
16 35----7
16 2----3
0----2
0.1875
x 16
3.000---3
CODES
When numbers, letters or words
are represented by a special group
of symbols, we say that they are
being encoded and the group of
symbols is called code.
Gray Code
This belongs to a class of codes called minimum-change
codes, in which only one bit in the code groups changes
when going from one stage to the next. The Gray code is
an un-weighted code.
This code is not suited for arithmetic operation but finds
application in input/output devices and some types of
Analog to Digital Converters (ADCs).
The attractive feature of this code is that it minimizes
the effect of any error made in converting from digital to
analog!
Binary Equivalent
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
Gray Code
0000
0001
0011
0010
0110
0111
0101
0100
1100
1101
1111
1110
1010
1011
1001
1000
0
1
3-bit Gray
Code
000
001
011
010
110
111
101
100
White
Black
(GC)
1
0
0
1
0
0
0
+
(BC)
1
+
+
1
Alphanumeric Codes
An alphanumeric code represents all of the various
characters and functions that are found in a standard
typewriter (or computer) keyboard.
ASCII Code:
The most widely used alphanumeric code, the American
Standard Code for Information Interchange used in
computers.
The original ASCII code is a 7 bit code and so it has 27
=128 possible code groups.
The extended ASCII code has 8 bits and can represent
256 characters.
UNICODE can represent upto 1,114,112 characters and is
now available for most scripts.
Character
A
B
C
.. .
Z
0
7- Bit ASCII
1000001
1000010
1000011
.
Hex
41
42
43
1011010
0110000
5A
30
0111001
a, b, blank, etc.
39