Professional Documents
Culture Documents
Faculty of Science
Department of Computer
First Semester
Fall 2023
Lect . Zhila Yaseen & Sabat Salih
Digital logic 1
Lecture 1 1
Topics covered
• Introduction
• Digital and Analog
• Advantages of Digital Techniques
• Number Systems
• Conversion Among Bases
2
❖ Digital
• The term "digital" refers to a method or technology that represents and processes
information using discrete values or digits, typically in binary form (0s and 1s).
3
❖ Digital Versus Analog
• Digital: - means signals are represented using discrete values, typically binary
4
❖ Digitallogic
• Digital logic, is a branch of mathematics and electronics that deals with the
manipulation of binary (two-state) signals and the design of circuits that perform
logical operations on these signals
• Digital logic defines various logical operations, including AND, OR, NOT,
XOR, and others. These operations are performed on binary inputs to
produce binary outputs based on predefined rules.
5
❖ Advantagesof Digital Techniques
Digital systems offer advantages such as
• Simpler design.
• Easy information storage.
• higher accuracy.
• Programmability.
• Resilience to noise .
• Ability to integrate more circuitry on integrated circuits (ICs)
6
❖ Limitations of Digital Techniques
The world around us is analog
• It is common to convert analog parameters into digital form.
(analog-to-digital converter, ADC)
• Process (operate on) the digital information.
• Convert the digital output back to real-world analog form.
(digital-to-analog converter, DAC)
7
Numbering Systems
8
❖ CommonNumberSystems
System Base Symbols
Decimal 10 0, 1, … 9
Binary 2 0, 1
Octal 8 0, 1, … 7
Hexa-decimal 16 0, 1, … 9, A,
B, … F
9
❖ Quantities/Counting
Decimal Binary Octal Hexa-decimal
0 0 0 0
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
8 1000 10 8
10
❖ Quantities/Counting
11
❖ Conversionamong bases
The possibilities:
Decimal Octal
Hexa-
Binary
decimal
12
❖ Decimalto any Number base
• Take the decimal number, and divide by the new number base
• Keep track of the quotient and remainder
• Repeat until quotient = 0
• Read number from the bottom to the top
13
❖ DecimaltoBinary
• Binary is base 2
Example: convert 45 (decimal) to binary
Quotient Remainder
45 / 2 = 22.5 1 LSB
22 / 2 = 11 0
11 / 2 = 5.5 1
5 / 2 = 2.5 1
2/2=1 0
1 / 2 = 0.5 1 MSB
▪ So (45)10 = (101101)2
▪ Left hand side is the Most Significant Bit (MSB) and right hand side is the Least
Significant Bit (LSB).
14
❖ Decimalto Octal
• Octal is base 8
Example. Convert the decimal number (350)10 to an octal number.
Quotient Remainder
• So (350)10 = (536)8
15
❖ Decimalto Hexadecimal
• Hexadecimal is base 16
Example. Convert the Convert (5386)10 to a hexadecimal number.
Quotient Remainder
5386/16 = 336.625 10 =A
336 /16 =21 0
21/16 = 1.3125 5
1/16 = 0.0625 1
• So (5286)10 = (150A)16
16
❖ Any Number Base to Decimal
• From right to left, multiply the digit of the number to convert by
its base position
• Sum all results
17
❖ Binary to Decimal
Binary is base 2
Example, convert (10110)2 to decimal
➔ 16+0 + 4 + 2 + 0
➔=22 10
➔ So 10110 2= 2210
18
❖ Octal to Decimal
• Octal is base 8
Example , convert (140)8 into a decimal number.
➔1408
➔1 × 82 + 4 × 81 + 0 × 80
➔1 × 64 + 4 × 8 + 0 × 1 = 64 + 32 + 0
➔64 + 32 + 0 = 96
So (140)8 = (96)10
19
❖ Hexadecimal to Decimal
• Hexadecimal is base 16
Example , convert (16)16 into a Decimal number.
➔ 1616
➔ 1x161 + 6x160
➔ 1x16 + 6x1
➔ 16 + 6
➔ 22
▪ So 1616 = 2210
20
Example 2 , convert (ABC)16 into a Decimal
number.
21
❖ Binary to Octal
• Octal is base 8.
Example, convert (1011010111)2 to Octal number.
➢ Group it in threes , starting on right to left , convert to octal digits.
1 3 2 7
• So (1011010111)2 =(1327)8
22
❖ Octal to Binary
➢ Convert each Octal digit to a 3-bit equivalent binary representation.
1 0 2 4
• So (1024)8 = (1000010100)2
23
❖ Binary to Hexadecimal
• Hexadecimal is base 16.
Example, convert (1010111011)2 to Octal number.
➢ Group it in fours , starting on right to left , convert to hexadecimal digits.
10 1011 1011
2 B B
• So (1010111011)2 =(2BB)16
24
❖ Hexadecimal to Binary
Example, convert (10AF)16 to binary number.
➢ Convert each hexadecimal digit to a 4-bit equivalent binary representation.
1 0 A F
➢ So (10AF)16 = (0001000010101111)2
25
❖ Home work 1
1. Convert Octal to Hexadecimal.
2. Convert Hexadecimal to Octal.
26
Number Systems
Continues….
27