SlideShare a Scribd company logo
1 of 56
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

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

Number Systems and Binary Aritmetics
Number Systems and Binary AritmeticsNumber Systems and Binary Aritmetics
Number Systems and Binary AritmeticsDelowar Hossain
 
basic electronics MODULE_1_Ch4_AH_01082014.pptx
basic electronics MODULE_1_Ch4_AH_01082014.pptxbasic electronics MODULE_1_Ch4_AH_01082014.pptx
basic electronics MODULE_1_Ch4_AH_01082014.pptxhappycocoman
 
Lecture 1 PPT Number systems & conversions part.pptx
Lecture 1 PPT Number systems & conversions part.pptxLecture 1 PPT Number systems & conversions part.pptx
Lecture 1 PPT Number systems & conversions part.pptxcronydeva
 
Chapter 1 number and code system sss
Chapter 1 number and code system sssChapter 1 number and code system sss
Chapter 1 number and code system sssBaia Salihin
 
Logic Circuits Design - "Chapter 1: Digital Systems and Information"
Logic Circuits Design - "Chapter 1: Digital Systems and Information"Logic Circuits Design - "Chapter 1: Digital Systems and Information"
Logic Circuits Design - "Chapter 1: Digital Systems and Information"Ra'Fat Al-Msie'deen
 
Dee 2034 chapter 1 number and code system (Baia)
Dee 2034 chapter 1 number and code system (Baia)Dee 2034 chapter 1 number and code system (Baia)
Dee 2034 chapter 1 number and code system (Baia)SITI SABARIAH SALIHIN
 
Ee 202 chapter 1 number and code system
Ee 202 chapter 1 number and code system Ee 202 chapter 1 number and code system
Ee 202 chapter 1 number and code system CT Sabariah Salihin
 
Number system and their conversion
Number system and their conversionNumber system and their conversion
Number system and their conversionRam Pratap Singh
 
Number system
Number systemNumber system
Number systemAmit Shaw
 
1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptx1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptxLibanMohamed26
 

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

Digital Electronics Notes.pdf
Digital Electronics Notes.pdfDigital Electronics Notes.pdf
Digital Electronics Notes.pdf
 
Number Systems and Binary Aritmetics
Number Systems and Binary AritmeticsNumber Systems and Binary Aritmetics
Number Systems and Binary Aritmetics
 
Quantitative Analysis 2
Quantitative Analysis 2Quantitative Analysis 2
Quantitative Analysis 2
 
Binary no
Binary noBinary no
Binary no
 
basic electronics MODULE_1_Ch4_AH_01082014.pptx
basic electronics MODULE_1_Ch4_AH_01082014.pptxbasic electronics MODULE_1_Ch4_AH_01082014.pptx
basic electronics MODULE_1_Ch4_AH_01082014.pptx
 
Digital Logic
Digital LogicDigital Logic
Digital Logic
 
Lecture 1 PPT Number systems & conversions part.pptx
Lecture 1 PPT Number systems & conversions part.pptxLecture 1 PPT Number systems & conversions part.pptx
Lecture 1 PPT Number systems & conversions part.pptx
 
Chapter 1 number and code system sss
Chapter 1 number and code system sssChapter 1 number and code system sss
Chapter 1 number and code system sss
 
Logic Design
Logic DesignLogic Design
Logic Design
 
Numbersystemsppt 181023140730
Numbersystemsppt 181023140730Numbersystemsppt 181023140730
Numbersystemsppt 181023140730
 
Number systems ppt
Number systems pptNumber systems ppt
Number systems ppt
 
Logic Circuits Design - "Chapter 1: Digital Systems and Information"
Logic Circuits Design - "Chapter 1: Digital Systems and Information"Logic Circuits Design - "Chapter 1: Digital Systems and Information"
Logic Circuits Design - "Chapter 1: Digital Systems and Information"
 
Dee 2034 chapter 1 number and code system (Baia)
Dee 2034 chapter 1 number and code system (Baia)Dee 2034 chapter 1 number and code system (Baia)
Dee 2034 chapter 1 number and code system (Baia)
 
Basics of Digital Electronics
Basics of Digital ElectronicsBasics of Digital Electronics
Basics of Digital Electronics
 
