SlideShare a Scribd company logo
SEIYUN UNIVERSITY
College of Applied Science – CS department
Instructor: Dr. Mazin Md. Alkathiri
Information technology Department
Faculty of Applied Sciences
Seiyun University – Yemen
Jan 2024
SEIYUN UNIVERSITY
College of Applied Science – CS department
2
SEIYUN UNIVERSITY
College of Applied Science – CS department
3
A digital logic system may well have a numerical computation
capability as well as its inherent logical capability.
Human beings normally perform arithmetic operations using the
decimal number system, but, a digital machine is inherently binary
and its numerical calculations are executed using a binary number
system.
Since the decimal system has ten digits, a ten-state device is required
to represent the decimal digits.
Ten-state devices are not readily available in the electrical world,
however two-state devices such as a transistor which are operating in a
switching mode.
A number of other systems such as the hexadecimal system are used in
conjunction with programmable logic devices.
Introduction
SEIYUN UNIVERSITY
College of Applied Science – CS department
4
We are all familiar with the decimal number system (Base 10). Some
other number systems that we will work with are:
 Decimal Base 10
 Binary Base 2
 Octal Base 8
 Hexadecimal Base 16
Introduction
SEIYUN UNIVERSITY
College of Applied Science – CS department
5
The digits are consecutive.
The number of digits is equal to the size of the base.
Zero is always the first digit.
The base number is never a digit.
When 1 is added to the largest digit, a sum of zero and a carry of one
results.
Characteristics of Numbering Systems
SEIYUN UNIVERSITY
College of Applied Science – CS department
Significant Digits
Binary: 11101101
Most significant digit Least significant digit
Hexadecimal: 1D63A7A
Most significant digit Least significant digit
SEIYUN UNIVERSITY
College of Applied Science – CS department
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
SEIYUN UNIVERSITY
College of Applied Science – CS department
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
SEIYUN UNIVERSITY
College of Applied Science – CS department
Binary Addition
4 Possible Binary Addition Combinations:
(1) 0 (2) 0
+0 +1
00 01
(3) 1 (4) 1
+0 +1
01 10
Sum
Carry
SEIYUN UNIVERSITY
College of Applied Science – CS department
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
SEIYUN UNIVERSITY
College of Applied Science – CS department
Division Algorithm
Convert (67)10 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 1)2
SEIYUN UNIVERSITY
College of Applied Science – CS department
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
SEIYUN UNIVERSITY
College of Applied Science – CS department
Multiplication Algorithm
Convert (10101101)2 to its decimal equivalent:
Binary 1 0 1 0 1 1 0 1
Positional Values
x
x
x
x
x
x
x
x
20
21
22
23
24
25
26
27
128 + 32 + 8 + 4 + 1
Products
(173)10
SEIYUN UNIVERSITY
College of Applied Science – CS department
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
SEIYUN UNIVERSITY
College of Applied Science – CS department
Decimal to Octal Conversion
Convert (427)10 to its octal equivalent:
427 / 8 = 53 R3 Divide by 8; R is LSD
53 / 8 = 6 R5 Divide Q by 8; R is next digit
6 / 8 = 0 R6 Repeat until Q = 0
(653)8
SEIYUN UNIVERSITY
College of Applied Science – CS department
Octal to Decimal Conversion
Convert (653)8 to its decimal equivalent:
6 5 3
x
x
x
82 81 80
384 + 40 + 3
(427)10
Positional Values
Products
Octal Digits
SEIYUN UNIVERSITY
College of Applied Science – CS department
Octal to Binary Conversion
Each octal number converts to 3 binary digits
To convert (653)8 to binary, just substitute code:
6 5 3
110 101 011
SEIYUN UNIVERSITY
College of Applied Science – CS department
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
SEIYUN UNIVERSITY
College of Applied Science – CS department
Decimal to Hexadecimal Conversion
Convert (830)10 to its hexadecimal equivalent:
830 / 16 = 51 R14
51 / 16 = 3 R3
3 / 16 = 0 R3
(33E)16
= E in Hex
SEIYUN UNIVERSITY
College of Applied Science – CS department
Hexadecimal to Decimal Conversion
Convert (3B4F)16 to its decimal equivalent:
Hex Digits 3 B 4 F
x
x
x
163 162 161 160
12288 +2816 + 64 +15
(15,183)10
Positional Values
Products
x
SEIYUN UNIVERSITY
College of Applied Science – CS department
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
SEIYUN UNIVERSITY
College of Applied Science – CS department
Convert (010101101010111001101010)2 to hex using the 4-bit substitution code :
0101 0110 1010 1110 0110 1010
Substitution Code
5 6 A E 6
A
(56AE6A)16
SEIYUN UNIVERSITY
College of Applied Science – CS department
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
(25527152)8
SEIYUN UNIVERSITY
College of Applied Science – CS department
Complementary Arithmetic
• 1’s complement
• Switch all 0’s to 1’s and 1’s to 0’s
Binary # 10110011
1’s complement 01001100
• The 2's complement representation of a binary number
X is defined by the equation:
[X]2 = 2n – X
For X = 1010 and n = 4 then:
[X]2 = 24 - 1010
= 10000 - 1010 = 0110
SEIYUN UNIVERSITY
College of Applied Science – CS department
• 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
+ 1
00111010
Complementary Arithmetic
SEIYUN UNIVERSITY
College of Applied Science – CS department
Signed magnitude representation
Signed 1's complement representation
Signed 2's complement representation
Example: Represent (+9) and (-9) in 8 bit-binary number
Only one way to represent +9 ==> 0 0001001
Three different ways to represent -9:
In signed-magnitude: 1 0001001
In signed-1's complement: 1 1110110
In signed-2's complement: 1 1110111
Need to be able to represent both positive and negative numbers
- Following 3 representations
Signed Numbers
SEIYUN UNIVERSITY
College of Applied Science – CS department
Complement:
Signed magnitude: Complement only the sign bit
Signed 1's complement: Complement all the bits including sign bit
Signed 2's complement: After the first (1) of the positive number
complement the bits including its sign bit.
Signed Numbers
SEIYUN UNIVERSITY
College of Applied Science – CS department
Singed Binary Numbers
In computers, both positive and negative numbers are represents only with
binary digits;
The left most bit (sign bit) in the number represents sign of the number;
The sign bit is 0 for the positive numbers, and 1 for negative numbers.
SEIYUN UNIVERSITY
College of Applied Science – CS department
Singed Binary Numbers
Addition and subtraction of 2's complement numbers:
Addition and subtraction in the 2's complement system are both carried out as
additions.
Example 1: Addition of two 8-bit positive numbers.
SEIYUN UNIVERSITY
College of Applied Science – CS department
Operations on Binary system
The rules for the addition of two single-bit
numbers as following :
A B Sum Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
1 1 1
1 0 1 1
0 1 1 1
1 0 0 1 0
11
+ 7
18
Carry
Sum
SEIYUN UNIVERSITY
College of Applied Science – CS department
The rules for the subtraction of two single-bit
numbers as following :
A B Difference Borrow
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
1 1
1 1 0 0
0 0 1 1
1 0 0 1
12
- 3
9
Operations on Binary system
Borrow
Deff.
SEIYUN UNIVERSITY
College of Applied Science – CS department
The rules for the Multiplication of two single-bit
numbers as following :
Operations on Binary system
A B Product
0 0 0
0 1 0
1 0 0
1 1 1
1110
x 1011
1110
1110
0000
1110
10011010
SEIYUN UNIVERSITY
College of Applied Science – CS department
Conversion of decimal numbers to any Radix number
Conversion of decimal to any radix number accomplished in two
steps:
Step 1: Convert the Integer part – by successive division
method;
Step 2: Convert the Fraction part - by successive
multiplication method.
SEIYUN UNIVERSITY
College of Applied Science – CS department
Conversion of decimal numbers to any Radix
number
1. successive division for integer part:
SEIYUN UNIVERSITY
College of Applied Science – CS department
Conversion of decimal numbers to any Radix number
SEIYUN UNIVERSITY
College of Applied Science – CS department
2. successive multiplication for Fraction part:
Conversion of decimal numbers to any Radix number
SEIYUN UNIVERSITY
College of Applied Science – CS department
Conversion of decimal numbers to any Radix
number
SEIYUN UNIVERSITY
College of Applied Science – CS department
Fractions
SEIYUN UNIVERSITY
College of Applied Science – CS department
3.14579
.14579
x 2
0.29158
x 2
0.58316
x 2
1.16632
x 2
0.33264
x 2
0.66528
x 2
1.33056
etc.
11.001001...
 Convert Decimal to Binary
 (3.14579)10 = (?)2
