SlideShare a Scribd company logo
1
Number System
Lecture 2
2
Introduction to Number Systems
• We are all familiar with the decimal number
system (Base 10). Some other number
systems that we will work with are:
• Binary  Base 2
• Octal  Base 8
• Hexadecimal  Base 16
3
Characteristics of Numbering Systems
1) The digits are consecutive.
2) The number of digits is equal to the size of
the base.
3) Zero is always the first digit.
4) The base number is never a digit.
5) When 1 is added to the largest digit, a sum
of zero and a carry of one results.
6) Numeric values determined by the implicit
positional values of the digits.
4
Significant Digits
Decimal: 82347
Most significant digit Least significant digit
Binary: 101010
Most significant digit Least significant digit
5
Binary Number System
• Also called the “Base 2 system”
• The binary number system is used to model
the series of electrical signals computers
use to represent information
• 0 represents the no voltage or an off state
• 1 represents the presence of voltage or an
on state
6
Binary Numbering Scale
Base 2
Number
Base 10
Equivalent
Power
Positional
Value
000 0 20 1
001 1 21 2
010 2 22 4
011 3 23 8
100 4 24 16
101 5 25 32
110 6 26 64
111 7 27 128
7
Binary Addition
4 Possible Binary Addition Combinations:
(1) 0 (2) 0
+0 +1
00 01
(3) 1 (4) 1
+0 +1
01 10
SumCarry
Note that leading zeroes are frequently dropped.
SumCarry
8
Decimal to Binary Conversion
• The easiest way to convert a decimal
number to its binary equivalent is to use the
Division Algorithm
• This method repeatedly divides a decimal
number by 2 and records the quotient and
remainder
• The remainder digits (a sequence of zeros and
ones) form the binary equivalent in least
significant to most significant digit sequence
9
Division Algorithm
Convert 67 to its binary equivalent:
6710 = x2
Step 1: 67 / 2 = 33 R 1 Divide 67 by 2. Record quotient in next row
Step 2: 33 / 2 = 16 R 1 Again divide by 2; record quotient in next row
Step 3: 16 / 2 = 8 R 0 Repeat again
Step 4: 8 / 2 = 4 R 0 Repeat again
Step 5: 4 / 2 = 2 R 0 Repeat again
Step 6: 2 / 2 = 1 R 0 Repeat again
Step 7: 1 / 2 = 0 R 1 STOP when quotient equals 0
1 0 0 0 0 1 12
10
Binary to Decimal Conversion
• The easiest method for converting a binary number
to its decimal equivalent is to use the Multiplication
Algorithm
• Multiply the binary digits by increasing powers of
two, starting from the right
• Then, to find the decimal number equivalent, sum
those products
11
Multiplication Algorithm
Convert (10101101)2 to its decimal equivalent:
Binary 1 0 1 0 1 1 0 1
Positional Values
xxxxxxxx
2021222324252627
128 +0+32 +0+ 8 + 4 +0+ 1Products
17310
12
Octal Number System
• Also known as the Base 8 System
• Uses digits 0 - 7
• Readily converts to binary
• Groups of three (binary) digits can be used to
represent each octal digit
• Also uses multiplication and division algorithms for
conversion to and from base 10
13
Decimal to Octal Conversion
Convert 42710 to its octal equivalent:
427 / 8 = 53 R 3 Divide by 8; R is LSD
53 / 8 = 6 R 5 Divide Q by 8; R is next digit
6 / 8 = 0 R 6 Repeat until Q = 0
6538
14
Octal to Decimal Conversion
Convert 6538 to its decimal equivalent:
6 5 3
xxx
82 81 80
384 + 40 + 3
42710
Positional Values
Products
Octal Digits
15
Octal to Binary Conversion
Each octal number converts to 3 binary digits
To convert 6538 to binary, just
substitute code:
6 5 3
110 101 011
Code
0 0 0 0
1 0 0 1
2 0 1 0
3 0 1 1
4 1 0 0
5 1 0 1
6 1 1 0
7 1 1 1
16
Hexadecimal Number System
• Base 16 system
• Uses digits 0-9 &
letters A,B,C,D,E,F
• Groups of four bits
represent each
base 16 digit
17
Decimal to Hexadecimal Conversion
Convert 83010 to its hexadecimal equivalent:
830 / 16 = 51 R 14
51 / 16 = 3 R 3
3 / 16 = 0 R 3
33E16
= E in Hex
18
Hexadecimal to Decimal Conversion
Convert 3B4F16 to its decimal equivalent:
Hex Digits
3 B 4 F
xxx
163 162 161 160
12288 +2816 + 64 +15
15,18310
Positional Values
Products
x
19
Binary to Hexadecimal Conversion
• The easiest method for converting binary to
hexadecimal is to use a substitution code
• Each hex number converts to 4 binary digits
20
Convert 0101011010101110011010102 to hex
using the 4-bit substitution code :
0101 0110 1010 1110 0110 1010
Substitution Code
5 6 A E 6 A
56AE6A16
21
Substitution code can also be used to convert binary to
octal by using 3-bit groupings:
010 101 101 010 111 001 101 010
Substitution Code
2 5 5 2 7 1 5 2
255271528
22
Complement
• Complement is the negative equivalent of a number.
• If we have a number N then complement of N will
give us another number which is equivalent to –N
• So if complement of N is M, then we can say M = -N
So complement of M = -M = -(-N) = N
• So complement of complement gives the original
number
23
Types of Complement
• For a number of base r, two types of complements
can be found
• 1. r’s complement
• 2. (r-1)’s complement
• Definition:
• If N is a number of base r having n digits then
• r’s complement of N = rn – N and
• (r-1)’s complement of N = rn-N-1
24
Example
• Suppose N = (3675)10
• So we can find two complements of this number.
The 10’s complement and the 9’s complement.
Here n = 4
• 10’s complement of (3675) = 104-3675
= 6325
• 9’s complement of (3675) = 104-3675 -1
= 6324
25
Short cut way to find (r-1)’s complement
• In the previous example we see that 9’s
complement of 3675 is 6324. We can get the result
by subtracting each digit from 9.
• Similarly for other base, the (r-1)’s complement can
be found by subtracting each digit from r-1 (the
highest digit in that system).
• For binary 1’s complement is even more easy. Just
change 1 to 0 and 0 to 1. (Because 1-1=0 and 1-
0=1)
26
Example:
• (110100101)2 1’s complement 001011010
• (110100101)2 2’s complement 001011011
27
Use of Complement
• Complement is used to perform subtraction using addition
• Mathematically A-B = A + (-B)
• So we can get the result of A-B by adding complement of B
with A.
• So A-B = A + Complement of (B)
• Now we can use either r’s complement or (r-1)’s
complement
28
Complementary Arithmetic
• 1’s complement
• Switch all 0’s to 1’s and 1’s to 0’s
Binary # 10110011
1’s complement 01001100
29
Complementary Arithmetic
• 2’s complement
• Step 1: Find 1’s complement of the number
Binary # 11000110
1’s complement 00111001
• Step 2: Add 1 to the 1’s complement
00111001
+ 00000001
00111010
30
Complementary Arithmetic
1000 8 8
-100 -4 6
14
1000 100
Add 2’s Com 100 1’s complement 011
Discard MSB 1100 2’s complement 100
Result 100
Addition, subtraction, multiplication and division all can
be done by only addition.
31
Thank You