Ee 202 chapter 1 number and code system
Ee 202 chapter 1 number and code system Ee 202 chapter 1 number and code system
Ee 202 chapter 1 number and code system
 
Number system and their conversion
Number system and their conversionNumber system and their conversion
Number system and their conversion
 
Number system
Number systemNumber system
Number system
 
Module 4
Module 4Module 4
Module 4
 
Number Systems Basic Concepts
Number Systems Basic ConceptsNumber Systems Basic Concepts
Number Systems Basic Concepts
 
1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptx1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptx
 

More from Dr. Mazin Mohamed alkathiri

ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)
ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)
ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)Dr. Mazin Mohamed alkathiri
 
Advance Mobile Application Development class 02-B
Advance Mobile Application Development class 02-BAdvance Mobile Application Development class 02-B
Advance Mobile Application Development class 02-BDr. Mazin Mohamed alkathiri
 
Academic Writing (Technical report writing ) class 07
Academic Writing (Technical report writing ) class 07Academic Writing (Technical report writing ) class 07
Academic Writing (Technical report writing ) class 07Dr. Mazin Mohamed alkathiri
 

More from Dr. Mazin Mohamed alkathiri (20)

ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Advance Mobile Application Development class 05
Advance Mobile Application Development class 05Advance Mobile Application Development class 05
Advance Mobile Application Development class 05
 
ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)
ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)
ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)
 
OS-operating systems- ch03
OS-operating systems- ch03OS-operating systems- ch03
OS-operating systems- ch03
 
OS-operating systems - ch02 - part-2-2024
OS-operating systems - ch02 - part-2-2024OS-operating systems - ch02 - part-2-2024
OS-operating systems - ch02 - part-2-2024
 
Advance Mobile Application Development class 04
Advance Mobile Application Development class 04Advance Mobile Application Development class 04
Advance Mobile Application Development class 04
 
Advance Mobile Application Development class 03
Advance Mobile Application Development class 03Advance Mobile Application Development class 03
Advance Mobile Application Development class 03
 
Advance Mobile Application Development class 02-B
Advance Mobile Application Development class 02-BAdvance Mobile Application Development class 02-B
Advance Mobile Application Development class 02-B
 
OS-ch02-part-1-2024.ppt
OS-ch02-part-1-2024.pptOS-ch02-part-1-2024.ppt
OS-ch02-part-1-2024.ppt
 
Advance Mobile Application Development class 02
Advance Mobile Application Development class 02Advance Mobile Application Development class 02
Advance Mobile Application Development class 02
 
Advance Mobile Application Development class 01
Advance Mobile Application Development class 01Advance Mobile Application Development class 01
Advance Mobile Application Development class 01
 
ESSENTIAL of (CS/IT/IS) class 02 (HCI)
ESSENTIAL of (CS/IT/IS) class 02 (HCI)ESSENTIAL of (CS/IT/IS) class 02 (HCI)
ESSENTIAL of (CS/IT/IS) class 02 (HCI)
 
Seminar
SeminarSeminar
Seminar
 
ESSENTIAL of (CS/IT/IS)
ESSENTIAL of (CS/IT/IS)ESSENTIAL of (CS/IT/IS)
ESSENTIAL of (CS/IT/IS)
 
OS-ch01-2024.ppt
OS-ch01-2024.pptOS-ch01-2024.ppt
OS-ch01-2024.ppt
 
Mobile Application Development class 008
Mobile Application Development class 008Mobile Application Development class 008
Mobile Application Development class 008
 
Academic Writing (Punctuation ) class 06
Academic Writing (Punctuation ) class 06Academic Writing (Punctuation ) class 06
Academic Writing (Punctuation ) class 06
 
Academic Writing (Technical report writing ) class 07
Academic Writing (Technical report writing ) class 07Academic Writing (Technical report writing ) class 07
Academic Writing (Technical report writing ) class 07
 
Computer Introduction-Lecture07
Computer Introduction-Lecture07Computer Introduction-Lecture07
Computer Introduction-Lecture07
 

Recently uploaded

Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxnelietumpap1
 

Recently uploaded (20)

Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
 

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