Fractions
SEIYUN UNIVERSITY
College of Applied Science – CS department
Operation in Octal
The rules for the Addition of two numbers as
following :
(3 4)8
+ (4 2)8
(7 6)8
(5 6)8
+ (6 3)8
(1 4 1)8
SEIYUN UNIVERSITY
College of Applied Science – CS department
Operation in Octal
SEIYUN UNIVERSITY
College of Applied Science – CS department
Operation in Octal
SEIYUN UNIVERSITY
College of Applied Science – CS department
Operation in Octal
SEIYUN UNIVERSITY
College of Applied Science – CS department
Operation in Octal
SEIYUN UNIVERSITY
College of Applied Science – CS department
Operation in Octal
SEIYUN UNIVERSITY
College of Applied Science – CS department
Operation in Octal
SEIYUN UNIVERSITY
College of Applied Science – CS department
F E D C B A 9 8 7 6 5 4 3 2 1 0 +
F E D C B A 9 8 7 6 5 4 3 2 1 0 0
10 F E D C B A 9 8 7 6 5 4 3 2 1 1
11 10 F E D C B A 9 8 7 6 5 4 3 2 2
12 11 10 F E D C B A 9 8 7 6 5 4 3 3
13 12 11 10 F E D C B A 9 8 7 6 5 4 4
14 13 12 11 10 F E D C B A 9 8 7 6 5 5
15 14 13 12 11 10 F E D C B A 9 8 7 6 6
16 15 14 13 12 11 10 F E D C B A 9 8 7 7
17 16 15 14 13 12 11 10 F E D C B A 9 8 8
18 17 16 15 14 13 12 11 10 F E D C B A 9 9
19 18 17 16 15 14 13 12 11 10 F E D C B A A
1A 19 18 17 16 15 14 13 12 11 10 F E D C B B
1B 1A 19 18 17 16 15 14 13 12 11 10 F E D C C
1C 1B 1A 19 18 17 16 15 14 13 12 11 10 F E D D
1D 1C 1B 1A 19 18 17 16 15 14 13 12 11 10 F E E
1E 1D 1C 1B 1A 19 18 17 16 15 14 13 12 11 10 F F
Operation in Hexa
The rules for the Addition of two numbers as following :
(3 5 A B 2)16
(1 A 6 7 5)16
(5 0 1 2 7)16
1 1 1
carry
SEIYUN UNIVERSITY
College of Applied Science – CS department
Operation in Hexa
SEIYUN UNIVERSITY
College of Applied Science – CS department
Operation in Hexa
SEIYUN UNIVERSITY
College of Applied Science – CS department
Operation in Hexa
SEIYUN UNIVERSITY
College of Applied Science – CS department
Operation in Hexa
SEIYUN UNIVERSITY
College of Applied Science – CS department
Operation in Hexa
SEIYUN UNIVERSITY
College of Applied Science – CS department
Operation in Hexa
SEIYUN UNIVERSITY
College of Applied Science – CS department
Operation in Hexa
SEIYUN UNIVERSITY
College of Applied Science – CS department
Operation in Hexa
SEIYUN UNIVERSITY
College of Applied Science – CS department
Operation in Hexa

