Digital Logic Design
NUMBER SYSTEMS
1
2
Prepared by: Mir Omranudin Abhar
Email : MirOmran@Gmail.com
Fall ,2019
Number systems
Number systems are the technique to represent numbers in the computer
system architecture, every value that you are saving or getting into/from
computer memory has a defined number system.
2
Number systems
Computer architecture supports following number systems.
1. Binary number system
2. Octal number system
3. Decimal number system
4. Hexadecimal (hex) number system
3
Number systems [Binary ]
A Binary number system has only two digits that are 0 and 1. Every number
(value) represents with 0 and 1 in this number system. The base of binary
number system is 2, because it has only two digits
4
0 , 1
1 ≥ ≥ 𝟎
Number systems [Octal]
1. Octal number system has only eight (8) digits from 0 to 7.
2. The base of octal number system is 8, because it has only 8 digits.
5
0 , 1 , 2 , 3 , 4 , 5 , 6 , 7
7 ≥ ≥ 𝟎
Number systems [Decimal]
1. Decimal number system has only ten (10) digits from 0 to 9.
2. The base of decimal number system is 10, because it has only 10 digits.
6
0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9
9 ≥ ≥ 𝟎
Number systems [Hexadecimal]
1. A Hexadecimal number system has sixteen (16) alphanumeric values
from 0 to 9 and A to F.
2. The base of hexadecimal number system is 16, because it has 16
alphanumeric values. Here A is 10, B is 11, C is 12, D is 13, E is
14 and F is 15.
7
0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , A , B , C , D , E , F
F ≥ ≥ 𝟎
8
Conversion
(𝑛)10 → (𝑚)2
(𝑛)10 → (𝑚)8
(𝑛)10 → (𝑚)16
1
Convert Decimal to [ Binary ]
9
(47)10 = (101111)2
Convert Decimal to [ Octal ]
10
(47)10 = (57)8
Convert Decimal to [hexadecimal ]
11
(47)10 = (2𝐹)16
12
Conversion
(𝑛)2 → (𝑚)10
(𝑛)2 → (𝑚)8
(𝑛)2 → (𝑚)16
2
Convert Binary to [Decimal ]
13
(101111)2 = (47)10
101111 2 ⇒ 1 ∗ 25
+ 0 ∗ 24
+ 1 ∗ 23
+ 1 ∗ 22
+ 1 ∗ 21
+ 1 ∗ 20
⇒ 32 + 0 + 8 + 4 + 2 + 1
⇒ (47)10
Convert Binary to [Octal ]
14
(101111)2 = (57)8
101111 2 ⇒ 1 ∗ 25 + 0 ∗ 24 + 1 ∗ 23 + 1 ∗ 22 + 1 ∗ 21 + 1 ∗ 20
⇒ 32 + 0 + 8 + 4 + 2 + 1
⇒ (47)10
Convert Binary to [hexadecimal]
15
(101111)2 = (2𝐹)16
101111 2 ⇒ 1 ∗ 25 + 0 ∗ 24 + 1 ∗ 23 + 1 ∗ 22 + 1 ∗ 21 + 1 ∗ 20
⇒ 32 + 0 + 8 + 4 + 2 + 1
⇒ (47)10
16
Conversion
(𝑛)8 → (𝑚)10
(𝑛)8 → (𝑚)2
(𝑛)8 → (𝑚)16
3
Convert Octal to [Decimal]
17
(57)8 = (47)10
57 8 ⇒ 5 ∗ 81
+ 7 ∗ 80
⇒ 40 + 7
⇒ (47)10
Convert Octal to [Binary]
18
(57)8 = (101111)2
57 8 ⇒ 5 ∗ 81 + 7 ∗ 80
⇒ 40 + 7
⇒ (47)10
Convert Octal to [hexadecimal]
19
(57)8 = (2𝐹)16
57 8 ⇒ 5 ∗ 81 + 7 ∗ 80
⇒ 40 + 7
⇒ (47)10
20
Conversion
(𝑛)16 → (𝑚)10
(𝑛)16 → (𝑚)2
(𝑛)16 → (𝑚)8
4
Convert hexadecimal to [decimal]
21
(2𝐹)16 = (47)10
2𝐹 16 ⇒ 2 ∗ 161 + 𝐹 ∗ 160
⇒ 32 + 15
⇒ (47)10
Convert hexadecimal to [decimal]
22
(2𝐹)16 = (57)8
2𝐹 16 ⇒ 2 ∗ 161 + 𝐹 ∗ 160
⇒ 32 + 15
⇒ (47)10
Convert hexadecimal to [binary]
23
(2𝐹)16 = (101111)2
2𝐹 16 ⇒ 2 ∗ 161 + 𝐹 ∗ 160
⇒ 32 + 15
⇒ (47)10
24
Exercise
(2𝐴𝐵)16 → (? )10
(528)10 → (? )8
(110001)2 → (? )10
(𝐴0)16 → (? )8
(621)8 → (? )16
(101)10 → (? )2
Question
.1
VHDL
‫ست؟‬‫چی‬
.2
‫عدد‬
12.31
‫ا‬‫ر‬
‫از‬
‫مت‬‫س‬‫سی‬
‫اعداد‬
Decimal
‫به‬
‫مت‬‫س‬‫سی‬
‫اعداد‬
Binary
‫بدیل‬‫ت‬
‫مناید‬
.
25

Dld 2