Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Number system
1. NUMBER SYSTEM
Dr. (Mrs.) Gargi Khanna
Associate Professor
Electronics & Communication Engg. Deptt..
National Institute of Technology Hamirpur (HP)
Chapter-I
2. INTRODUCTION
Decimal number system (Base 10).
Some other number systems :
Number System Base/Radix No of possible
Digits
Decimal 10 10
Binary 2 2
Octal 8 8
Hexadecimal 16 16
The number system with weights on position is called
weighted number system. e.g. Binary, Octal, Decimal, etc.
Non-weighted number system e.g. gray code excess-3 code
G.Khanna, NITH
3. Characteristics of Numbering
Systems
The number of digits is equal to the size of the
base.
Zero is always the first digit and digits are
consecutive.
The base number is never a digit.
When 1 is added to the largest digit, a sum of
zero and a carry of one results.
Numeric values determined by sum of the each
digit multiplied by positional values of the digits.
G.Khanna, NITH
4. Decimal Number System
Possible digits 0,1,2,3,4,5,6,7,8,9
Number d3d2 d1 d0. d-1d-2
(Integer) (fractional)
D = d3×103+d2×102 + d1×101 +d0×100 + d -1×10-1 +d -2×10-2
The value of the number is the sum of each digit multiplied by
the corresponding power of the radix
G.Khanna, NITH
5. Significant Digits
Binary: 1101101
Most significant digit Least significant digit
Decimal :4566
Hexadecimal: 196CA7A
Most significant digit Least significant digit
G.Khanna, NITH
6. Binary Number System
“Base 2 system”
The binary number system is used to model
the series of electrical signals computers use
to represent information
0 represents the no voltage or an off state
1 represents the presence of voltage or an
on state
G.Khanna, NITH
7. Computer perform all of their operations using the binary (base
2).
– Program code and data are stored and manipulated in binary.
– Each digit in a binary number is known as a bit (value 0 or 1).
– Bits are commonly stored and manipulated in groups of:
• 8 bit: Byte.
• 16 bit : Halfword.
• 32 bit: Word.
• 64 bit: Doubleword
G.Khanna, NITH
8. Binary Numbering Scale
Base 2 Number
Base 10
Equivalent
Power
Positional
Value
000 0 20 1
001 1 21 2
010 2 22 4
011 3 23 8
100 4 24 16
101 5 25 32
110 6 26 64
111 7 27 128
G.Khanna, NITH
9. Decimal to Binary Conversion
Division Algorithm
This method repeatedly divides a decimal
number by 2 and records the quotient and
remainder
– The remainder digits (a sequence of zeros and
ones) form the binary equivalent in least
significant to most significant digit sequence
G.Khanna, NITH
10. Division Algorithm
Convert 67 to its binary equivalent:
6710 = x2
Step 1: 67 / 2 = 33 R 1 Divide 64 by 2. Record quotient in next row
Step 2: 33 / 2 = 16 R 1 Again divide by 2; record quotient in next row
Step 3: 16 / 2 = 8 R 0 Repeat again
Step 4: 8 / 2 = 4 R 0 Repeat again
Step 5: 4 / 2 = 2 R 0 Repeat again
Step 6: 2 / 2 = 1 R 0 Repeat again
Step 7: 1 / 2 = 0 R 1 STOP when quotient equals 0
1 0 0 0 0 1 12
G.Khanna, NITH
11. Binary to Decimal Conversion
The easiest method for converting a
binary number to its decimal equivalent
is to use the Multiplication Algorithm
Multiply the binary digits by increasing
powers of two, starting from the right
Then, to find the decimal number
equivalent, sum those products
G.Khanna, NITH
12. Multiplication Algorithm
Convert (10101111)2 to its decimal equivalent:
Binary 1 0 1 0 1 1 1 1
Positional Values
x
x
x
x
x
x
x
x
20
21
22
23
24
25
26
27
128 + 32 + 8 + 4 +2+1
Products
17510
G.Khanna, NITH
13. Octal Number System
Base 8 System
Uses symbols 0 - 7
Ease of convertion to binary
Groups of three binary bits can be used
to represent each octal symbol
Multiplication and division algorithms for
conversion to and from base 10
G.Khanna, NITH
14. Decimal to Octal Conversion
Convert 42910 to its octal equivalent:
429 / 8 = 53 R 5 Divide by 8; R is LSD
53 / 8 = 6 R 5 Divide Q by 8; R is next digit
6 / 8 = 0 R 6 Repeat until Q = 0
6558
G.Khanna, NITH
15. Octal to Decimal Conversion
Convert 6538 to its decimal equivalent:
6 5 3
x
x
x
82 81 80
384 + 40 + 3
42710
Positional Values
Products
Octal Digits
G.Khanna, NITH
16. Octal to Binary Conversion
Each octal number converts to 3 binary digits
475.038 =(100111101.000011) 2
To convert 6538 to binary, just
substitute code:
6 5 3
110 101 011
G.Khanna, NITH
17. Hexadecimal Number System
Base 16 system
Uses digits 0-9 &
letters A,B,C,D,E,F
Groups of four bits
represent each
base 16 digit
G.Khanna, NITH
19. Hexadecimal to Decimal
Conversion
Convert (3B4A)16 to its decimal equivalent:
Hex Digits 3 B 4 F
x
x
x
163 162 161 160
12288 +2816 + 64 +10
15,17810
Positional Values
Products
x
G.Khanna, NITH
20. Binary to Hexadecimal
Conversion
The easiest method for converting binary to
hexadecimal is to use a substitution code
Each hex number converts to 4 binary digits
G.Khanna, NITH
21. Convert 0111001010101111011010112 to hex
using the 4-bit substitution code :
0111 0010 1010 1111 0110 1011
Substitution Code
7 2 A F 6 B
76AF6B16
G.Khanna, NITH
22. Substitution code can also be used to convert
binary to octal by using 3-bit groupings:
010 101 101 010 111 001 101 010
Substitution Code
2 5 5 2 7 1 5 2
255271528
G.Khanna, NITH
23. G.Khanna, NITH
Number Decimal Binary Octal Hexadecimal
------ ------- ------- ----- -----------
Zero 0 0 0 0
One 1 1 1 1
Two 2 10 2 2
Three 3 11 3 3
Four 4 100 4 4
Five 5 101 5 5
Six 6 110 6 6
Seven 7 111 7 7
Eight 8 1000 10 8
Nine 9 1001 11 9
Ten 10 1010 12 A
Eleven 11 1011 13 B
Twelve 12 1100 14 C
Thirteen 13 1101 15 D
Fourteen 14 1110 16 E
Fifteen 15 1111 17 F
Sixteen 16 10000 20 10
Seventeen 17 10001 21 11
Eighteen 18 10010 22 12
Nineteen 19 10011 23 13
Twenty 20 10100 24 14