More Related Content

PDF
Digital Logic
PPTX
Number system in Digital Electronics
PDF
uyuyuy.pdf
PDF
Chapter 1 digital systems and binary numbers
PPTX
UNIT - I.pptx
PPTX
UNIT - I.pptx
PPTX
Digital Electronics: UNIT-I DIGITAL FUNDAMENTALS
PPTX
chapter1digitalsystemsandbinarynumbers-151021072016-lva1-app6891.pptx
Digital Logic
Number system in Digital Electronics
uyuyuy.pdf
Chapter 1 digital systems and binary numbers
UNIT - I.pptx
UNIT - I.pptx
Digital Electronics: UNIT-I DIGITAL FUNDAMENTALS
chapter1digitalsystemsandbinarynumbers-151021072016-lva1-app6891.pptx

Similar to ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS) (20)

PPTX
Switching Theory and Logic Circuits-LEC.pptx
PDF
DLC Unit 1 (1).pdf nothing to say about you
PPT
Number_System and Boolean Algebra in Digital System Design
PDF
Digital and Logic Design Chapter 1 binary_systems
PDF
Module 1 Digital Logic Design .pptx.pdf
PPTX
digital-electronics.pptx
PPT
Number Systems.ppt
PPT
Module 4
PPTX
ADE UNIT-III (Digital Fundamentals).pptx
PPT
Chapter_1_Digital_Systems_and_Binary_Numbers.ppt
PPT
Basic Digital_Systems_and_Binary_Numbers Sample.ppt
PDF
Using only above uploaded document(its formulas and concepts) solve problem 2...
PPTX
Number_system_B.pharm_2nd_BP205T_Unit_1_Ravi.pptx
PPTX
digital-systems-and-binary-numbers1.pptx
PDF
digital-electronics (1)_watermark.pdfhindi
PPT
Module I - Digital Systems & Logic Gates.ppt
PPT
Chapter_1_Digital_Systems_and_Binary_Numbers2.ppt
PPTX
1. NUMBER SYSTEM.pptx Computer Applications in Pharmacy
PDF
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
Switching Theory and Logic Circuits-LEC.pptx
DLC Unit 1 (1).pdf nothing to say about you
Number_System and Boolean Algebra in Digital System Design
Digital and Logic Design Chapter 1 binary_systems
Module 1 Digital Logic Design .pptx.pdf
digital-electronics.pptx
Number Systems.ppt
Module 4
ADE UNIT-III (Digital Fundamentals).pptx
Chapter_1_Digital_Systems_and_Binary_Numbers.ppt
Basic Digital_Systems_and_Binary_Numbers Sample.ppt
Using only above uploaded document(its formulas and concepts) solve problem 2...
Number_system_B.pharm_2nd_BP205T_Unit_1_Ravi.pptx
digital-systems-and-binary-numbers1.pptx
digital-electronics (1)_watermark.pdfhindi
Module I - Digital Systems & Logic Gates.ppt
Chapter_1_Digital_Systems_and_Binary_Numbers2.ppt
1. NUMBER SYSTEM.pptx Computer Applications in Pharmacy
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
Ad

