There are two way of representing the numerical value of quantities :
Analog Representation
Digital Representation
In analog representation a quantity is represented by a voltage, current or meter movement that is proportional to the value of that quantity
Example :
•
Automobile Speedometer
• Analog Voltmeter or Ammeter
Analog
quantities can
range of values
vary over a continuous
In digital representation the quantities are represented not by proportional quantities but by symbols called digits.
Example : A Digital Watch
It provides
the
time
of
day
in
the
form
of
decimal digits which represent hours and
minutes (and sometimes seconds).
This digital representation of the time of day changes in discrete steps.
Advantages of Digital Techniques
1. Digital systems are easier to design as circuits used are only switching circuits with only HIGH and LOW range

2. Information storage is easy in digital form

3. Accuracy and precision are greater
Limitation of Digital Techniques
The real world is mainly analog. The quantities we sense or use tend to be mostly continuous analog variables. In order to process these digitally, we need to use analogtodigital converters to get digital representations of the analog signal. We may also need digitalto analog converters to convert digital quantities to analog ones which we can output to the outside world.
Numbering System
_{D}_{e}_{c}_{i}_{m}_{a}_{l}

Base 10, using 0,1,….,8,9

_{B}_{i}_{n}_{a}_{r}_{y}

Base 2, using only 0 & 1

_{O}_{c}_{t}_{a}_{l}

Base 8, using 0,1,….,6,7

Hexadecimal
Base 16
used in computers and digital systems
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!!!
This uses ten numerals or symbols, i.e. 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9
A positional value system is used with these symbols to represent any number.
Example:
a _{N} ,a _{N}_{}_{1} ,…….,a _{1} ,a _{0} . a _{}_{1} ,a _{}_{2} ,…
..
,a
K
represents the following number
a _{0} 10 ^{0} +a _{1} 10 ^{1} + ………+a _{N}_{}_{1} 10 ^{N}^{}^{1} +a _{N} 10 ^{N} + a _{}_{1} 10 ^{}^{1} + …….+a _{}_{K} 10 ^{}^{K}
Binary Number System
The binary system uses only two symbols, 0 and 1
It is also a positional value system where each binary digit has its own value or weight expressed as a power of 2
• Places to the left of the binary point are positive powers of 2
Places to the the right of the binary point are negative powers of 2
This is exactly what we did in the decimal system except that there we used powers of 10 instead of powers of 2!
Example : The Number 1011.101 _{2}






2 ^{3}

2 ^{2}

2 ^{1}

2 ^{0}

_{2} 1

_{2} 2

_{2} 3


1

0

1

1

1

0

1

Most Significant Bit (MSB)
.
Binary Point
Least Significant Bit (LSB)
BINARY TO DECIMAL CONVERSION
Example : Convert the number 1011.101 _{2} to its decimal equivalent
1011.101 _{2} = 1 x 2 ^{3} + 0 x 2 ^{2} + 1 x 2 ^{1} + 1 x 2 ^{0}
+1 x
2 ^{}^{1} + 0 x 2 ^{}^{2} + 1 x 2 ^{}^{3}
= 8 + 0 + 2 + 1+ 0.5 + 0+ 0.125
=11.625 _{1}_{0}
DECIMAL TO BINARY CONVERSION
Done by repeated divisions (see next slide)
Example  Convert 456 _{1}_{0} into binary
Answer = 111001000 _{2}
2

456


2


2

1140



2

570


2

281

2
= 111001000 _{2}
Write the remainder from bottom to top
2280 remainder
140


2

70


2

31



2


11

01
Convert 42.9375 _{1}_{0} to binary
2
42
2 210
2
101
2
50
2
21
210
01
0.9375



x 2

1.8750

1

0.8750


x 2

1.7500

 1

0.75


x

2

