Digital Logic Design
Zarnab Azam
[Link]@[Link]
Chapter 1
Digital Systems and Binary Numbers
OUTLINE
• 1.1 Digital Systems
• 1.2 Binary Numbers
• 1.3 Number-base Conversions
• 1.4 Octal and Hexadecimal Numbers
• 1.5 Complements
• 1.6 Signed Binary Numbers
• 1.7 Binary Codes
• 1.8 Binary Storage and Registers
• 1.9 Binary Logic
Analog and Digital system
• Analog system
– The physical quantities or signals may vary continuously
over a specified range.
• Digital system
– The physical quantities or signals can assume only discrete
values.
– Greater accuracy
Advantages of Digital system
• Digital systems are easy to design because they do not require
sound engineering and mathematical knowledge, use only
switching circuits.
• Storage for long time and processing of information is easy.
• Have better accuracy and precision.
• Less affected by noise like sound, electric field, magnetic field.
• Better modularity and easy fabrication , it means size will be
very small.
• Less cost
Decimal Number System
• A positional number system which has 10 symbols or digits
• A total of 10 digits means base of decimal number system is 10
• 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
• The maximum value of a single digit is 9 (one less than the value of
the base)
• Each position of a digit represents a specific power of the base (10)
• The most popular and used by us in our day-to-day life
• Example
• (2586)10
• (163)10
• (981)10
Binary Number System
• A positional number system which has only two digits
• Base = 2, only two digits 0, 1
• The maximum value of a single digit is 1 (one less than the
value of the base)
• Each position of a digit represents a specific power of the base
(2)
• Mostly is used in the field of computer science
• Example
• (10101)2
• (101111010)2
• (1110101)2
Octal Number System
• A positional number system which has eight digits
• Base = 8, total digits 0, 1, 2, 3, 4, 5, 6, 7
• The maximum value of a single digit is 7 (one less than the
value of the base)
• Each position of a digit represents a specific power of the base
(8)
• Not much used in the real-world mathematics
• Example
• (2057)8
• (6605)8
• (321)8
Hexadecimal Number System
• A positional number system which has a total of 16 digits or symbols
• Base = 16, so total 16 symbols and digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C,
D, E, F
• The symbols A, B, C, D, E, F represents decimal values 10, 11, 12, 13, 14
and 15
• The maximum value of a single digit is 15 (one less than the value of the
base)
• Each position of a digit represents a specific power of the base (16)
• Not much used in the real-world mathematics
• Example
• (1AF)16
• (9EA)16
• (664BD)16
Converting a number of another base
to decimal number
Conversion between Number Systems
• Octal to decimal conversion
• Example:
•
(4706)8 = (4x83) + (7x82) + (0x81) + (6x80)
• = (4x512) + (7x64) + (0x8) + (6x1)
• = 2048 + 448 + 0 + 6
• = (2502)10
Conversion between Number Systems
• Binary to decimal conversion
•
(10100011)2 = (1 × 27) + (0 × 26) + (1 × 25) + (0 ×
24) + (0 × 23) + (0 × 22) + (1 × 21) + (1 × 20)
• = 128 + 0 + 32 + 0 + 0 + 0 + 2 + 1.
• = (163)10
• (1010.11)2 = (10.75)10
• We multiply each binary digit with its place value and
add the products.
• (1010.11)2 = (1 × 23) + (0 × 22) + (1 × 21) + (0 × 20) +
(1 × 2-1) + (1 × 2-2)
• = 88 + 22 + 1221+ 1441
• = (10.75)10
Conversion between Number Systems
• Hexadecimal to decimal conversion.
• To find: (5BC)1616 in the decimal system
• In Hexadecimal system,
• 5=5
• B = 11
• C = 12
• Using hexadecimal to decimal formula,
• (5BC)1616 = ( 5 × 162 + 11 × 161 + 12 × 160 )
• = 5 × 256 + 11 × 16 + 12× 1
• = (1468)1010
Therefore, (5BC)1616 =(1468)10
Converting a decimal number to a number
of another base
Conversion between Number Systems
• Decimal to octal conversion
• Example:
• (952)10 = ?8
•
Hence, (952)10 = (1670)8
Conversion between Number Systems
• Decimal to binary conversion
• (100)10 = ?2
•
(100)10 =(1100100)2
Conversion between Number Systems
• Converting a number of some base to a number of another base
• Convert the original number to a decimal base (10)
• Convert the decimal number obtained in the above step to the
new base number
• Examples:
• (545)6 = ?4
• = (209)10 = (3101)4
•
(545)8 = ?4
• = (357)10 = (11211)4
Conversion between Number Systems
• Shortcut method for converting a binary number to an
octal number
• Divide the binary digits into groups of three starting from
the right
• Convert each group of three binary digits to one octal
digit using the method of binary to decimal conversio
Conversion between Number Systems
• Example: (1101010)2 = ?8
• 001 101 010
•
(001)2 = (0x22) + (0x21) + (1x20) = (1)10
• (101)2 = (1x22) + (0x21) + (1x20) = (5)10
• (010)2 = (0x22) + (1x21) + (0x20) = (2)10
• Hence, (1101010)2 = (152)8
Conversion between Number Systems
• Example:
•
(562)8 = ?2
• 5 = 101 6 = 110 2 = 010
• 101 110 010
• Hence, (562)8 = (101110010)2
Conversion between Number Systems
Shortcut method for converting a binary number
to a hexadecimal number
•
Divide the binary digits into groups of four starting
from the right
•
Convert each group of four binary digits to one
hexadecimal digit using the method of binary to
hexadecimal conversion
Conversion between Number Systems
•
Example: (111101)2 = ?16
• 0011 1101
• (0011)2 = (0x23) + (0x22) + (1x21) + (1x20) = (3)10 = (3)16
• (1101)2 = (1x23) + (1x22) + (0x21) + (1x20) = (13)10 =
(D)16
• Hence, (111101)2 = (3D)16
Conversion between Number Systems
Shortcut method for converting a hexadecimal
number to a binary number
•
Convert the decimal equivalent of each
hexadecimal digit to a four digit binary
number
•
Combine all the individual groups of four
binary digits into a single binary number
Conversion between Number Systems
Example:
•
(2AB)16 = ?2
• (2)16 = (2)10 = 0010 (A)16 = (10)10 = 1010
•
• (B)16 = (11)10 = 1011
•
0010 1010 1011
• Hence, (2AB)16 = (001010101011)2