A Numbering
A Numbering
Mikrokomputer
Semester 2-2017/2018
TEXT BOOK:
Singh, A. and Triebel, W.A., “The 8088
microprocessor-Programming, Interfacing,
Software, Hardware and Application”,
Prentice Hall, NY, 1989.
NUMBERING SYSTEMS
NUMBERING SYSTEMS
3 MAIN PROBLEMS
1. Large Numbers
2. Negative Numbers
3. Non-Integers (9.1, 8.8 etc.)
UNARY NUMBERING SYSTEMS
Proposed solution:
NEWER PROBLEMS
1. Redundancy of representation. 15=IIIIVV or VVV OR VX ?
2. No representation for non-integers. 15.1=?
3. No representation for negative numbers. -15=?
UNIVERSAL NUMBERING SYSTEMS
0 1 2 3 4 5 6 7 8 9 10 11 12 …
A=10 B=11 C=12 D=13 E=14 F=15
BINARY: 101101102
DECIMAL: 22010
HEXADECIMAL: A23F16
OCTAL: 76538
UNIVERSAL NUMBERING SYSTEMS
Numbers in any base can be calculated in the equivalent decimal form using
The WEIGHTED POSITIONAL NUMBER equation,
n 1
NumberDecimal sibi s0b0 s1b1 s2b 2 ... sn 1b n 1
i 0
Solution:
n 1
NumberDecimal sibi s0b0 s1b1 s2b 2 ... sn 1b n 1
i 0
s – symbols (0 and 1)
b – base (binary=2)
BINARY ADDITION
Rule 1 0 - 0 = 0
Rule 2 0 - 1 = 1 with a borrow of 1
Rule 3 1 - 0 = 1
Rule 4 1 - 1 = 0
To perform Rule 2 you have to borrow 1 from the next column. The weight
of the binary you borrow will be 2.
µP and Digital System
BINARY SUBSTRACTION
BINARY MULTIPLICATION
(i) (ii)
10 10 10 10 100
00 01 10 10 11
-------- -------- 11 --------- ----------
00 10 --------- 100 100
-------- +00 1100 --------- + 100
-------- --------- ----------
010 1100
------- ----------
[Case 1]
[Case 2]
[Case 3]
BINARY ARITHMETIC OPERATIONS
BINARY DIVISION
1 10
10 10 10 100
- 10 - 10
00 00
[Case 1] 000
[Case 2]
µP and Digital System
HEXADECIMAL NUMBERS
2 B 6 . C Hex. Number
= 694.7510
µP and Digital System
Decimal to Hexadecimal Conversion
µP and Digital System
Fractional Decimal to Hexadecimal Conversion
µP and Digital System
4 7. F E
1 2 . 6 C16
µP and Digital System
5 6 716 A B C16
A 0 C16 A 1 116
F 7 316 1 4 C D16
µP and Digital System
A B C16
- 9 C D16
0 E F16
µP and Digital System
= 3108
µP and Digital System
4 3 58
= 1000111012
UNIVERSAL NUMBERING SYSTEMS
In class exercise:
82 = 64 81 = 8 80 = 1
(ii) Base 8 : 25610 = 4008
4 0 0
22 = 4 21 = 2 20 = 1
(iii) Base 2 : 510=1012
1 0 1
UNIVERSAL NUMBERING SYSTEMS
25/16 1 9
Division Quotient Remainder
1/16 0 1
256/8 32 0
(ii) Base 8 : 25610 = 4008
32/8 4 0
Division Quotient Remainder
4/8 0 4
5/2 2 1
2/2 1 0
(iii) Base 2 : 510=1012
1/2 0 1
EXERCISE