SlideShare a Scribd company logo
Lecture Notes on Number Systems
for
Open Educational Resource
on
Basic Electronics (EC101)
by
Dr. Piyush Charan
Assistant Professor
Department of Electronics and Communication Engg.
Integral University, Lucknow
Introduction to Number Systems
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
2
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
3
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
4
Binary Number System
Base Radix = 2
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
5
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
6
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
7
Conversion Decimal to Binary
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
8
Conversion Decimal to Binary with
decimal points
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
9
Hexadecimal to Binary
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
10
Binary to Hexadecimal
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
11
Decimal to Octal
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
12
Decimal to Hexadecimal
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
13
Decimal to Hexadecimal with
Decimal Point
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
14
Hexadecimal to Decimal
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
15
Hexadecimal to Decimal with
Decimal Point
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
16
Octal to Decimal with Decimal
Point
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
17
Octal to Decimal with
Decimal Point
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
18
Binary to Octal with
floating point values
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
19
Octal to Binary with
floating point values
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
20
Hexadecimal to Octal
Conversion
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
21
Octal to Hexadecimal
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
22
Octal to Hexadecimal
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
23
Octal(base=8)
Decimal to Octal
8 98 2
8 12 4
8 1 1
0
Octal number system has the
radix 8 and will have
numbers starting from
0 → 7
(98)10→ (142)8
January 1, 2021 24
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
Octal(base=8)
Octal to Decimal
1 4 2
2 1 0
(142)8 →(98)10
1×8^2+4×8^1+2×8^0
=1×64+32+2
=98
January 1, 2021 25
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
Binary to Octal
• 0→000
• 1→001
• 2→010
• 3→011
• 4→100
• 5→101
• 6→110
• 7→111
2 7 1
2 3 1
2 1 1
0
January 1, 2021 26
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
Binary to Octal Conversion
• (100001110011)2→(4163)8
1 0 0 0 0 1 1 1 0 0 1 1
4 1 6 3
January 1, 2021 27
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
Octal to Hexadecimal
• (4163)8 → (?)16
1 0 0 0 0 1 1 1 0 0 1 1
4 1 6 3
1 0 0 0 0 1 1 1 0 0 1 1
8 7 3
January 1, 2021 28
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
29
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
30
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
31
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
32
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
33
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
34
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
35
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
36
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
37
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
38
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
39
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
40
January 1, 2021
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
41
42
1. Complement Theory
2. 1’s and, 2’s complement operation
Number System Continued....
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
43
1.Complement Theory
Example 1 Get 1’s complement of 50
Complement Digits
50 = 110010

001101
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
44
1’s Complement Arithmetic
(ADD/SUB Method)
1. Read both the operands
2. Negative operand(s) (if any) is converted into 1’s complement form
3. Add both the numbers
4. If carry is generated (i.e. =1) then the resultant number is positive.
5. Add ONE to the output of setp4, to get the final answer.
6. If carry is not generated then the answer is Negative and available in 1’s complement form.
7. Convert output of step 6 into 1’s complement to get final answer.
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
45
1. 1’s Complement Theory
Example 1 : Subtract 1010 from 1111 using 1’s complement theory. (15-
10 Small negative)

1 0 1 0 0 1 0 1
1 1 1 1
0 1 0 1
+
1] 0 1 0 0
+ 0 0 0 1
0 1 0 1 =(5)
1’s complement
Carry “1” means the answer is positive .
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
46
1. 1’s Complement Theory
Example 2 : Subtract 1010 from 1000 using 1’s complement theory.
(Large negative 8-10)
1 0 1 0 0 1 0 1
1 0 0 0
0 1 0 1
+
0] 1 1 0 1
1’s complement
Carry “0” means the answer is negative and available in 1’s complement form.
1 1 0 1 0 0 1 0 = (2)
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
47
2’s Complement Arithmetic
1. How to get 2’s complement form
2. Arithmetic operation using 2’s complement theory
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
48
2’s Complement Arithmetic (How to get 2’s
complement form..?)
Example 1
Example 2
Complement Digits
Add 1
5 = 00000101
-5 = 11111011

11111010
+1
Complement Digits
Add 1
-13 = 11110011
13 = 00001101