More from Dr. Mazin Mohamed alkathiri (20)

PPTX
Computer Introduction (Operating Systems)-Lecture06
PPTX
Mobile Application Development (local database) class-07
PPTX
Mobile Application Development (Shared Preferences) class-06
PPTX
Mobile Application Development((Handling User Input and Navigation) class-05
PPTX
Computer Introduction (Data Encryption)-Lecture05
PPTX
Computer Introduction (Computer Viruses )-Lecture04
PPTX
Mobile Applications Development class 04-Layout-04
DOCX
Appendix to Lecture 3 Building a flutter app
PPTX
Mobile Applications Development class 03-starting with flutter
PPTX
Mobile Applications Development class 02 ntroduction to Drat
PPTX
Computer Introduction (Software)-Lecture03
PPTX
Computer Introduction (Hardware)-Lecture02
PPTX
Computer Introduction (introduction)-Lecture01
PPTX
Introduction to Academic Writing class 0-1
PPTX
Mobile Applications Development class 01 - Introduction
PPT
OS-operating systems- ch05 (CPU Scheduling) ...
PPTX
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
PPTX
Advance Mobile Application Development class 07
PPTX
ESSENTIAL of (CS/IT/IS) class 06 (database)
PPT
OS-operating systems- ch04 (Threads) ...
Computer Introduction (Operating Systems)-Lecture06
Mobile Application Development (local database) class-07
Mobile Application Development (Shared Preferences) class-06
Mobile Application Development((Handling User Input and Navigation) class-05
Computer Introduction (Data Encryption)-Lecture05
Computer Introduction (Computer Viruses )-Lecture04
Mobile Applications Development class 04-Layout-04
Appendix to Lecture 3 Building a flutter app
Mobile Applications Development class 03-starting with flutter
Mobile Applications Development class 02 ntroduction to Drat
Computer Introduction (Software)-Lecture03
Computer Introduction (Hardware)-Lecture02
Computer Introduction (introduction)-Lecture01
Introduction to Academic Writing class 0-1
Mobile Applications Development class 01 - Introduction
OS-operating systems- ch05 (CPU Scheduling) ...
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
Advance Mobile Application Development class 07
ESSENTIAL of (CS/IT/IS) class 06 (database)
OS-operating systems- ch04 (Threads) ...
Ad

Recently uploaded (20)

PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
01-Introduction-to-Information-Management.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
master seminar digital applications in india
PDF
Insiders guide to clinical Medicine.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Basic Mud Logging Guide for educational purpose
PDF
Classroom Observation Tools for Teachers
PPTX
Cell Structure & Organelles in detailed.
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
human mycosis Human fungal infections are called human mycosis..pptx
Supply Chain Operations Speaking Notes -ICLT Program
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
VCE English Exam - Section C Student Revision Booklet
01-Introduction-to-Information-Management.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
TR - Agricultural Crops Production NC III.pdf
master seminar digital applications in india
Insiders guide to clinical Medicine.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Basic Mud Logging Guide for educational purpose
Classroom Observation Tools for Teachers
Cell Structure & Organelles in detailed.
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Pharma ospi slides which help in ospi learning
Final Presentation General Medicine 03-08-2024.pptx
Microbial diseases, their pathogenesis and prophylaxis
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?

ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)

  • 1. SEIYUN UNIVERSITY College of Applied Science – CS department Instructor: Dr. Mazin Md. Alkathiri Information technology Department Faculty of Applied Sciences Seiyun University – Yemen Jan 2024
  • 2. SEIYUN UNIVERSITY College of Applied Science – CS department 2
  • 3. SEIYUN UNIVERSITY College of Applied Science – CS department 3 A digital logic system may well have a numerical computation capability as well as its inherent logical capability. Human beings normally perform arithmetic operations using the decimal number system, but, a digital machine is inherently binary and its numerical calculations are executed using a binary number system. Since the decimal system has ten digits, a ten-state device is required to represent the decimal digits. Ten-state devices are not readily available in the electrical world, however two-state devices such as a transistor which are operating in a switching mode. A number of other systems such as the hexadecimal system are used in conjunction with programmable logic devices. Introduction
  • 4. SEIYUN UNIVERSITY College of Applied Science – CS department 4 We are all familiar with the decimal number system (Base 10). Some other number systems that we will work with are:  Decimal Base 10  Binary Base 2  Octal Base 8  Hexadecimal Base 16 Introduction
  • 5. SEIYUN UNIVERSITY College of Applied Science – CS department 5 The digits are consecutive. The number of digits is equal to the size of the base. Zero is always the first digit. The base number is never a digit. When 1 is added to the largest digit, a sum of zero and a carry of one results. Characteristics of Numbering Systems
  • 6. SEIYUN UNIVERSITY College of Applied Science – CS department Significant Digits Binary: 11101101 Most significant digit Least significant digit Hexadecimal: 1D63A7A Most significant digit Least significant digit
  • 7. SEIYUN UNIVERSITY College of Applied Science – CS department 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
  • 8. SEIYUN UNIVERSITY College of Applied Science – CS department 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
  • 9. SEIYUN UNIVERSITY College of Applied Science – CS department Binary Addition 4 Possible Binary Addition Combinations: (1) 0 (2) 0 +0 +1 00 01 (3) 1 (4) 1 +0 +1 01 10 Sum Carry
  • 10. SEIYUN UNIVERSITY College of Applied Science – CS department 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
  • 11. SEIYUN UNIVERSITY College of Applied Science – CS department Division Algorithm Convert (67)10 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 1)2
  • 12. SEIYUN UNIVERSITY College of Applied Science – CS department 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
  • 13. SEIYUN UNIVERSITY College of Applied Science – CS department Multiplication Algorithm Convert (10101101)2 to its decimal equivalent: Binary 1 0 1 0 1 1 0 1 Positional Values x x x x x x x x 20 21 22 23 24 25 26 27 128 + 32 + 8 + 4 + 1 Products (173)10
  • 14. SEIYUN UNIVERSITY College of Applied Science – CS department 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
  • 15. SEIYUN UNIVERSITY College of Applied Science – CS department Decimal to Octal Conversion Convert (427)10 to its octal equivalent: 427 / 8 = 53 R3 Divide by 8; R is LSD 53 / 8 = 6 R5 Divide Q by 8; R is next digit 6 / 8 = 0 R6 Repeat until Q = 0 (653)8
  • 16. SEIYUN UNIVERSITY College of Applied Science – CS department Octal to Decimal Conversion Convert (653)8 to its decimal equivalent: 6 5 3 x x x 82 81 80 384 + 40 + 3 (427)10 Positional Values Products Octal Digits
  • 17. SEIYUN UNIVERSITY College of Applied Science – CS department Octal to Binary Conversion Each octal number converts to 3 binary digits To convert (653)8 to binary, just substitute code: 6 5 3 110 101 011
  • 18. SEIYUN UNIVERSITY College of Applied Science – CS department 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
  • 19. SEIYUN UNIVERSITY College of Applied Science – CS department Decimal to Hexadecimal Conversion Convert (830)10 to its hexadecimal equivalent: 830 / 16 = 51 R14 51 / 16 = 3 R3 3 / 16 = 0 R3 (33E)16 = E in Hex
  • 20. SEIYUN UNIVERSITY College of Applied Science – CS department Hexadecimal to Decimal Conversion Convert (3B4F)16 to its decimal equivalent: Hex Digits 3 B 4 F x x x 163 162 161 160 12288 +2816 + 64 +15 (15,183)10 Positional Values Products x
  • 21. SEIYUN UNIVERSITY College of Applied Science – CS department 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
  • 22. SEIYUN UNIVERSITY College of Applied Science – CS department Convert (010101101010111001101010)2 to hex using the 4-bit substitution code : 0101 0110 1010 1110 0110 1010 Substitution Code 5 6 A E 6 A (56AE6A)16
  • 23. SEIYUN UNIVERSITY College of Applied Science – CS department 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 (25527152)8
  • 24. SEIYUN UNIVERSITY College of Applied Science – CS department Complementary Arithmetic • 1’s complement • Switch all 0’s to 1’s and 1’s to 0’s Binary # 10110011 1’s complement 01001100 • The 2's complement representation of a binary number X is defined by the equation: [X]2 = 2n – X For X = 1010 and n = 4 then: [X]2 = 24 - 1010 = 10000 - 1010 = 0110
  • 25. SEIYUN UNIVERSITY College of Applied Science – CS department • 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 + 1 00111010 Complementary Arithmetic
  • 26. SEIYUN UNIVERSITY College of Applied Science – CS department Signed magnitude representation Signed 1's complement representation Signed 2's complement representation Example: Represent (+9) and (-9) in 8 bit-binary number Only one way to represent +9 ==> 0 0001001 Three different ways to represent -9: In signed-magnitude: 1 0001001 In signed-1's complement: 1 1110110 In signed-2's complement: 1 1110111 Need to be able to represent both positive and negative numbers - Following 3 representations Signed Numbers
  • 27. SEIYUN UNIVERSITY College of Applied Science – CS department Complement: Signed magnitude: Complement only the sign bit Signed 1's complement: Complement all the bits including sign bit Signed 2's complement: After the first (1) of the positive number complement the bits including its sign bit. Signed Numbers
  • 28. SEIYUN UNIVERSITY College of Applied Science – CS department Singed Binary Numbers In computers, both positive and negative numbers are represents only with binary digits; The left most bit (sign bit) in the number represents sign of the number; The sign bit is 0 for the positive numbers, and 1 for negative numbers.
  • 29. SEIYUN UNIVERSITY College of Applied Science – CS department Singed Binary Numbers Addition and subtraction of 2's complement numbers: Addition and subtraction in the 2's complement system are both carried out as additions. Example 1: Addition of two 8-bit positive numbers.
  • 30. SEIYUN UNIVERSITY College of Applied Science – CS department Operations on Binary system The rules for the addition of two single-bit numbers as following : A B Sum Carry 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 1 1 1 1 0 1 1 0 1 1 1 1 0 0 1 0 11 + 7 18 Carry Sum
  • 31. SEIYUN UNIVERSITY College of Applied Science – CS department The rules for the subtraction of two single-bit numbers as following : A B Difference Borrow 0 0 0 0 0 1 1 1 1 0 1 0 1 1 0 0 1 1 1 1 0 0 0 0 1 1 1 0 0 1 12 - 3 9 Operations on Binary system Borrow Deff.
  • 32. SEIYUN UNIVERSITY College of Applied Science – CS department The rules for the Multiplication of two single-bit numbers as following : Operations on Binary system A B Product 0 0 0 0 1 0 1 0 0 1 1 1 1110 x 1011 1110 1110 0000 1110 10011010
  • 33. SEIYUN UNIVERSITY College of Applied Science – CS department Conversion of decimal numbers to any Radix number Conversion of decimal to any radix number accomplished in two steps: Step 1: Convert the Integer part – by successive division method; Step 2: Convert the Fraction part - by successive multiplication method.
  • 34. SEIYUN UNIVERSITY College of Applied Science – CS department Conversion of decimal numbers to any Radix number 1. successive division for integer part:
  • 35. SEIYUN UNIVERSITY College of Applied Science – CS department Conversion of decimal numbers to any Radix number
  • 36. SEIYUN UNIVERSITY College of Applied Science – CS department 2. successive multiplication for Fraction part: Conversion of decimal numbers to any Radix number
  • 37. SEIYUN UNIVERSITY College of Applied Science – CS department Conversion of decimal numbers to any Radix number
  • 38. SEIYUN UNIVERSITY College of Applied Science – CS department Fractions
  • 39. SEIYUN UNIVERSITY College of Applied Science – CS department 3.14579 .14579 x 2 0.29158 x 2 0.58316 x 2 1.16632 x 2 0.33264 x 2 0.66528 x 2 1.33056 etc. 11.001001...  Convert Decimal to Binary  (3.14579)10 = (?)2 Fractions
  • 40. SEIYUN UNIVERSITY College of Applied Science – CS department Operation in Octal The rules for the Addition of two numbers as following : (3 4)8 + (4 2)8 (7 6)8 (5 6)8 + (6 3)8 (1 4 1)8
  • 41. SEIYUN UNIVERSITY College of Applied Science – CS department Operation in Octal
  • 42. SEIYUN UNIVERSITY College of Applied Science – CS department Operation in Octal
  • 43. SEIYUN UNIVERSITY College of Applied Science – CS department Operation in Octal
  • 44. SEIYUN UNIVERSITY College of Applied Science – CS department Operation in Octal
  • 45. SEIYUN UNIVERSITY College of Applied Science – CS department Operation in Octal
  • 46. SEIYUN UNIVERSITY College of Applied Science – CS department Operation in Octal
  • 47. SEIYUN UNIVERSITY College of Applied Science – CS department F E D C B A 9 8 7 6 5 4 3 2 1 0 + F E D C B A 9 8 7 6 5 4 3 2 1 0 0 10 F E D C B A 9 8 7 6 5 4 3 2 1 1 11 10 F E D C B A 9 8 7 6 5 4 3 2 2 12 11 10 F E D C B A 9 8 7 6 5 4 3 3 13 12 11 10 F E D C B A 9 8 7 6 5 4 4 14 13 12 11 10 F E D C B A 9 8 7 6 5 5 15 14 13 12 11 10 F E D C B A 9 8 7 6 6 16 15 14 13 12 11 10 F E D C B A 9 8 7 7 17 16 15 14 13 12 11 10 F E D C B A 9 8 8 18 17 16 15 14 13 12 11 10 F E D C B A 9 9 19 18 17 16 15 14 13 12 11 10 F E D C B A A 1A 19 18 17 16 15 14 13 12 11 10 F E D C B B 1B 1A 19 18 17 16 15 14 13 12 11 10 F E D C C 1C 1B 1A 19 18 17 16 15 14 13 12 11 10 F E D D 1D 1C 1B 1A 19 18 17 16 15 14 13 12 11 10 F E E 1E 1D 1C 1B 1A 19 18 17 16 15 14 13 12 11 10 F F Operation in Hexa The rules for the Addition of two numbers as following : (3 5 A B 2)16 (1 A 6 7 5)16 (5 0 1 2 7)16 1 1 1 carry
  • 48. SEIYUN UNIVERSITY College of Applied Science – CS department Operation in Hexa
  • 49. SEIYUN UNIVERSITY College of Applied Science – CS department Operation in Hexa
  • 50. SEIYUN UNIVERSITY College of Applied Science – CS department Operation in Hexa
  • 51. SEIYUN UNIVERSITY College of Applied Science – CS department Operation in Hexa
  • 52. SEIYUN UNIVERSITY College of Applied Science – CS department Operation in Hexa
  • 53. SEIYUN UNIVERSITY College of Applied Science – CS department Operation in Hexa
  • 54. SEIYUN UNIVERSITY College of Applied Science – CS department Operation in Hexa
  • 55. SEIYUN UNIVERSITY College of Applied Science – CS department Operation in Hexa
  • 56. SEIYUN UNIVERSITY College of Applied Science – CS department Operation in Hexa