Number Systems Lec and their conversions 1.pptx

duqutini 6 views 42 slides May 19, 2025
Slide 1
Slide 1 of 42
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42

About This Presentation

Number systems


Slide Content

Number Systems Instructor S ammra Habib Department of Computer Science The University of Lahore Digital Logic Design

1. Number Systems In a digital system, the system can understand only the optional number system. In these systems, digits symbols are used to represent different values, depending on the index from which it settled in the number system. In simple terms, for representing the information, we use the number system in the digital system. The digit value in the number system is calculated using: The digit The index, where the digit is present in the number. Finally, the base numbers, the total number of digits available in the number system .

Type of Number Systems In the digital computer, there are various types of number systems used for representing information . Binary Number System Decimal Number System Hexadecimal Number System Octal Number System

Binary Number Systems Generally, a binary number system is used in the digital computers. In this number system, it carries only two digits, either 0 or 1. There are two types of electronic pulses present in a binary number system. The first one is the absence of an electronic pulse representing '0'and second one is the presence of electronic pulse representing '1'. Each digit is known as a bit. A four-bit collection (1101) is known as a nibble, and a collection of eight bits (11001010) is known as a byte. It holds only two values, i.e., either 0 or 1. It is also known as the base 2 number system. The position of a digit represents the 0 power of the base(2). Example: 2 The position of the last digit represents the x power of the base(2). Example: 2 x , where x represents the last position, i.e., 1

Decimal Number Systems The decimal numbers are used in our day to day life. The decimal number system contains ten digits from 0 to 9(base 10). The position in the decimal number system specifies the power of the base (10). The 0 is the minimum value of the digit, and 9 is the maximum value of the digit. For example, 2541 is a decimal number.

Octal Number Systems The octal number system has base 8(means it has only eight digits from 0 to 7). There are only eight possible digit values to represent a number. With the help of only three bits, an octal number is represented.  Each set of bits has a distinct value between 0 and 7. An octal number system carries eight digits starting from 0, 1, 2, 3….7. It is also known as the base 8 number system. The position of a digit represents the 0 power of the base(8). Example: 8 The position of the last digit represents the x power of the base(8). Example: 8 x , where x represents the last position, i.e., 1

Hexadecimal Number Systems I t is another technique to represent the number in the digital system called the  hexadecimal number system . The number system has a base of 16 means there are total 16 symbols(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F) used for representing a number. The single-bit representation of decimal values 10 , 11, 12, 13, 14, and 15 are represented by A, B, C, D, E, and F. Only 4 bits are required for representing a number in a hexadecimal number. Each set of bits has a distinct value between 0 and 15. There are the following characteristics of the octal number system: It has ten digits from 0 to 9 and 6 letters from A to F. The letters from A to F defines numbers from 10 to 15. It is also known as the base 16number system. In hexadecimal number, the position of a digit represents the 0 power of the base(16). Example: 16 In hexadecimal number, the position of the last digit represents the x power of the base(16). Example: 16 x , where x represents the last position, i.e., 1

Common Number Systems System Base Symbols Used by humans? Used in computers? Decimal 10 0, 1, … 9 Yes No Binary 2 0, 1 No Yes Octal 8 0, 1, … 7 No No Hexa- decimal 16 0, 1, … 9, A, B, … F No No

Quantities/Counting (1 of 3) Decimal Binary Octal Hexa- decimal 1 1 1 1 2 10 2 2 3 11 3 3 4 100 4 4 5 101 5 5 6 110 6 6 7 111 7 7

Quantities/Counting (2 of 3) Decimal Binary Octal Hexa- decimal 8 1000 10 8 9 1001 11 9 10 1010 12 A 11 1011 13 B 12 1100 14 C 13 1101 15 D 14 1110 16 E 15 1111 17 F

Conversion Among Bases The possibilities:

Quick Example 25 10 = 11001 2 = 31 8 = 19 16 Base

Decimal to Decimal (just for fun) Hexadecimal Decimal Octal Binary Next slide…

125 10 => 5 x 10 = 5 2 x 10 1 = 20 1 x 10 2 = 100 125 Base Weight

Binary to Decimal Hexadecimal Decimal Octal Binary

Binary to Decimal Technique Multiply each bit by 2 n , where n is the “weight” of the bit The weight is the position of the bit, starting from 0 on the right Add the results

Example 101011 2 => 1 x 2 = 1 1 x 2 1 = 2 0 x 2 2 = 0 1 x 2 3 = 8 0 x 2 4 = 0 1 x 2 5 = 32 43 10 Bit “0”

Octal to Decimal Hexadecimal Decimal Octal Binary

Octal to Decimal Technique Multiply each bit by 8 n , where n is the “weight” of the bit The weight is the position of the bit, starting from 0 on the right Add the results

Example 724 8 => 4 x 8 = 4 2 x 8 1 = 16 7 x 8 2 = 448 468 10

Hexadecimal to Decimal Hexadecimal Decimal Octal Binary

Hexadecimal to Decimal Technique Multiply each bit by 16 n , where n is the “weight” of the bit The weight is the position of the bit, starting from 0 on the right Add the results

Example ABC 16 => C x 16 = 12 x 1 = 12 B x 16 1 = 11 x 16 = 176 A x 16 2 = 10 x 256 = 2560 2748 10

Decimal to Binary Hexadecimal Decimal Octal Binary

Decimal to Binary Technique Divide by two, keep track of the remainder First remainder is bit 0 (LSB, least-significant bit) Second remainder is bit 1 Etc.

Example 125 10 = ? 2 2 125 62 1 2 31 0 2 15 1 2 7 1 2 3 1 2 1 1 2 0 1 125 10 = 1111101 2

Octal to Binary Hexadecimal Decimal Octal Binary

Octal to Binary Technique Convert each octal digit to a 3-bit equivalent binary representation

Example 705 8 = ? 2 7 0 5 111 000 101 705 8 = 111000101 2

Hexadecimal to Binary Hexadecimal Decimal Octal Binary

Hexadecimal to Binary Technique Convert each hexadecimal digit to a 4-bit equivalent binary representation

Example 10AF 16 = ? 2 1 0 A F 0001 0000 1010 1111 10AF 16 = 0001000010101111 2

Decimal to Octal Hexadecimal Decimal Octal Binary

Decimal to Octal Technique Divide by 8 Keep track of the remainder

Example 1234 10 = ? 8 8 1234 154 2 8 19 2 8 2 3 8 0 2 1234 10 = 2322 8

Decimal to Hexadecimal Hexadecimal Decimal Octal Binary

Decimal to Hexadecimal Technique Divide by 16 Keep track of the remainder

Example 1234 10 = ? 16 1234 10 = 4D2 16 16 1234 77 2 16 4 13 = D 16 0 4

Binary to Octal Hexadecimal Decimal Octal Binary

Binary to Octal Technique Group bits in threes, starting on right Convert to octal digits

Example 1011010111 2 = ? 8 1 011 010 111 1 3 2 7 1011010111 2 = 1327 8

Thank you
Tags