00001100
+1
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
49
2’s Complement Arithmetic
(Method)
1. Read both the operands
2. Negative operand (if any) is converted into 2’s complement form
3. Add both the numbers (2’s complement of negative operand with the other one).
4. If carry is generated (i.e. =1) then the resultant number is positive and in original form
5. If carry is not generated(when we have negative operand) then the carry is assumed =0.
6. Carry zero means the resultant number is negative and in a 2’s complement form.
7. Convert the 2’s complement form into the original form.
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
POS + NEG → POS Answer
50
Take the 2’s complement of the negative number and use regular binary 8-bit
addition.
00001001
9
+ (-5)
4
⎯→
⎯
11111011
+
00000101

11111010
+1
11111011
2’s
Complement
Process
100000100
Last Bit = 1: Answer is Positive Disregard 9th Bit
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
POS + NEG → NEG Answer
51
Take the 2’s complement of the negative number and use regular 8-bit
binary addition.
11110111
(-9)
+ 5
-4
⎯→
⎯
00000101
+
00001001

11110110
+1
11110111
2’s
Complement
Process
011111100
Last Bit = 0: Answer is Negative . Discard the last bit
11111100

00000011
+1
00000100
To Check:
Perform 2’s
Complement
On Answer
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
Verify the logic using following combinations:
1: (10) –(01)
2: (10) –(02)
3: (10) –(05)
4: (10) –(08)
5: (10) –(09)
6: (10) –(10)
7: (210) –(08)
8: (120) –(55)
9: (52) –(18)
January 1, 2021 52
Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
A+B A B 2’s of B Addition Ans
A=10
B=-1
1 0 1 0
0 0 0 1 1 1 1 0
0 0 0 1
1 1 1 1
1 0 1 0
1 1 1 1 CY =1 So ans is +ve
1 1 0 0 1
+9
B=-2 0 0 1 0 1 1 0 1
0 0 0 1
1 1 1 0
1 0 1 0
1 1 1 0 CY =1 So ans is +ve
1 1 0 0 0
+8
B=-5 0 1 0 1 1 0 1 0
0 0 0 1
1 0 1 1
1 0 1 0
1 0 1 1
1 0 1 0 1 CY =1 So ans is +ve
+5
B=-8 1 0 0 0 0 1 1 1
0 0 0 1
1 0 0 0
1 0 1 0
1 0 0 0
1 0 0 1 0 CY =1 So ans is +ve
+2
B=-9 1 0 0 1 0 1 1 0
0 0 0 1
0 1 1 1
1 0 1 0
0 1 1 1
1 0 0 0 1 CY =1 So ans is +ve
+1
B=-10 1 0 1 0 0 1 0 1
0 0 0 1
0 1 1 0
1 0 1 0
0 1 1 0
1 0 0 0 0 CY =1 So ans is +ve
+0
2’s Complement Arithmetic (Examples)
January 1, 2021
53
Dr. Piyush Charan, Dept. of ECE, Integral University,
Lucknow
Example: Perform 2’s complement subtraction on 210-08
210 = 1 1 0 1 0 0 1 0 (Subtrahend)
8= 0 0 0 0 1 0 0 0 (Minuend)
2’s complement of 8 is = 1 1 1 1 1 0 0 0
Add both the numbers:
1 1 0 1 0 0 1 0
+1 1 1 1 1 0 0 0
1 1 1 0 0 1 0 1 0
Carry = 1 means and is positive +202
January 1, 2021 54
Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
55
2’s Complement Arithmetic (Examples on varying
number of bits)
Example: Perform 2’s complement arithmetic for (30)-(50) using
1: 6-bit number system
2: 8-bit number system
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
Example: Perform 2’s complement arithmetic for (30)-(50)
using:
(30)= 0 1 1 1 1 0
(-50)= 1 1 0 0 1 0 2’s complement 0 0 1 1 0 1
0 0 0 0 0 1
0 0 1 1 1 0
Add both the numbers
0 1 1 1 1 0
0 0 1 1 1 0
0 1 0 1 1 0 0
Carry =0 means number is negative and in 2’s compl form
(30)= 0 0 0 1 1 1 1 0
(-50)= 0 0 1 1 0 0 1 0 2’s complement 1 1 0 0 1 1 0 1
0 0 0 0 0 0 0 1
1 1 0 0 1 1 1 0
0 0 0 1 1 1 1 0
1 1 0 0 1 1 1 0
0 1 1 1 0 1 1 0 0
Carry =0 means number is negative and in 2’s compl form
0 1 0 0 1 1
0 0 0 0 0 1
0 1 0 1 0 0 = -20
0 0 0 1 0 0 1 1
0 0 0 0 0 0 0 1
0 0 0 1 0 1 0 0 = -20
Add both the numbers
1: 6-bit number system 2: 8-bit number system
January 1, 2021 56
Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
BCD Numbers
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 57
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 58
1. Binary to decimal Conversion
2. BCD Addition
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 59
9’s & 10’s Complement
January 1, 2021 60
Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
Decimal(base 10) Addition
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 61
Octal (base 8) Addition
January 1, 2021 62
Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
Hexadecimal(base 16) Addition
January 1, 2021 63
Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
Hexadecimal Number System
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 64
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 65
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 66
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 67
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 68
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 69
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 70
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 71
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 72
Assignment Question
Q. Solve for x:
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 73
Assignment Solution
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 74
January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 75

