0% found this document useful (0 votes)
12 views18 pages

1 Number Systems

The document provides an overview of various number systems, including decimal, octal, hexadecimal, and binary, detailing their bases, digit positions, weights, and magnitudes. It also explains the process of converting numbers between these systems, covering both integer and fractional conversions with examples. The formal notation for representing numbers in these systems is also presented.

Uploaded by

anashazem467
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views18 pages

1 Number Systems

The document provides an overview of various number systems, including decimal, octal, hexadecimal, and binary, detailing their bases, digit positions, weights, and magnitudes. It also explains the process of converting numbers between these systems, covering both integer and fractional conversions with examples. The formal notation for representing numbers in these systems is also presented.

Uploaded by

anashazem467
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Digital Logic Design

01 - Number Systems and Codes


Number Systems
Decimal Number System
5 7 4 . 2 4
• Base (radix) = 10
• 10 digits
• {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
• Digit Position
100 10 1 0.1 0.01
• Integer & fraction
• Digit Weight
• 5*100 7*10 4*1 2*0.1 4*0.01
• Magnitude
500 + 70 + 4 + 0.2 + 0.04
• Sum of “Digit x Weight”
• Formal Notation 𝑎 ∗𝐵 +𝑎 ∗𝐵 +𝑎 ∗𝐵 +𝑎 ∗𝐵 +𝑎 ∗𝐵
Octal Number System
5 7 4 . 2 4
• Base (radix) = 8
• 8 digits
• {0, 1, 2, 3, 4, 5, 6, 7}
• Digit Position
64 8 1 1/8 1/64
• Integer & fraction
• Digit Weight
• 5*64 7*8 4*1 2*1/8 4*1/64
• Magnitude
320 + 56 + 4 + 0.25 + 0.0625
• Sum of “Digit x Weight”
• Formal Notation 𝑎 ∗𝐵 +𝑎 ∗𝐵 +𝑎 ∗𝐵 +𝑎 ∗𝐵 +𝑎 ∗𝐵

28
Hexadecimal Number System
• Base (radix) = 16 1 E 5 . 7 A
• 16 digits
• {0, 1, 2, 3, 4, 5, 6, 7, 8,
• 9, A, B, C, D, E, F}
• Digit Position 256 16 1 1/16 1/256
• Integer & fraction
• Digit Weight
1*256 14*16 5*1 7*1/16 10*1/256

• Magnitude
256 + 224 + 5 + 0.4375 + 0.0390
• Sum of “Digit x Weight” 625
• Formal Notation 𝑎 ∗𝐵 +𝑎 ∗𝐵 +𝑎 ∗𝐵 +𝑎 ∗𝐵 +𝑎 ∗𝐵

29
Binary Number System
1 0 1 . 0 1
• Base (radix) = 2
• 2 digits {0, 1}
• binary digits “bits”
• Digit Position
4 2 1 1/2 1/4
• Integer & fraction
• Digit Weight
• 1*4 0*2 1*1 0*1/2 1*1/4
• Magnitude
4 + 0 + 1 + 0 + 0.25
• Sum of “Digit x Weight”
• Formal Notation 𝑎 ∗𝐵 +𝑎 ∗𝐵 +𝑎 ∗𝐵 +𝑎 ∗𝐵 +𝑎 ∗𝐵

30
Binary Number System

31
Number Base Conversion
Decimal to Binary/Octal/Hexadecimal
• Integer Conversion
1. Divide the number by the “Base”
2. Take the remainder as a coefficient
3. Take the quotient and repeat the division

• Fraction conversion
1. Multiply the number by the “Base”
2. Take the integer part as a coefficient
3. Take the resultant fraction repeat the multiplication

33
Decimal to Binary/Octal/Hexadecimal
• Example: to binary More conveniently

Quotient Remainder Coefficient Integer Remainder


13/2 6 1 𝑎 =1 13
6/2 3 0 𝑎 =0 6 1
3/2 1 1 𝑎 =1 3 0
1 0 1 𝑎 =1 1 1
0 1

• Answer:

MSB LSB 34
Decimal to Binary/Octal/Hexadecimal
• Example: to binary Integer Remainder
Quotient Remainder Coefficient 41
41/2 20 1 𝑎 =1 20 1
20/2 10 0 𝑎 =0 10 0
10/2 5 0 𝑎 =0 5 0
5/2 2 1 𝑎 =1 2 1
2/2 1 0 𝑎 =0 1 0
1/2 0 1 𝑎 =1 0 1

• Answer:

35
Decimal to Binary/Octal/Hexadecimal
• Example: to octal

Integer Remainder
153
19 1
2 3
0 2

• Answer:

36
Decimal to Binary/Octal/Hexadecimal
• Example: to hexadecimal

Integer Remainder
1973
123 5
7 11
0 7

• Answer:

37
Decimal to Binary/Octal/Hexadecimal
• Example: to binary
Integer Fraction Coefficient
0.6875*2 1 0.3750 𝑎 =1
0.3750*2 0 0.7500 𝑎 =0
0.7500*2 1 0.500 𝑎 =1
0.500*2 1 0.000 𝑎 =1

• Answer:

38
Decimal to Binary/Octal/Hexadecimal
• Example: to octal

0.513*8 4.104
0.104*8 0.832
0.832*8 6.656
0.656*8 5.248
0.248*8 1.984
0.984*8 7.872

• Answer: to seven significant figures

39
Decimal to Binary/Octal/Hexadecimal
• Using the examples above

40
Decimal to Binary/Octal/Hexadecimal
• Example: to hexadecimal
Integer Remainder
834
52 2 0.25*16 4.00
3 4
0 3

• Answer:

41
Decimal to Binary/Octal/Hexadecimal
• Example: to hexadecimal
Integer Remainder
445
27 13 0.75*16 12.00
1 11
0 1

• Answer:

42

You might also like