Sunday 8 May 2011

number system


















../images/main/bullet_green_ball.gifNumbering System
Many number systems are in use in digital technology. The most common are the decimal, binary, octal, and hexadecimal systems. The decimal system is clearly the most familiar to us because it is a tool that we use every day. Examining some of its characteristics will help us to better understand the other systems. In the next few pages we shall introduce four numerical representation systems that are used in the digital system. There are other systems, which we will look at briefly.
  • Decimal
  • Binary
  • Octal
  • Hexadecimal
  
space.gif
 ../images/main/bulllet_4dots_orange.gifDecimal System
The decimal system is composed of 10 numerals or symbols. These 10 symbols are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. Using these symbols as digits of a number, we can express any quantity. The decimal system is also called the base-10 system because it has 10 digits.
  
space.gif
103
102
101
100
10-1
10-2
10-3
=1000
=100
=10
=1
.
=0.1
=0.01
=0.001
Most Significant Digit
Decimal point
Least Significant Digit
  
space.gif
Even though the decimal system has only 10 symbols, any number of any magnitude can be expressed by using our system of positional weighting.
  
space.gif
 ../images/main/bullet_star_pink.gifDecimal Examples
  
space.gif
  • 3.1410
  • 5210
  • 102410
  • 6400010
  
space.gif
 ../images/main/bulllet_4dots_orange.gifBinary System
In the binary system, there are only two symbols or possible digit values, 0 and 1. This base-2 system can be used to represent any quantity that can be represented in decimal or other base system.
  
space.gif
23
22
21
20
2-1
2-2
2-3
=8
=4
=2
=1
.
=0.5
=0.25
=0.125
Most Significant Digit
Binary point
Least Significant Digit
  
space.gif
 ../images/main/bullet_star_pink.gifBinary Counting
The Binary counting sequence is shown in the table:
  
space.gif
23
22
21
20
Decimal
0
0
0
0
0
0
0
0
1
1
0
0
1
0
2
0
0
1
1
3
0
1
0
0
4
0
1
0
1
5
0
1
1
0
6
0
1
1
1
7
1
0
0
0
8
1
0
0
1
9
1
0
1
0
10
1
0
1
1
11
1
1
0
0
12
1
1
0
1
13
1
1
1
0
14
1
1
1
1
15
  
space.gif
  
space.gif
 ../images/main/bullet_star_pink.gifRepresenting Binary Quantities
In digital systems the information that is being processed is usually presented in binary form. Binary quantities can be represented by any device that has only two operating states or possible conditions. E.g.. a switch is only open or closed. We arbitrarily (as we define them) let an open switch represent binary 0 and a closed switch represent binary 1. Thus we can represent any binary number by using series of switches.
  
space.gif
 ../images/main/bullet_star_pink.gifTypical Voltage Assignment
Binary 1: Any voltage between 2V to 5V
Binary 0: Any voltage between 0V to 0.8V
Not used: Voltage between 0.8V to 2V in 5 Volt CMOS and TTL Logic, this may cause error in a digital circuit. Today's digital circuits works at 1.8 volts, so this statement may not hold true for all logic circuits.
  
space.gif
../images/digital/digital_voltage.gif
  
space.gif
We can see another significant difference between digital and analog systems. In digital systems, the exact voltage value is not important; eg, a voltage of 3.6V means the same as a voltage of 4.3V. In analog systems, the exact voltage value is important.
  
space.gif
The binary number system is the most important one in digital systems, but several others are also important. The decimal system is important because it is universally used to represent quantities outside a digital system. This means that there will be situations where decimal values have to be converted to binary values before they are entered into the digital system.
  
space.gif
In additional to binary and decimal, two other number systems find wide-spread applications in digital systems. The octal (base-8) and hexadecimal (base-16) number systems are both used for the same purpose- to provide an efficient means for representing large binary system.
  
space.gif
 ../images/main/bulllet_4dots_orange.gifOctal System
The octal number system has a base of eight, meaning that it has eight possible digits: 0,1,2,3,4,5,6,7.
  
space.gif
83
82
81
80
8-1
8-2
8-3
=512
=64
=8
=1
.
=1/8
=1/64
=1/512
Most Significant Digit
Octal point
Least Significant Digit
  
space.gif
 ../images/main/bullet_star_pink.gifOctal to Decimal Conversion
  
space.gif
  • 2378 = 2 x (82) + 3 x (81) + 7 x (80) = 15910
  • 24.68 = 2 x (81) + 4 x (80) + 6 x (8-1) = 20.7510
  • 11.18 = 1 x (81) + 1 x (80) + 1 x (8-1) = 9.12510
  • 12.38 = 1 x (81) + 2 x (80) + 3 x (8-1) = 10.37510
  
space.gif
 ../images/main/bulllet_4dots_orange.gifHexadecimal System
The hexadecimal system uses base 16. Thus, it has 16 possible digit symbols. It uses the digits 0 through 9 plus the letters A, B, C, D, E, and F as the 16 digit symbols.
  
space.gif
163
162
161
160
16-1
16-2
16-3
=4096
=256
=16
=1
.
=1/16
=1/256
=1/4096
Most Significant Digit
Hexa Decimal point
Least Significant Digit
  
space.gif
 ../images/main/bullet_star_pink.gifHexadecimal to Decimal Conversion
  
space.gif






space.gif
 ../images/main/bullet_green_ball.gifCode Conversion