More Related Content

PDF
Unit 4 Switching Theory and Logic Gates
PPTX
Boolean Algebra
PPTX
03 present-worth
PDF
Unit 2: Data Representation contd.
PPT
Lecture 1-431171839-lec2-BinaryArithmetic.ppt
PPTX
CS301ES: ANALOG AND DIGITAL ELECTRONICS unit-3
PPTX
Computer Architecture Binary Arithmetic Lecture.pptx
PPTX
Digital Electronics and Computer Language
Unit 4 Switching Theory and Logic Gates
Boolean Algebra
03 present-worth
Unit 2: Data Representation contd.
Lecture 1-431171839-lec2-BinaryArithmetic.ppt
CS301ES: ANALOG AND DIGITAL ELECTRONICS unit-3
Computer Architecture Binary Arithmetic Lecture.pptx
Digital Electronics and Computer Language

Similar to Unit 4_Part 1_Number System (20)

PDF
Complement
PPT
8 number-system
PPTX
Number system
PPTX
L3 ARITHMETIC OPERATIONS.pptx
PDF
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
PPTX
Digital Electronics: UNIT-I DIGITAL FUNDAMENTALS
PDF
digital-electronics (1)_watermark.pdfhindi
PPT
1’s and 2’s complements
PDF
Lecture 1 Number Systems.pdfdsddsdsdsdsdsd
PPTX
digital-electronics.pptx
PPT
lec2_BinaryArithmetic.ppt
PPT
สอนสนอนlec3สอนสนอนlec3สอนสนอนlec3สอนสนอนlec3สอนสนอนlec3
PDF
MODULmds kletmlskaf,lwmeltlwtm,reltm,lgglsekpwrpo
PDF
Digital logic and design 02
PDF
Module 4_Digital Electronics till complements.pdf
PPTX
UNIT - I.pptx
PPTX
UNIT - I.pptx
PPTX
ALU.pptx kjvjjfjrshfjshfjrhfjershfherjghre
PPT
Arithmetic circuits
PPTX
Binary-Arithmeticcccccccccccccccccc.pptx
Complement
8 number-system
Number system
L3 ARITHMETIC OPERATIONS.pptx
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
Digital Electronics: UNIT-I DIGITAL FUNDAMENTALS
digital-electronics (1)_watermark.pdfhindi
1’s and 2’s complements
Lecture 1 Number Systems.pdfdsddsdsdsdsdsd
digital-electronics.pptx
lec2_BinaryArithmetic.ppt
สอนสนอนlec3สอนสนอนlec3สอนสนอนlec3สอนสนอนlec3สอนสนอนlec3
MODULmds kletmlskaf,lwmeltlwtm,reltm,lgglsekpwrpo
Digital logic and design 02
Module 4_Digital Electronics till complements.pdf
UNIT - I.pptx
UNIT - I.pptx
ALU.pptx kjvjjfjrshfjshfjrhfjershfherjghre
Arithmetic circuits
Binary-Arithmeticcccccccccccccccccc.pptx
Ad

More from Dr Piyush Charan (20)