More Related Content

PPTX
Number system in Digital Electronics
PPTX
Number System
PPTX
Decimal number system
PPT
De numbers systems vk ppt
PPT
Number systems ppt
PPTX
Conversion of Number Systems
PPTX
Digital Electronics and Computer Language
PPTX
Number system
Number system in Digital Electronics
Number System
Decimal number system
De numbers systems vk ppt
Number systems ppt
Conversion of Number Systems
Digital Electronics and Computer Language
Number system

What's hot (20)

PPT
binary number system
PDF
chapter one && two.pdf
PPTX
Number Systems and Binary Aritmetics
PPTX
Number system and their conversion
PPTX
number system
PDF
Number System Conversion
PPTX
09 binary number systems
PDF
Chapter 7 rohith
PDF
Digital Electronics- Number systems & codes
PPT
BINARY NUMBER SYSTEM
PPTX
Number system conversion
PPT
Complements
PPTX
Number Base Conversion Digital Electronics
PPTX
Number Systems
PPT
Number system
PPT
2s complement arithmetic
PPTX
Binary Arithmetic
PPTX
Number system
PDF
Binaty Arithmetic and Binary coding schemes
PPTX
Number system computer fundamental
binary number system
chapter one && two.pdf
Number Systems and Binary Aritmetics
Number system and their conversion
number system
Number System Conversion
09 binary number systems
Chapter 7 rohith
Digital Electronics- Number systems & codes
BINARY NUMBER SYSTEM
Number system conversion
Complements
Number Base Conversion Digital Electronics
Number Systems
Number system
2s complement arithmetic
Binary Arithmetic
Number system
Binaty Arithmetic and Binary coding schemes
Number system computer fundamental
Ad

