SlideShare a Scribd company logo
1 of 19
BINARY NUMBER SYSTEM
CYS102
NAME : ARVIND SHUKLA
ROLL NUMBER : 31184422012
REGISTRATION NUMBER : 223112410007
GURU NANAK INSTITUTE OF TECHNOLOGY
STREAM : B.Sc. CYBER SECURITY
1st SEMESTER (1st YEAR)
Binary Numbers
Binary
Octal
Hexadecimal
Binary Numbers
• COUNTING SYSTEMS UNLIMITED . . . Since you have been using the
10 different digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 all your life, you may
wonder how it is possible to count and do arithmetic without using all 10.
Actually, there is no advantage in using 10 counting digits rather than, say,
8, 12, or 16. The 10-digit system (called the decimal system, since the word
"decimal" means "based on 10") probably came into universal use because
man first started to count by using his fingers, and there happen to be 10 of
them.
• Tosee how to count by using other than 10 digits, notice how we count in
the ordinary decimal system. Werepresent a number higher than 9, the
highest digit, by a combination of two or more digits. The number next
after 9 is 10, and then 11, etc. After we reach 99, the highest number that
can be written with two digits, we start using three digits. The number next
after 99 is 100, and then comes 101, etc.
• Now let's try counting in the octal system. "Octal" means "based on eight";
that is, we use only the eight digits 0, 1, 2, 3, 4, 5, 6, and 7. The digits 8 and
9 are not used. So now what do we do after we have counted to 7? Since
we have used up all the symbols we are permitted to use, we write 10 as the
next number and then comes 11 and so on up to 17. After 17 comes 20.
Decimal
0
Octal
0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 10
9 11
10 12
11 13
12 14
13 15
14 16
15 17
16 20
17 21
18 22
19 23
Binary Numbers
• THE NATURALBINARY SYSTEM ... Now that you have seen how it
is possible to count in numbering systems other than the
decimal system, we shall consider the system of most interest in
electronics. That is the binary system, which uses only the two
digits 0 and 1.
• We can count in the binary system by using the plan explained in
the preceding topic for counting in other systems. The first
number in counting is 1, of course. Since we can use no digit
higher than 1, we must go to two digits and write 10 for the
second binary number.Then comes 11, and after that we must
go to three digits and write 100.
• Binary numbers as written in the table form the natural binary
numbering system. It is called natural because it follows the
general counting method used in the decimal, octal, and other
numbering systems. As you will see later in the lesson, the
natural binary system is only one of a number of methods for
representing numbers by using only the digits 0 and 1.
Decimal
0
Octal Binary
0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 10 1000
9 11 1001
10 12 1010
11 13 1011
12 14 1100
13 15 1101
14 16 1110
15 17 1111
16 20 10000
17 21 10001
18 22 10010
19 23 10011
Binary Numbers
CONVERSION BETWEEN OCTAL AND BINARY SYSTEMS ... As you have no
doubt observed by this time, writing out and reading numbers in natural binary form is
quite a nuisance because of the large number of digits involved. Since it is easy to
convert natural binary numbers into octal numbers, it is practical to write or machine
print out natural binary numbers as octal numbers for ease in handling. A couple of
examples will show you how the conversions are made.
• EXAMPLE ... Convert binary number 1011010 to the octal equivalent.
• SOLUTION . . . The first step is to rewrite the number with the digits
grouped in threes:
001 011 010
• Note that two zeros were placed in front of the first digit 1 in order to make
every group complete.
• Next, write the decimal equivalent over each group of three:
1 3 2
001 011 010
• The octal equivalent of binary 1011010 is 132.
This means 0000 is 0, 0001 is 1 0010 is 2 and so on to 100
Binary Numbers
• The hexadecimal system, or Hex, uses base 16, therefore
there are 16 possible digit symbols. The hexadecimal
system groups binary number by 4’sand from 0 to 9 it is
the same as a decimal number
,
equivalent in binary form.
1
being 9, but then from 1010 to 1111 of binary the
hexadecimal uses letters from A to F and then when it
reaches the value of 16 it becomes 10 because the two
groups of four binary numbers are 0001 0000. When taken
as a binary number it is 0001 0000 while the decimal
number is 16 and the hexadecimal number is 10. Therefore
an 8 bit binary number (byte) is divided into two groups of
four bits each. The chart in the next slide shows all of this.
Decimal
0
Octal Binary Hex
0 0000 0
1 1 0001 1
2 2 0010 2
3 3 0011 3
4 4 0100 4
5 5 0101 5
6 6 0110 6
7 7 0111 7
8 10 1000 8
9 11 1001 9
10 12 1010 A
11 13 1011 B
12 14 1100 C
13 15 1101 D
14 16 1110 E
15 17 1111 F
16 20 0001 0000 10
17 21 0001 0001 11
18 22 0001 0010 12
19 23 0001 0011 13
Binary Numbers
CONVERSION BETWEEN HEXADECIMAL AND BINARY SYSTEMS ... As you
have no doubt observed by this time, writing out and reading numbers in natural binary
form is quite a nuisance because of the large number of digits involved. Since it is easy
to convert natural binary numbers into hexadecimal numbers, it is practical to write or
machine print out natural binary numbers as hexadecimal numbers for ease in handling.
A couple of examples will show you how the conversions are made.
• EXAMPLE ... Convert binary number 1011010 to the hexadecimal equivalent.
• SOLUTION . . . The first step is to rewrite the number with the digits grouped in
fours:
0101 1010
• Note the zero were placed in front of the first digit 1 in order to make the two
groups complete.
• Next, write the decimal equivalent over each group:
5 A
0101 1010
• The hexadecimal equivalent of binary 1011010 is 5A.
Binary Addition
• Conceptually similar to decimal addition
• Example: Add the binary numbers 1010 and 11
(carry)
1
1 0 1 0
+ 1 1
1 1 0 1
0 1
Binary Subtraction
Example:
Subtract binary number 101 from 1011
(borrow)
1 0 1 1
- 1 0 1
0 1 1 0
2s Complement Notation
• 2s complement representation - widely
used in microprocessors.
• Represents sign and magnitude
MSB
Sign bit
LSB
(0 = + ; 1 = -)
Decimal:
2s Complement:
+7 +4 +1 0 -1
0111 0100 0001 0000 1111
-4 -7
1100 1001
Add 1
2s Complement - Conversions
• Converting positive numbers to 2s complement:
• Same as converting to binary
• Converting negative numbers to 2s complement:
Decimal to 2s
Complement
- 4 (decimal)
Convert decimal
0 1 0 0 to binary
1s
2s Complement to
Binary
1 1 0 0 (2s C)
1s
0 0 1 1
complement
1 0 1 1 complement
Add 1
- 4 = 1 1 0 0 (2s Complement) 0 1 0 0 (Binary)
Adding/Subtracting in 2s Complement
2s complement notation makes it possible to
add and subtract signed numbers
(Decimal) 2s Complement
(- 1) 1 1 1 1
+ (- 2) + 1 1 1 0
(- 3) 1 1 1 0 1 2s complement
Discard
(+1) 0 0 0 1
+ (- 3) + 1 1 0 1
(- 2) 1 1 1 0 2s complement
Practical Suggestion for Binary Math
• Use a scientific calculator.
• Most scientific calculators have
DEC, BIN, OCT, and HEX modes
and can either convert between codes
or perform arithmetic in different
number systems.
• Most scientific calculators also
have other functions that are
valuable in digital electronics
such as AND, OR, NOT, XOR,
and XNOR logic functions.
binary-numbers-system.doc.docx
binary-numbers-system.doc.docx