PDF
Unit 1- Intro to Wireless Standards.pdf
PPTX
Unit 1 Solar Collectors
PDF
Unit 5 Quantization
PDF
Unit 4 Lossy Coding Preliminaries
PDF
Unit 3 Geothermal Energy
PDF
Unit 2: Programming Language Tools
PDF
Unit 4 Arrays
PDF
Unit 3 Lecture Notes on Programming
PDF
Unit 3 introduction to programming
PDF
Forensics and wireless body area networks
PDF
Final PhD Defense Presentation
PDF
Unit 3 Arithmetic Coding
PDF
Unit 2 Lecture notes on Huffman coding
PDF
Unit 1 Introduction to Data Compression
PDF
Unit 3 Dictionary based Compression Techniques
PDF
Unit 1 Introduction to Non-Conventional Energy Resources
PDF
Unit 5-Operational Amplifiers and Electronic Measurement Devices
PDF
Unit 1 Introduction to Data Compression
PDF
Unit 1 Numerical Problems on PN Junction Diode
PDF
Unit 5 Global Issues- Early life of Prophet Muhammad
Unit 1- Intro to Wireless Standards.pdf
Unit 1 Solar Collectors
Unit 5 Quantization
Unit 4 Lossy Coding Preliminaries
Unit 3 Geothermal Energy
Unit 2: Programming Language Tools
Unit 4 Arrays
Unit 3 Lecture Notes on Programming
Unit 3 introduction to programming
Forensics and wireless body area networks
Final PhD Defense Presentation
Unit 3 Arithmetic Coding
Unit 2 Lecture notes on Huffman coding
Unit 1 Introduction to Data Compression
Unit 3 Dictionary based Compression Techniques
Unit 1 Introduction to Non-Conventional Energy Resources
Unit 5-Operational Amplifiers and Electronic Measurement Devices
Unit 1 Introduction to Data Compression
Unit 1 Numerical Problems on PN Junction Diode
Unit 5 Global Issues- Early life of Prophet Muhammad
Ad

Recently uploaded (20)

PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
86236642-Electric-Loco-Shed.pdf jfkduklg
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPT
Total quality management ppt for engineering students
PPTX
introduction to high performance computing
PPTX
Artificial Intelligence
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
PPTX
communication and presentation skills 01
PPTX
Information Storage and Retrieval Techniques Unit III
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
Safety Seminar civil to be ensured for safe working.
PDF
Soil Improvement Techniques Note - Rabbi
PDF
Integrating Fractal Dimension and Time Series Analysis for Optimized Hyperspe...
PPTX
Fundamentals of safety and accident prevention -final (1).pptx
PDF
PPT on Performance Review to get promotions
PDF
COURSE DESCRIPTOR OF SURVEYING R24 SYLLABUS
PPTX
Current and future trends in Computer Vision.pptx
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
86236642-Electric-Loco-Shed.pdf jfkduklg
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Total quality management ppt for engineering students
introduction to high performance computing
Artificial Intelligence
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
communication and presentation skills 01
Information Storage and Retrieval Techniques Unit III
UNIT 4 Total Quality Management .pptx
Safety Seminar civil to be ensured for safe working.
Soil Improvement Techniques Note - Rabbi
Integrating Fractal Dimension and Time Series Analysis for Optimized Hyperspe...
Fundamentals of safety and accident prevention -final (1).pptx
PPT on Performance Review to get promotions
COURSE DESCRIPTOR OF SURVEYING R24 SYLLABUS
Current and future trends in Computer Vision.pptx

