numbering system base conversion. number systems decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 binary –...
TRANSCRIPT
![Page 1: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/1.jpg)
Numbering System
Base Conversion
![Page 2: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/2.jpg)
Number systems
Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9Binary – 0, 1Octal – 0, 1, 2, 3, 4, 5, 6, 7Hexadecimal system – 0, 1, 2, 3, 4, 5, 6,
7, 8, 9, A, B, C, D, E, F
![Page 3: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/3.jpg)
Why different number systems?
Binary number result in quite a long string of 0s and 1s
Easier for the computer to interpret input from the user
![Page 4: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/4.jpg)
Base Conversion
In daily life, we use decimal (base 10) number system
Computer can only read in 0 and 1Number system being used inside a
computer is binary (base 2)Octal (base 8) and hexadecimal (base 16)
are used in programming for convenience
![Page 5: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/5.jpg)
Base Conversion
ConversionBinary number, Octal number, Hexadecimal number, and Decimal number.
![Page 6: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/6.jpg)
Base ConversionBinary Octal Hexadecimal Decimal
0000 0 0 0
0001 1 1 1
0010 2 2 2
0011 3 3 3
0100 4 4 4
0101 5 5 5
0110 6 6 6
0111 7 7 7
1000 10 8 8
1001 11 9 9
1010 12 A 10
1011 13 B 11
1100 14 C 12
1101 15 D 13
1110 16 E 14
1111 17 F 15
![Page 7: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/7.jpg)
Base Conversion
For example:62 = 111110 = 76 = 3Edecimal binary octal hexadecimal
1 For Decimal: 62 = 6x101 + 2x100
2 For Binary: 111110 = 1x25 + 1x24 + 1x23 + 1x22 + 1x21 + 0x20
3 For Octal: 76 = 7x81+ 6x80
4 For Hexadecimal: 3E = 3x161 + 14x160
Since for hexadecimal system, each digit contains number from 1 to 15, thus we use A, B, C, D, E and F to represent 10, 11, 12, 13, 14 and 15.
![Page 8: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/8.jpg)
Binary and decimal system
Binary to decimal X . 27 + X . 26+ X . 25+ X . 24 + X . 23+ X . 22+ X . 21 +
X . 20
Decimal to binaryKeep dividing the number by two and keep
track of the remainders.Arrange the remainders (0 or 1) from the
least significant (right) to most significant (left) digits
![Page 9: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/9.jpg)
Octal and Hexadecimal system
Binary to Octal (8 = 23) Every 3 binary digit equivalent to one octal digit
Binary to Hexadecimal (16 = 24) Every 4 binary digit equivalent to one hexadecimal
digit Octal to binary
Every one octal digit equivalent to 3 binary digit Hexadecimal to binary
Every one hexadecimal digit equivalent to 4 binary digits
![Page 10: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/10.jpg)
Base Conversion
How to convert the decimal number to other number systeme.g. convert 1810 in binary form
2 |18 ----0
2 |09 ----1
2 |04 ----0
2 |02 ----0
1
1810 = 100102
![Page 11: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/11.jpg)
Base Conversion
e.g. convert 1810 in octal formSince for octal form, one digit is equal to 3
digits in binary number, we can change binary number to octal number easily.
e.g. 10010 = 010 010
2 2
Thus, 100102 = 228
![Page 12: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/12.jpg)
Base Conversion
e.g. convert 1810 in hexadecimal formSimilarly, for hexadecimal form, one digit is
equal to 4 digits in binary number.e.g. 10010 = 0001 0010
1 2
Thus, 100102 = 1216
![Page 13: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/13.jpg)
Numbering System
Addition & Subtraction
![Page 14: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/14.jpg)
Decimal Addition
111
3758
+ 4657
8415
What is going on?
1 1 1 (carry)
3 7 5 8
+ 4 6 5 7 14 11 15- 10 10 10 (subtract the base)
8 4 1 5
![Page 15: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/15.jpg)
Binary Addition
Rules. 0 + 0 = 00 + 1 = 11 + 0 = 11 + 1 = 2 = 102 = 0 with 1 to carry
1 + 1 + 1 = 3 = 112 = 1 with 1 to carry
![Page 16: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/16.jpg)
Binary Addition
1 1 1 1 1 1 0 1 1 1
+ 0 1 1 1 0 0
2 3 2 2
- 2 2 2 2
1 0 1 0 0 1 1
Verification
5510
+ 2810
8310
64 32 16 8 4 2 1 1 0 1 0 0 1 1
= 64 + 16 + 2 +1
= 8310
![Page 17: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/17.jpg)
Binary Addition
ex Verification 1 0 0 1 1 1 + 0 1 0 1 1 0 + ___ ___________ 128 64 32 16 8 4 2 1
= =
![Page 18: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/18.jpg)
Octal Addition
1 1
6 4 3 78 + 2 5 1 08 9 9 - 8 8 (subtract Base (8)) 1 1 1 4 78
![Page 19: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/19.jpg)
Octal Addition
ex
3 5 3 68 + 2 4 5 78
- (subtract Base (8))
![Page 20: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/20.jpg)
Hexadecimal Addition
1 1
7 C 3 916 + 3 7 F 216 20 18 11 - 16 16 (subtract Base (16))
B 4 2 B16
![Page 21: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/21.jpg)
Hexadecimal Addition
8 A D 416
+ 5 D 616 - (subtract Base (16))
16
![Page 22: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/22.jpg)
Decimal Subtraction
7 13 10
8 4 1 15
- 4 6 5 7
3 7 5 8
How it was done?( add the base 10 when borrowing)
10 10 7 3 0 10
8 4 1 5 13 10 15
- 4 6 5 7
3 7 5 8
![Page 23: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/23.jpg)
Binary Subtraction
1 2 1
0 2 0 2 2 1 0 1 0 0 1 1 - 0 1 1 1 0 0 1 1 0 1 1 1
Verification
8310
- 2810
5510
64 32 16 8 4 2 1
1 1 0 1 1 1
= 32 + 16 + + 4 + 2 +1
= 5510
![Page 24: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/24.jpg)
Binary Subtraction
ex Verification 1 0 0 1 1 1 - 0 1 0 1 1 0 - ___ ___________ 128 64 32 16 8 4 2 1
= =
![Page 25: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/25.jpg)
Octal Subtraction
8 0 0 8
1 1 1 4 78
8 9
- 6 4 3 78
2 5 1 08
![Page 26: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/26.jpg)
Octal Subtraction
ex
3 5 3 68
- 2 4 5 78
![Page 27: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/27.jpg)
Hexadecimal Subtraction
B 16
7 C 3 916 19
- 3 7 F 216
4 4 4 716
![Page 28: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/28.jpg)
Hexadecimal Subtraction
8 A D 416
- 5 D 616
16
![Page 29: Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system](https://reader036.vdocuments.net/reader036/viewer/2022062408/56649ee65503460f94bf654f/html5/thumbnails/29.jpg)
Let’s do some exercises!
Octal, Hexadecimal, Binary
Addition & Subtraction