More Related Content

Similar to binary-numbers-system.doc.docx

Number system in Digital Electronics
Number system in Digital ElectronicsNumber system in Digital Electronics
Number system in Digital ElectronicsJanki Shah
 
DATA REPRESENTATION.pptx
DATA REPRESENTATION.pptxDATA REPRESENTATION.pptx
DATA REPRESENTATION.pptxMamataAnilgod
 
Number-Systems presentation of the mathematics
Number-Systems presentation of the mathematicsNumber-Systems presentation of the mathematics
Number-Systems presentation of the mathematicsshivas379526
 
Number System and Conversions.pptx
Number System and Conversions.pptxNumber System and Conversions.pptx
Number System and Conversions.pptxkhalidkk6
 
Week 4-Number Systems.pptx
Week 4-Number Systems.pptxWeek 4-Number Systems.pptx
Week 4-Number Systems.pptxHamnaKhalid25
 
Digital Principles-Number systems
Digital Principles-Number systemsDigital Principles-Number systems
Digital Principles-Number systemschandkec
 
Number system utm notes
Number system utm notesNumber system utm notes
Number system utm notesKurenai Ryu
 
Binary, Decimal and Hexadecimal
Binary, Decimal and HexadecimalBinary, Decimal and Hexadecimal
Binary, Decimal and HexadecimalUthraSowrirajan1
 
Number system
Number systemNumber system
Number systemSajib
 
02 number systems
02 number systems02 number systems
02 number systemsjohn01383
 

Similar to binary-numbers-system.doc.docx (20)

Ch 4
Ch 4Ch 4
Ch 4
 
uyuyuy.pdf
uyuyuy.pdfuyuyuy.pdf
uyuyuy.pdf
 
Number system in Digital Electronics
Number system in Digital ElectronicsNumber system in Digital Electronics
Number system in Digital Electronics
 