Unit 4_Part 1_Number System

  • 1. Lecture Notes on Number Systems for Open Educational Resource on Basic Electronics (EC101) by Dr. Piyush Charan Assistant Professor Department of Electronics and Communication Engg. Integral University, Lucknow
  • 2. Introduction to Number Systems January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 2
  • 3. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 3
  • 4. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 4
  • 5. Binary Number System Base Radix = 2 January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 5
  • 6. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 6
  • 7. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 7
  • 8. Conversion Decimal to Binary January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 8
  • 9. Conversion Decimal to Binary with decimal points January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 9
  • 10. Hexadecimal to Binary January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 10
  • 11. Binary to Hexadecimal January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 11
  • 12. Decimal to Octal January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 12
  • 13. Decimal to Hexadecimal January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 13
  • 14. Decimal to Hexadecimal with Decimal Point January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 14
  • 15. Hexadecimal to Decimal January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 15
  • 16. Hexadecimal to Decimal with Decimal Point January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 16
  • 17. Octal to Decimal with Decimal Point January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 17
  • 18. Octal to Decimal with Decimal Point January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 18
  • 19. Binary to Octal with floating point values January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 19
  • 20. Octal to Binary with floating point values January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 20
  • 21. Hexadecimal to Octal Conversion January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 21
  • 22. Octal to Hexadecimal January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 22
  • 23. Octal to Hexadecimal January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 23
  • 24. Octal(base=8) Decimal to Octal 8 98 2 8 12 4 8 1 1 0 Octal number system has the radix 8 and will have numbers starting from 0 → 7 (98)10→ (142)8 January 1, 2021 24 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
  • 25. Octal(base=8) Octal to Decimal 1 4 2 2 1 0 (142)8 →(98)10 1×8^2+4×8^1+2×8^0 =1×64+32+2 =98 January 1, 2021 25 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
  • 26. Binary to Octal • 0→000 • 1→001 • 2→010 • 3→011 • 4→100 • 5→101 • 6→110 • 7→111 2 7 1 2 3 1 2 1 1 0 January 1, 2021 26 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
  • 27. Binary to Octal Conversion • (100001110011)2→(4163)8 1 0 0 0 0 1 1 1 0 0 1 1 4 1 6 3 January 1, 2021 27 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
  • 28. Octal to Hexadecimal • (4163)8 → (?)16 1 0 0 0 0 1 1 1 0 0 1 1 4 1 6 3 1 0 0 0 0 1 1 1 0 0 1 1 8 7 3 January 1, 2021 28 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
  • 29. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 29
  • 30. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 30
  • 31. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 31
  • 32. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 32
  • 33. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 33
  • 34. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 34
  • 35. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 35
  • 36. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 36
  • 37. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 37
  • 38. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 38
  • 39. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 39
  • 40. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 40
  • 41. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 41
  • 42. 42 1. Complement Theory 2. 1’s and, 2’s complement operation Number System Continued.... January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
  • 43. 43 1.Complement Theory Example 1 Get 1’s complement of 50 Complement Digits 50 = 110010  001101 January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
  • 44. 44 1’s Complement Arithmetic (ADD/SUB Method) 1. Read both the operands 2. Negative operand(s) (if any) is converted into 1’s complement form 3. Add both the numbers 4. If carry is generated (i.e. =1) then the resultant number is positive. 5. Add ONE to the output of setp4, to get the final answer. 6. If carry is not generated then the answer is Negative and available in 1’s complement form. 7. Convert output of step 6 into 1’s complement to get final answer. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
  • 45. 45 1. 1’s Complement Theory Example 1 : Subtract 1010 from 1111 using 1’s complement theory. (15- 10 Small negative)  1 0 1 0 0 1 0 1 1 1 1 1 0 1 0 1 + 1] 0 1 0 0 + 0 0 0 1 0 1 0 1 =(5) 1’s complement Carry “1” means the answer is positive . January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
  • 46. 46 1. 1’s Complement Theory Example 2 : Subtract 1010 from 1000 using 1’s complement theory. (Large negative 8-10) 1 0 1 0 0 1 0 1 1 0 0 0 0 1 0 1 + 0] 1 1 0 1 1’s complement Carry “0” means the answer is negative and available in 1’s complement form. 1 1 0 1 0 0 1 0 = (2) January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
  • 47. 47 2’s Complement Arithmetic 1. How to get 2’s complement form 2. Arithmetic operation using 2’s complement theory January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
  • 48. 48 2’s Complement Arithmetic (How to get 2’s complement form..?) Example 1 Example 2 Complement Digits Add 1 5 = 00000101 -5 = 11111011  11111010 +1 Complement Digits Add 1 -13 = 11110011 13 = 00001101  00001100 +1 January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
  • 49. 49 2’s Complement Arithmetic (Method) 1. Read both the operands 2. Negative operand (if any) is converted into 2’s complement form 3. Add both the numbers (2’s complement of negative operand with the other one). 4. If carry is generated (i.e. =1) then the resultant number is positive and in original form 5. If carry is not generated(when we have negative operand) then the carry is assumed =0. 6. Carry zero means the resultant number is negative and in a 2’s complement form. 7. Convert the 2’s complement form into the original form. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
  • 50. POS + NEG → POS Answer 50 Take the 2’s complement of the negative number and use regular binary 8-bit addition. 00001001 9 + (-5) 4 ⎯→ ⎯ 11111011 + 00000101  11111010 +1 11111011 2’s Complement Process 100000100 Last Bit = 1: Answer is Positive Disregard 9th Bit January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
  • 51. POS + NEG → NEG Answer 51 Take the 2’s complement of the negative number and use regular 8-bit binary addition. 11110111 (-9) + 5 -4 ⎯→ ⎯ 00000101 + 00001001  11110110 +1 11110111 2’s Complement Process 011111100 Last Bit = 0: Answer is Negative . Discard the last bit 11111100  00000011 +1 00000100 To Check: Perform 2’s Complement On Answer January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
  • 52. Verify the logic using following combinations: 1: (10) –(01) 2: (10) –(02) 3: (10) –(05) 4: (10) –(08) 5: (10) –(09) 6: (10) –(10) 7: (210) –(08) 8: (120) –(55) 9: (52) –(18) January 1, 2021 52 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
  • 53. A+B A B 2’s of B Addition Ans A=10 B=-1 1 0 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 1 0 1 0 1 1 1 1 CY =1 So ans is +ve 1 1 0 0 1 +9 B=-2 0 0 1 0 1 1 0 1 0 0 0 1 1 1 1 0 1 0 1 0 1 1 1 0 CY =1 So ans is +ve 1 1 0 0 0 +8 B=-5 0 1 0 1 1 0 1 0 0 0 0 1 1 0 1 1 1 0 1 0 1 0 1 1 1 0 1 0 1 CY =1 So ans is +ve +5 B=-8 1 0 0 0 0 1 1 1 0 0 0 1 1 0 0 0 1 0 1 0 1 0 0 0 1 0 0 1 0 CY =1 So ans is +ve +2 B=-9 1 0 0 1 0 1 1 0 0 0 0 1 0 1 1 1 1 0 1 0 0 1 1 1 1 0 0 0 1 CY =1 So ans is +ve +1 B=-10 1 0 1 0 0 1 0 1 0 0 0 1 0 1 1 0 1 0 1 0 0 1 1 0 1 0 0 0 0 CY =1 So ans is +ve +0 2’s Complement Arithmetic (Examples) January 1, 2021 53 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
  • 54. Example: Perform 2’s complement subtraction on 210-08 210 = 1 1 0 1 0 0 1 0 (Subtrahend) 8= 0 0 0 0 1 0 0 0 (Minuend) 2’s complement of 8 is = 1 1 1 1 1 0 0 0 Add both the numbers: 1 1 0 1 0 0 1 0 +1 1 1 1 1 0 0 0 1 1 1 0 0 1 0 1 0 Carry = 1 means and is positive +202 January 1, 2021 54 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
  • 55. 55 2’s Complement Arithmetic (Examples on varying number of bits) Example: Perform 2’s complement arithmetic for (30)-(50) using 1: 6-bit number system 2: 8-bit number system January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
  • 56. Example: Perform 2’s complement arithmetic for (30)-(50) using: (30)= 0 1 1 1 1 0 (-50)= 1 1 0 0 1 0 2’s complement 0 0 1 1 0 1 0 0 0 0 0 1 0 0 1 1 1 0 Add both the numbers 0 1 1 1 1 0 0 0 1 1 1 0 0 1 0 1 1 0 0 Carry =0 means number is negative and in 2’s compl form (30)= 0 0 0 1 1 1 1 0 (-50)= 0 0 1 1 0 0 1 0 2’s complement 1 1 0 0 1 1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 1 0 1 1 0 0 1 1 1 0 0 1 1 1 0 1 1 0 0 Carry =0 means number is negative and in 2’s compl form 0 1 0 0 1 1 0 0 0 0 0 1 0 1 0 1 0 0 = -20 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 = -20 Add both the numbers 1: 6-bit number system 2: 8-bit number system January 1, 2021 56 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
  • 57. BCD Numbers January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 57
  • 58. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 58
  • 59. 1. Binary to decimal Conversion 2. BCD Addition January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 59
  • 60. 9’s & 10’s Complement January 1, 2021 60 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
  • 61. Decimal(base 10) Addition January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 61
  • 62. Octal (base 8) Addition January 1, 2021 62 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
  • 63. Hexadecimal(base 16) Addition January 1, 2021 63 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow
  • 64. Hexadecimal Number System January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 64
  • 65. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 65
  • 66. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 66
  • 67. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 67
  • 68. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 68
  • 69. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 69
  • 70. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 70
  • 71. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 71
  • 72. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 72
  • 73. Assignment Question Q. Solve for x: January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 73
  • 74. Assignment Solution January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 74
  • 75. January 1, 2021 Dr. Piyush Charan, Dept. of ECE, Integral University, Lucknow 75