Similar to Lecture 2 ns (20)

PPT
Number system on various number tyoes decimal
PDF
Number systems
PDF
Digital Logic
PPTX
Number_system_B.pharm_2nd_BP205T_Unit_1_Ravi.pptx
PPTX
1. NUMBER SYSTEM.pptx Computer Applications in Pharmacy
PPT
Number Systems and its effectiveness .ppt
PPT
Number_Systems_Number base conversions.ppt
PPT
Number_Systems decimal, binary, octal, and hexadecimal
PPT
An introduction to the different number systems
PPT
Number_Systems _binary_octal_hex_dec.ppt
PPTX
Number System & codes.pptx ye mg of the day
PPTX
Introduction of number system
PPTX
Introduction to number system
PPT
Number systems and its conversion & complements.ppt
PPT
Number_Systems (2).ppt
PPTX
chapter2.pptx electrical engineering for student
RTF
DCF QNA edited
PPTX
ADE UNIT-III (Digital Fundamentals).pptx
PPTX
Presentaion on introduction to Number system
Number system on various number tyoes decimal
Number systems
Digital Logic
Number_system_B.pharm_2nd_BP205T_Unit_1_Ravi.pptx
1. NUMBER SYSTEM.pptx Computer Applications in Pharmacy
Number Systems and its effectiveness .ppt
Number_Systems_Number base conversions.ppt
Number_Systems decimal, binary, octal, and hexadecimal
An introduction to the different number systems
Number_Systems _binary_octal_hex_dec.ppt
Number System & codes.pptx ye mg of the day
Introduction of number system
Introduction to number system
Number systems and its conversion & complements.ppt
Number_Systems (2).ppt
chapter2.pptx electrical engineering for student
DCF QNA edited
ADE UNIT-III (Digital Fundamentals).pptx
Presentaion on introduction to Number system
Ad

Recently uploaded (20)

PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
Welding lecture in detail for understanding
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
web development for engineering and engineering
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
Construction Project Organization Group 2.pptx
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
PPT on Performance Review to get promotions
PPTX
Sustainable Sites - Green Building Construction
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Automation-in-Manufacturing-Chapter-Introduction.pdf
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Embodied AI: Ushering in the Next Era of Intelligent Systems
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Internet of Things (IOT) - A guide to understanding
Welding lecture in detail for understanding
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Model Code of Practice - Construction Work - 21102022 .pdf
bas. eng. economics group 4 presentation 1.pptx
web development for engineering and engineering
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Construction Project Organization Group 2.pptx
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
CYBER-CRIMES AND SECURITY A guide to understanding
PPT on Performance Review to get promotions
Sustainable Sites - Green Building Construction
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf

Lecture 2 ns

  • 2. 2 Introduction to Number Systems • We are all familiar with the decimal number system (Base 10). Some other number systems that we will work with are: • Binary  Base 2 • Octal  Base 8 • Hexadecimal  Base 16
  • 3. 3 Characteristics of Numbering Systems 1) The digits are consecutive. 2) The number of digits is equal to the size of the base. 3) Zero is always the first digit. 4) The base number is never a digit. 5) When 1 is added to the largest digit, a sum of zero and a carry of one results. 6) Numeric values determined by the implicit positional values of the digits.
  • 4. 4 Significant Digits Decimal: 82347 Most significant digit Least significant digit Binary: 101010 Most significant digit Least significant digit
  • 5. 5 Binary Number System • Also called the “Base 2 system” • The binary number system is used to model the series of electrical signals computers use to represent information • 0 represents the no voltage or an off state • 1 represents the presence of voltage or an on state
  • 6. 6 Binary Numbering Scale Base 2 Number Base 10 Equivalent Power Positional Value 000 0 20 1 001 1 21 2 010 2 22 4 011 3 23 8 100 4 24 16 101 5 25 32 110 6 26 64 111 7 27 128
  • 7. 7 Binary Addition 4 Possible Binary Addition Combinations: (1) 0 (2) 0 +0 +1 00 01 (3) 1 (4) 1 +0 +1 01 10 SumCarry Note that leading zeroes are frequently dropped. SumCarry
  • 8. 8 Decimal to Binary Conversion • The easiest way to convert a decimal number to its binary equivalent is to use the Division Algorithm • This method repeatedly divides a decimal number by 2 and records the quotient and remainder • The remainder digits (a sequence of zeros and ones) form the binary equivalent in least significant to most significant digit sequence
  • 9. 9 Division Algorithm Convert 67 to its binary equivalent: 6710 = x2 Step 1: 67 / 2 = 33 R 1 Divide 67 by 2. Record quotient in next row Step 2: 33 / 2 = 16 R 1 Again divide by 2; record quotient in next row Step 3: 16 / 2 = 8 R 0 Repeat again Step 4: 8 / 2 = 4 R 0 Repeat again Step 5: 4 / 2 = 2 R 0 Repeat again Step 6: 2 / 2 = 1 R 0 Repeat again Step 7: 1 / 2 = 0 R 1 STOP when quotient equals 0 1 0 0 0 0 1 12
  • 10. 10 Binary to Decimal Conversion • The easiest method for converting a binary number to its decimal equivalent is to use the Multiplication Algorithm • Multiply the binary digits by increasing powers of two, starting from the right • Then, to find the decimal number equivalent, sum those products
  • 11. 11 Multiplication Algorithm Convert (10101101)2 to its decimal equivalent: Binary 1 0 1 0 1 1 0 1 Positional Values xxxxxxxx 2021222324252627 128 +0+32 +0+ 8 + 4 +0+ 1Products 17310
  • 12. 12 Octal Number System • Also known as the Base 8 System • Uses digits 0 - 7 • Readily converts to binary • Groups of three (binary) digits can be used to represent each octal digit • Also uses multiplication and division algorithms for conversion to and from base 10
  • 13. 13 Decimal to Octal Conversion Convert 42710 to its octal equivalent: 427 / 8 = 53 R 3 Divide by 8; R is LSD 53 / 8 = 6 R 5 Divide Q by 8; R is next digit 6 / 8 = 0 R 6 Repeat until Q = 0 6538
  • 14. 14 Octal to Decimal Conversion Convert 6538 to its decimal equivalent: 6 5 3 xxx 82 81 80 384 + 40 + 3 42710 Positional Values Products Octal Digits
  • 15. 15 Octal to Binary Conversion Each octal number converts to 3 binary digits To convert 6538 to binary, just substitute code: 6 5 3 110 101 011 Code 0 0 0 0 1 0 0 1 2 0 1 0 3 0 1 1 4 1 0 0 5 1 0 1 6 1 1 0 7 1 1 1
  • 16. 16 Hexadecimal Number System • Base 16 system • Uses digits 0-9 & letters A,B,C,D,E,F • Groups of four bits represent each base 16 digit
  • 17. 17 Decimal to Hexadecimal Conversion Convert 83010 to its hexadecimal equivalent: 830 / 16 = 51 R 14 51 / 16 = 3 R 3 3 / 16 = 0 R 3 33E16 = E in Hex
  • 18. 18 Hexadecimal to Decimal Conversion Convert 3B4F16 to its decimal equivalent: Hex Digits 3 B 4 F xxx 163 162 161 160 12288 +2816 + 64 +15 15,18310 Positional Values Products x
  • 19. 19 Binary to Hexadecimal Conversion • The easiest method for converting binary to hexadecimal is to use a substitution code • Each hex number converts to 4 binary digits
  • 20. 20 Convert 0101011010101110011010102 to hex using the 4-bit substitution code : 0101 0110 1010 1110 0110 1010 Substitution Code 5 6 A E 6 A 56AE6A16
  • 21. 21 Substitution code can also be used to convert binary to octal by using 3-bit groupings: 010 101 101 010 111 001 101 010 Substitution Code 2 5 5 2 7 1 5 2 255271528
  • 22. 22 Complement • Complement is the negative equivalent of a number. • If we have a number N then complement of N will give us another number which is equivalent to –N • So if complement of N is M, then we can say M = -N So complement of M = -M = -(-N) = N • So complement of complement gives the original number
  • 23. 23 Types of Complement • For a number of base r, two types of complements can be found • 1. r’s complement • 2. (r-1)’s complement • Definition: • If N is a number of base r having n digits then • r’s complement of N = rn – N and • (r-1)’s complement of N = rn-N-1
  • 24. 24 Example • Suppose N = (3675)10 • So we can find two complements of this number. The 10’s complement and the 9’s complement. Here n = 4 • 10’s complement of (3675) = 104-3675 = 6325 • 9’s complement of (3675) = 104-3675 -1 = 6324
  • 25. 25 Short cut way to find (r-1)’s complement • In the previous example we see that 9’s complement of 3675 is 6324. We can get the result by subtracting each digit from 9. • Similarly for other base, the (r-1)’s complement can be found by subtracting each digit from r-1 (the highest digit in that system). • For binary 1’s complement is even more easy. Just change 1 to 0 and 0 to 1. (Because 1-1=0 and 1- 0=1)
  • 26. 26 Example: • (110100101)2 1’s complement 001011010 • (110100101)2 2’s complement 001011011
  • 27. 27 Use of Complement • Complement is used to perform subtraction using addition • Mathematically A-B = A + (-B) • So we can get the result of A-B by adding complement of B with A. • So A-B = A + Complement of (B) • Now we can use either r’s complement or (r-1)’s complement
  • 28. 28 Complementary Arithmetic • 1’s complement • Switch all 0’s to 1’s and 1’s to 0’s Binary # 10110011 1’s complement 01001100
  • 29. 29 Complementary Arithmetic • 2’s complement • Step 1: Find 1’s complement of the number Binary # 11000110 1’s complement 00111001 • Step 2: Add 1 to the 1’s complement 00111001 + 00000001 00111010
  • 30. 30 Complementary Arithmetic 1000 8 8 -100 -4 6 14 1000 100 Add 2’s Com 100 1’s complement 011 Discard MSB 1100 2’s complement 100 Result 100 Addition, subtraction, multiplication and division all can be done by only addition.