Converting from one code form to another code form is called code conversion, like converting from binary to decimal or converting from hexadecimal to decimal.
  
space.gif
 ../images/main/bulllet_4dots_orange.gifBinary-To-Decimal Conversion
Any binary number can be converted to its decimal equivalent simply by summing together the weights of the various positions in the binary number which contain a 1.
  
space.gif
Binary
Decimal
110112
24+23+01+21+20
=16+8+0+2+1
Result
2710
  
space.gif
and
  
space.gif
Binary
Decimal
101101012
27+06+25+24+03+22+01+20
=128+0+32+16+0+4+0+1
Result
18110
  
space.gif
You should have noticed that the method is to find the weights (i.e., powers of 2) for each bit position that contains a 1, and then to add them up.
  
space.gif
 ../images/main/bulllet_4dots_orange.gifDecimal-To-Binary Conversion
  
space.gif
There are 2 methods:
  
space.gif
  • Reverse of Binary-To-Decimal Method
  • Repeat Division
  
space.gif
 ../images/main/bullet_star_pink.gifReverse of Binary-To-Decimal Method
  
space.gif
Decimal
Binary
4510
=32 + 0 + 8 + 4 +0 + 1
=25+0+23+22+0+20
Result
=1011012
  
space.gif
  
space.gif
 ../images/main/bullet_star_pink.gifRepeat Division-Convert decimal to binary
This method uses repeated division by 2.
  
space.gif
Convert 2510 to binary
  
space.gif
Division
Remainder
Binary
25/2
= 12+ remainder of 1
1 (Least Significant Bit)
12/2
= 6 + remainder of 0
0
6/2
= 3 + remainder of 0
0
3/2
= 1 + remainder of 1
1
1/2
= 0 + remainder of 1
1 (Most Significant Bit)
Result
2510
= 110012
  
space.gif
The Flow chart for repeated-division method is as follows:
  
space.gif
../images/digital/repeat_division.gif
  
space.gif
  
space.gif
 ../images/main/bulllet_4dots_orange.gifBinary-To-Octal / Octal-To-Binary Conversion
  
space.gif
Octal Digit
0
1
2
3
4
5
6
7
Binary Equivalent
000
001
010
011
100
101
110
111
  
space.gif
Each Octal digit is represented by three binary digits.
  
space.gif
Example:
100 111 0102 = (100) (111) (010)2 = 4 7 28
  
space.gif
 ../images/main/bullet_star_pink.gifRepeat Division-Convert decimal to octal
  
space.gif
This method uses repeated division by 8.
  
space.gif
Example: Convert 17710 to octal and binary
  
space.gif
Division
Result
Binary
177/8
= 22+ remainder of 1
1 (Least Significant Bit)
22/ 8
= 2 + remainder of 6
6
2 / 8
= 0 + remainder of 2
2 (Most Significant Bit)
Result
17710
= 2618
Binary
= 0101100012
  
space.gif
 ../images/main/bulllet_4dots_orange.gifHexadecimal to Decimal/Decimal to Hexadecimal Conversion
  
space.gif
Example:
2AF16 = 2 x (162) + 10 x (161) + 15 x (160) = 68710
  
space.gif
 ../images/main/bullet_star_pink.gifRepeat Division- Convert decimal to hexadecimal
This method uses repeated division by 16.
  
space.gif
Example: convert 37810 to hexadecimal and binary:
  
space.gif
Division
Result
Hexadecimal
378/16
= 23+ remainder of 10
A (Least Significant Bit)23
23/16
= 1 + remainder of 7
7
1/16
= 0 + remainder of 1
1 (Most Significant Bit)
Result
37810
= 17A16
Binary
= 0001 0111 10102
  
space.gif
 ../images/main/bulllet_4dots_orange.gifBinary-To-Hexadecimal /Hexadecimal-To-Binary Conversion
  
space.gif
Hexadecimal Digit
0
1
2
3
4
5
6
7
Binary Equivalent
0000
0001
0010
0011
0100
0101
0110
0111
  
space.gif
Hexadecimal Digit
8
9
A
B
C
D
E
F
Binary Equivalent
1000
1001
1010
1011
1100
1101
1110
1111
  
space.gif
Each Hexadecimal digit is represented by four bits of binary digit.
  
space.gif
Example:
  
space.gif
1011 0010 11112 = (1011) (0010) (1111)2 = B 2 F16
  
space.gif
 ../images/main/bulllet_4dots_orange.gifOctal-To-Hexadecimal Hexadecimal-To-Octal Conversion
  
space.gif
  • Convert Octal (Hexadecimal) to Binary first.
  • Regroup the binary number by three bits per group starting from LSB if Octal is required.
  • Regroup the binary number by four bits per group starting from LSB if Hexadecimal is required.
  
space.gif
Example:
  
space.gif
Convert 5A816 to Octal.
  
space.gif
Hexadecimal
Binary/Octal
5A816
0101 1010 1000 (Binary)
010 110 101 000 (Binary)
Result
= 2 6 5 0 (Octal)
  
space.gif
  
space.gif
  
space.gif
  • 24.616 = 2 x (161) + 4 x (160) + 6 x (16-1) = 36.37510
  • 11.116 = 1 x (161) + 1 x (160) + 1 x (16-1) = 17.062510
  • 12.316 = 1 x (161) + 2 x (160) + 3 x (16-1) = 18.187510

  
space.gif
  
space.gif
  
space.gif

No comments:

Post a Comment