Representation Of Numbers and Characters
Representation Of Numbers and CharactersRepresentation Of Numbers and Characters
Representation Of Numbers and Characters
 
DATA REPRESENTATION.pptx
DATA REPRESENTATION.pptxDATA REPRESENTATION.pptx
DATA REPRESENTATION.pptx
 
Data representation in computers
Data representation in computersData representation in computers
Data representation in computers
 
number system
number systemnumber system
number system
 
Number-Systems presentation of the mathematics
Number-Systems presentation of the mathematicsNumber-Systems presentation of the mathematics
Number-Systems presentation of the mathematics
 
Arithmetic.ppt
Arithmetic.pptArithmetic.ppt
Arithmetic.ppt
 
Number System and Conversions.pptx
Number System and Conversions.pptxNumber System and Conversions.pptx
Number System and Conversions.pptx
 
Week 4-Number Systems.pptx
Week 4-Number Systems.pptxWeek 4-Number Systems.pptx
Week 4-Number Systems.pptx
 
Digital Principles-Number systems
Digital Principles-Number systemsDigital Principles-Number systems
Digital Principles-Number systems
 
Number system utm notes
Number system utm notesNumber system utm notes
Number system utm notes
 
Binary, Decimal and Hexadecimal
Binary, Decimal and HexadecimalBinary, Decimal and Hexadecimal
Binary, Decimal and Hexadecimal
 
Number system
Number systemNumber system
Number system
 
02 number systems
02 number systems02 number systems
02 number systems
 
Number system
Number systemNumber system
Number system
 
Number system
Number systemNumber system
Number system
 
Number_Systems (2).ppt
Number_Systems (2).pptNumber_Systems (2).ppt
Number_Systems (2).ppt
 
Alu1
Alu1Alu1
Alu1
 

Recently uploaded

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
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
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
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
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 

Recently uploaded (20)

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
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)
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
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
 
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🔝
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
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 🔝✔️✔️
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 