1.50 1
0.5
x 2
1.0
1
Continue till 0 is obtained in fraction part
42.9375 _{1}_{0} =101010.1111 _{2}
Example : Convert 25.012 _{1}_{0} into binary
2 25
0.192
2 121
2 60
0.012
x 2
x 2
0.3840
2
30
0.0240
x 2
211
x 2
0.768 0
01
0.0480
x 2
x 2
1.5361
0.0960
0.536
x2
x 2
0.1920
1.0721
0.072
x 2
0.144 0
x
2
25.012 _{1}_{0} =11001.0000001100 _{2}
(approximately)
0.2880
Octal Number System
It has a base of 8 and 8 possible digits : 0,1,2,3,4,5,6,7
Octal to decimal conversion 24.6 _{8} =2 x 8 ^{1} + 4 x 8 ^{0} + 6x 8 ^{}^{1} =
16 + 4 + 0.75 = 20.75 _{1}_{0}
Decimal to octal conversion
Example : Convert 49.21875 _{1}_{0} into octal

8

49


0.21875

8

61

x 8



06

1.750001

.75
x 8
6.006
Octal to Binary Conversion
Conversion from octal to binary is performed by converting each octal digit to its 3bit binary equivalent
Ex :

472 _{8} =100 111 010 _{2}

Ex :

642.71 _{8} = 110 100 010.111 001 _{2}

Binary to Octal Conversion
The bits of the binary number are grouped into groups of three bits starting at the LSB. Then each group is converted into its octal equivalent
Ex. 101100011001 _{2} = 101 100 011 001=5431 _{8}
5
4
3
1
Ex. 100.101 _{2} = 4.5 _{8}
Hexadecimal Number System
It uses base 16 and 16 possible digit symbols 0 to 9 plus the letters A,B,C,D,E ,F
A=10 _{D} , B=11 _{D} , C=12 _{D} , D=13 _{D} , E=14 _{D} , F=15 _{D}
Hex to Decimal Conversion
Example:
356 _{1}_{6}
= 3 x 16 ^{2} + 5 x 16 ^{1} + 6 x 16 ^{0} = 854 _{1}_{0}
Decimal to Hex Conversion
Example: 567.1875 _{1}_{0}
= 237.3 _{1}_{6}
16
0.1875
16

23

x 16

02

3.0003

Hex to Binary Conversion
Groups of 4 digits are taken
Example:
Example:
F9 _{1}_{6} = 1111 1001 _{2} 20E.CA _{1}_{6} = 0010 0000 1110.1100 1010 _{2}
Binary to Hex Comversion
Grouped into groups of four bits, and each group is converted to its equivalent hex digit
Example: 1110100110 _{2} = 0011 1010 0110 = 3A6 _{1}_{6} Example: 1101 . 0011 1100 = D.3C _{1}_{6}
Example : Convert B2F _{1}_{6} to octal
First convert hex to binary, then convert the resultant binary to octal
B2F _{1}_{6} = 1011 0010 1111 _{2} = 101 100 101 111= 5457 _{8}
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.
Binary Coded Decimal Code (BCD)
If each digit of a decimal number is represented by its binary equivalent, the result is a code called binarycoded decimal or BCD. Since a decimal digit can be as large as 9, 4 bits are required to code each digit.
Example: 874 _{D} = 1000 0111 0100 (BCD)
Gray Code
This belongs to a class of codes called minimumchange codes, in which only one bit in the code groups changes when going from one stage to the next. The Gray code is an unweighted 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!
3bit Gray Code
000
001
011
010
110
111
101
100
3bit Positional Encoder Disk
Binary to Gray Code Conversion
(BC)

1

+


1

+


0

+


0





(GC)

1

0

1

0

• MSB does not change as a result of conversion
• Start with MSB of binary number and add it to neighboring binary bit to get the next Gray code bit
• Repeat for subsequent Gray coded bits
Gray to Binary Code Conversion
(GC)

1


0


1


0


+


+


+


(BC)

1


1


0


0

• MSB does not change as a result of conversion
• Start with MSB of binary number and add it to the second MSB of the Gray code to get the next binary bit
• Repeat for subsequent binary coded bits
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 =128 possible code groups.
2 ^{7}
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.