binary-numbers-system.doc.docx

  • 1. BINARY NUMBER SYSTEM CYS102 NAME : ARVIND SHUKLA ROLL NUMBER : 31184422012 REGISTRATION NUMBER : 223112410007 GURU NANAK INSTITUTE OF TECHNOLOGY STREAM : B.Sc. CYBER SECURITY 1st SEMESTER (1st YEAR)
  • 3. Binary Numbers • COUNTING SYSTEMS UNLIMITED . . . Since you have been using the 10 different digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 all your life, you may wonder how it is possible to count and do arithmetic without using all 10. Actually, there is no advantage in using 10 counting digits rather than, say, 8, 12, or 16. The 10-digit system (called the decimal system, since the word "decimal" means "based on 10") probably came into universal use because man first started to count by using his fingers, and there happen to be 10 of them. • Tosee how to count by using other than 10 digits, notice how we count in the ordinary decimal system. Werepresent a number higher than 9, the highest digit, by a combination of two or more digits. The number next after 9 is 10, and then 11, etc. After we reach 99, the highest number that can be written with two digits, we start using three digits. The number next after 99 is 100, and then comes 101, etc. • Now let's try counting in the octal system. "Octal" means "based on eight"; that is, we use only the eight digits 0, 1, 2, 3, 4, 5, 6, and 7. The digits 8 and 9 are not used. So now what do we do after we have counted to 7? Since
  • 4. we have used up all the symbols we are permitted to use, we write 10 as the next number and then comes 11 and so on up to 17. After 17 comes 20.
  • 5. Decimal 0 Octal 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 20 17 21 18 22 19 23
  • 6. Binary Numbers • THE NATURALBINARY SYSTEM ... Now that you have seen how it is possible to count in numbering systems other than the decimal system, we shall consider the system of most interest in electronics. That is the binary system, which uses only the two digits 0 and 1. • We can count in the binary system by using the plan explained in the preceding topic for counting in other systems. The first number in counting is 1, of course. Since we can use no digit higher than 1, we must go to two digits and write 10 for the second binary number.Then comes 11, and after that we must go to three digits and write 100. • Binary numbers as written in the table form the natural binary numbering system. It is called natural because it follows the general counting method used in the decimal, octal, and other numbering systems. As you will see later in the lesson, the natural binary system is only one of a number of methods for representing numbers by using only the digits 0 and 1.
  • 7. Decimal 0 Octal Binary 0 0000 1 1 0001 2 2 0010 3 3 0011 4 4 0100 5 5 0101 6 6 0110 7 7 0111 8 10 1000 9 11 1001 10 12 1010 11 13 1011 12 14 1100 13 15 1101 14 16 1110 15 17 1111 16 20 10000 17 21 10001 18 22 10010 19 23 10011
  • 8. Binary Numbers CONVERSION BETWEEN OCTAL AND BINARY SYSTEMS ... As you have no doubt observed by this time, writing out and reading numbers in natural binary form is quite a nuisance because of the large number of digits involved. Since it is easy to convert natural binary numbers into octal numbers, it is practical to write or machine print out natural binary numbers as octal numbers for ease in handling. A couple of examples will show you how the conversions are made. • EXAMPLE ... Convert binary number 1011010 to the octal equivalent. • SOLUTION . . . The first step is to rewrite the number with the digits grouped in threes: 001 011 010 • Note that two zeros were placed in front of the first digit 1 in order to make every group complete. • Next, write the decimal equivalent over each group of three: 1 3 2 001 011 010 • The octal equivalent of binary 1011010 is 132.
  • 9. This means 0000 is 0, 0001 is 1 0010 is 2 and so on to 100 Binary Numbers • The hexadecimal system, or Hex, uses base 16, therefore there are 16 possible digit symbols. The hexadecimal system groups binary number by 4’sand from 0 to 9 it is the same as a decimal number , equivalent in binary form. 1 being 9, but then from 1010 to 1111 of binary the hexadecimal uses letters from A to F and then when it reaches the value of 16 it becomes 10 because the two groups of four binary numbers are 0001 0000. When taken as a binary number it is 0001 0000 while the decimal number is 16 and the hexadecimal number is 10. Therefore an 8 bit binary number (byte) is divided into two groups of four bits each. The chart in the next slide shows all of this.
  • 10. Decimal 0 Octal Binary Hex 0 0000 0 1 1 0001 1 2 2 0010 2 3 3 0011 3 4 4 0100 4 5 5 0101 5 6 6 0110 6 7 7 0111 7 8 10 1000 8 9 11 1001 9 10 12 1010 A 11 13 1011 B 12 14 1100 C 13 15 1101 D 14 16 1110 E 15 17 1111 F 16 20 0001 0000 10 17 21 0001 0001 11 18 22 0001 0010 12 19 23 0001 0011 13
  • 11. Binary Numbers CONVERSION BETWEEN HEXADECIMAL AND BINARY SYSTEMS ... As you have no doubt observed by this time, writing out and reading numbers in natural binary form is quite a nuisance because of the large number of digits involved. Since it is easy to convert natural binary numbers into hexadecimal numbers, it is practical to write or machine print out natural binary numbers as hexadecimal numbers for ease in handling. A couple of examples will show you how the conversions are made. • EXAMPLE ... Convert binary number 1011010 to the hexadecimal equivalent. • SOLUTION . . . The first step is to rewrite the number with the digits grouped in fours: 0101 1010 • Note the zero were placed in front of the first digit 1 in order to make the two groups complete. • Next, write the decimal equivalent over each group: 5 A 0101 1010 • The hexadecimal equivalent of binary 1011010 is 5A.
  • 12. Binary Addition • Conceptually similar to decimal addition • Example: Add the binary numbers 1010 and 11 (carry) 1 1 0 1 0 + 1 1 1 1 0 1
  • 13. 0 1 Binary Subtraction Example: Subtract binary number 101 from 1011 (borrow) 1 0 1 1 - 1 0 1 0 1 1 0
  • 14. 2s Complement Notation • 2s complement representation - widely used in microprocessors. • Represents sign and magnitude MSB Sign bit LSB (0 = + ; 1 = -) Decimal: 2s Complement: +7 +4 +1 0 -1 0111 0100 0001 0000 1111 -4 -7 1100 1001
  • 15. Add 1 2s Complement - Conversions • Converting positive numbers to 2s complement: • Same as converting to binary • Converting negative numbers to 2s complement: Decimal to 2s Complement - 4 (decimal) Convert decimal 0 1 0 0 to binary 1s 2s Complement to Binary 1 1 0 0 (2s C) 1s 0 0 1 1 complement 1 0 1 1 complement Add 1 - 4 = 1 1 0 0 (2s Complement) 0 1 0 0 (Binary)
  • 16. Adding/Subtracting in 2s Complement 2s complement notation makes it possible to add and subtract signed numbers (Decimal) 2s Complement (- 1) 1 1 1 1 + (- 2) + 1 1 1 0 (- 3) 1 1 1 0 1 2s complement Discard (+1) 0 0 0 1 + (- 3) + 1 1 0 1 (- 2) 1 1 1 0 2s complement
  • 17. Practical Suggestion for Binary Math • Use a scientific calculator. • Most scientific calculators have DEC, BIN, OCT, and HEX modes and can either convert between codes or perform arithmetic in different number systems. • Most scientific calculators also have other functions that are valuable in digital electronics such as AND, OR, NOT, XOR, and XNOR logic functions.