SlideShare a Scribd company logo
Binary Arithmetic
BinaryArithmetic
• Binary arithmetic is essential part of all the digital
computers and many other digital system.
• Binary arithmetic is used in digital systems mainly
because the numbers (decimal and floating-point
numbers) are stored in binary format in most
computer systems.
• All arithmetic operations such as addition,
subtraction, multiplication, and division are done
in binary representation of numbers.
Binary Addition
 The steps used for a computer to complete
addition are usually greater than a human, but
their processing speed is far superior.
RULES
 0 + 0 = 0
 0 + 1 = 1
 1 + 0 = 1
 1 + 1 = 0 (With 1 to carry)
 1 + 1 + 1 = 1 (With 1 to carry)
Binary Addition
EXAMPLE
1 0 0 1
1 0 1 1
+
Binary Addition
EXAMPLE
1 0 01 1
1 0 1 1
0
+
Binary Addition
EXAMPLE
1 01 01 1
1 0 1 1
0 0
+
Binary Addition
EXAMPLE
1 01 01 1
1 0 1 1
1 0 0
+
Binary Addition
EXAMPLE
11 01 01 1
1 0 1 1
0 1 0 0
+
Binary Addition
EXAMPLE
11 01 01 1
1 0 1 1
1 0 1 0 0
+
Binary Addition
CHECK THE ANSWER
9
11
20
+
Activity 1
Perform the following additions in binary.
 10110 + 4010 =
 32010 + 1810 =
 7610 + 27110 =
Binary Subtraction
Binary Subtraction
 Computers have trouble performing
subtractions so the following rule should be
employed:
“X – X is the same as
X + -X”
 This is where two’s complement is used.
Binary Subtraction
RULES
2. Convert the number to binary.
3. Perform two’s complement on the second
number.
4. Add both numbers together.
Binary Subtraction
EXAMPLE 1
Convert 12 - 8 using two’s complement.
3. Convert to binary
12 = 000011002

8 = 000010002
Perform one’s complement on the 810
000010002
111101112
Binary Subtraction
EXAMPLE 1
2. Perform two’s complement.
1 1 1 1 0 1 1 12
0 0 0 0 0 0 0 12
1 1 1 1 1 0 0 02
6. Add the two numbers together.
= 1 0 0 0 0 0 1 0 02 (Ignore insignificant bits)
+
Binary Subtraction
EXAMPLE 2
What happens if the first number is larger than
the second?
Try 610 - 1010
Binary Subtraction
EXAMPLE 2
2. Convert to binary
6 = 000001102

10 = 000010102
Perform one’s complement on the 1010
000010102
111101012
Binary Subtraction
EXAMPLE 2
2. Perform two’s complement.
1 1 1 1 0 1 0 12
2
= 1 1 1 1 0 1 1 02
0 0 0 0 0 0 0 1+
Binary Subtraction
EXAMPLE 2
2. Add the two numbers together.
0 0 0 0 0 1 1 02
1 1 1 1 0 1 1 02
1
= 1 1 1 1 1 0 02 (Ends with a negative bit)
+
Binary Subtraction
EXAMPLE 2
2. Perform one’s complement on the result
1 1 1 1 1 1 0 02
0 0 0 0 0 0 1 12
5. Add 1 to the result.
0 0 0 0 0 0 1 12
0 0 0 0 0 0 0 12
= 0 0 0 0 0 1 0 02
+
Binary Subtraction
EXAMPLE 2
2. We then add the sign bit back.
0 0 0 0 0 1 0 02
= 1 0 0 0 0 1 0 02
Activity
2
Perform the following subtractions.
3. 22 - 8 =
4. 76 - 11 =
5. 6 - 44 =
Binary Multiplication
 Multiplication follows the general principal of
shift and add.
 The rules include:




0 * 0 = 0
0 * 1 = 0
1 * 0 = 0
1 * 1 = 1
Binary Multiplication
EXAMPLE 1
Complete 15 * 5 in binary.
3. Convert to binary
15 = 000011112
5 = 000001012
6. Ignore any insignificant zeros.
000011112
000001012
x
Binary Multiplication
EXAMPLE 1
2. Multiply the first number.
1 1 1 12
1 0 1 2
1 1 1 1
7. Now this is where the shift and takes place.
x
1111 x 1 = 1111
Binary Multiplication
EXAMPLE 1
2. Shift one place to the left and multiple the
second digit.
1 1 1 12
1 0 1 2
1 1 1 1
0 0 0 0 0
x
1111 x 0 = 0000
Shift One Place
Binary Multiplication
EXAMPLE 1
2. Shift one place to the left and multiple the
third digit.
1 1 1 12
1 0 1 2
1 1 1 1
0 0 0 0 0
1 1 1 1 0 0
x
1111 x 1 = 1111
Shift One Place
Binary Multiplication
EXAMPLE 1
2. Add the total of all the steps.
1 1 1 1
0 0 0 0 0
1 1 1 1 0 0
1 0 0 1 0 1 1
8. Convert back to decimal to check.
+
Activity
3
Calculate the following using binary
multiplication shift and add.




12 * 3 = 1 0 0 1 0 02
13 * 5 = 1 0 0 0 0 0 12
97 * 20 = 1 1 1 1 0 0 1 0 1 0 02
121 * 67 = 1 1 1 1 1 1 0 1 0 1 0 1 12
Binary Division
 Division in binary is similar to long division in
decimal.
 It uses what is called a shift and subtract
method.
Binary Division
EXAMPLE 1
Complete 575 / 25 using long division.
2.
0
25 575
Take the first digit of 575 (5) and see if 25
will go into it.
If it can not put a zero above and take the
next number.
02  How many times does 25 go into 57?
2. 25 575
TWICE
Binary Division
02  How much is left over?
2. 25 575  57 – (25 * 2) = 7
50
7
02
 Drop down the next value
2. 25 575
50
75
Binary Division
023  Divide 75 by 25
2. 25 575  Result = 3
50
75
023
 Check for remainder
 75 – (3 * 25) = 0
 FINISH!
2. 25 575
50
75
75
0
Binary Division
 Complete the following:
 25/5
Step 1: Convert both numbers to binary.
25 = 1 1 0 0 1
5 = 1 0 1
Step 2: Place the numbers accordingly:
1 0 1 1 1 0 0 1
Binary Division
Step 3: Determine if 1 0 1 (5) will fit into the
first bit of dividend.
1 0 1 1
1 0 1(5) will not fit into 1(1)
Step 4: Place a zero above the first bit and try
the next bit.
1 1 0 0
Binary Division
1 1 0 0
Step 5: Determine if 1 0 1 (5) will fit into the
next two bits of dividend.
0
1 0 1 1
1 0 1(5) will not fit into 1 1(3)
Step 6: Place a zero above the second bit and
try the next bit.
Binary Division
• Step 7: Determine if 1 0 1 (5) will fit into the
next three bits of dividend.
• 0 0
• 1 0 1 1
• 1 0 1(5) will fit into 1 1 0(6)
• Step 8: Place a one above the third bit and
times it by the divisor (1 0 1)
1 1 0 0
Binary Division
1 0 1 0 1
1 1 0
1 0 1
A subtraction should take place, however you
cannot subtract in binary. Therefore, the two’s
complement of the 2nd number must be found and
the two numbers added together to get a result.
Step 9: The multiplication of the divisor should be
placed under the THREE bits you have used.
0 0 1
Binary Division
0 1
1 1 0
0 1 1
0 0 1
Step 10: The two’s complement of 1 0 1 is 0 1 1
0 0 1
1 0 1
+
Binary Division
0 1
1 1 0
0 1 1
0 0 1 0
Step 11: Determine if 1 0 1 will fit into the remainder
0 0 1. The answer is no so you must bring down the
next number.
0 0 1
1 0 1
+
Binary Division
0 1
1 1 0
0 1 1
0 0 1 0 1
1 0 1
+
Step 12: 1 01 does not fit into 0 0 1 0. Therefore, a
zero is placed above the last bit. And the next number
is used.
0 0 1 0
Binary Division
0 1
1 1 0
0 1 1
0 0 0
1 0 1
+
0 0 1 0 1
+
0 1 1
Step 13: 1 0 1 does fit into 1 0 1 so therefore, a one is
placed above the final number and the process of shift
and add must be continued.
0 0 1 0 1
Binary Division
Step 14: The final answer is 1 0 1 (5) remainder zero.
Activity
4
 Complete the following divisions:
 340 / 20
 580 / 17
Activity
5
 40/4
 36/7
Subtraction using 1’s And 2’s
Complement
Subtraction by 2’s Complement
• The operation is carried out by means of the following
steps:
• At first, 2’s complement of the subtrahend is found.
• Then it is added to the minuend.
• If the final carry over of the sum is 1, it is dropped and
the result is positive.
• If there is no carry over, the two’s complement of the
sum will be the result and it is negative.
Octal Arithmetic
• Octal rules are similar to the decimal or binary arithmetic.
• This number system is normally used to enter long strings of
binary data into a digital system like a microcomputer.
• This makes the task of entering binary data in a
microcomputer easier.
• Arithmetic operations can be performed by converting the
octal numbers to binary numbers and then using the rules of
binary arithmetic.
Octal Addition
Octal Subtraction
Application of Octal Number System
Hexadecimal Arithmetic
• Hexadecimal rules are similar to the decimal,
octal or binary arithmetic.
• The information can be handled only in binary
form in a digital circuit and it Is easier to enter the
information using hexadecimal number system.
• Arithmetic operations can be performed by
converting the Hexadecimal numbers to binary
numbers and then using the rules of binary
arithmetic.
Hexadecimal Addition
Hexadecimal Subtraction
BCD Addition
BCD Subtraction
• Rules
– If EAC(end around carry)=1 then transfer true result of
adder 1
• If Cn=1, 0000 added in adder 2
• If cn =0, 1010 added in adder 2
– If EAC=0 then transfer 1’s compliment of result of adder
1
• If cn=1, 1010 added in adder 2
• If cn =0, 0000 added in adder 2
• If any carry generated in adder 2 discard it.
BCD Subtraction
Adder 2
BCD Subtraction
• (546) – (429) = (117)
• (429) – (546) = (-117)
Excess3 Addition Rules
Step 1
– Convert the numbers into excess 3 forms by adding 0011
Step 2
– Two numbers are added using the basic laws of binary addition
Step 3
– Now which of the four groups have produced a carry we have to
add 0011 with them and subtract 0011 from the groups which
have not produced a carry during the addition.
Step 4
– The result which we have obtained after this operation is in
Excess 3 form and this is our desired result
Excess 3 addition
Excess 3 Code Subtraction
• Step 1
Like the previous method both the numbers have to be converted
into excess 3 code
• Step 2
Following the basic methods of binary subtraction, subtraction is
done
• Step 3
Subtract ‘0011’ from each BCD four-bit group in the answer if the
subtraction operation of the relevant four-bit groups required a
borrow from the next higher adjacent four-bit group
• Step 4
Add ‘0011’ to the remaining four-bit groups, if any, in the result.
Excess 3 Subtraction

More Related Content

What's hot

1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
JEEVANANTHAMG6
 
Number System (Binary,octal,Decimal,Hexadecimal)
Number System (Binary,octal,Decimal,Hexadecimal)Number System (Binary,octal,Decimal,Hexadecimal)
Number System (Binary,octal,Decimal,Hexadecimal)
Lovely Singh
 
Floating point presentation
Floating point presentationFloating point presentation
Floating point presentation
SnehalataAgasti
 
Number Systems
Number SystemsNumber Systems
Number Systems
Jubayer Alam Shoikat
 
Binary addition.pptx
Binary addition.pptxBinary addition.pptx
Binary addition.pptx
Pooja Dixit
 
BINARY NUMBER SYSTEM
BINARY NUMBER SYSTEMBINARY NUMBER SYSTEM
BINARY NUMBER SYSTEM
Zaheer Abbasi
 
BINARY SUBTRACTION
BINARY SUBTRACTIONBINARY SUBTRACTION
BINARY SUBTRACTION
UoHCollegeScienceOfComputer
 
Boolean Algebra
Boolean AlgebraBoolean Algebra
Boolean Algebra
blaircomp2003
 
binary number system
 binary number system binary number system
binary number system
vishal gupta
 
Digital Logic circuit
Digital Logic circuitDigital Logic circuit
Digital Logic circuit
kavitha muneeshwaran
 
PPT ON NUMBER SYSTEM
PPT ON NUMBER SYSTEMPPT ON NUMBER SYSTEM
PPT ON NUMBER SYSTEM
Rishabh Kanth
 
13 Boolean Algebra
13 Boolean Algebra13 Boolean Algebra
13 Boolean Algebra
Praveen M Jigajinni
 
Binary to Decimal Conversion
Binary to Decimal ConversionBinary to Decimal Conversion
Binary to Decimal Conversion
Neelanjan Bhattacharyya
 
Number system
Number systemNumber system
Number system
Sajib
 
Fixed point and floating-point numbers
Fixed point and  floating-point numbersFixed point and  floating-point numbers
Fixed point and floating-point numbers
MOHAN MOHAN
 
Boolean Algebra
Boolean AlgebraBoolean Algebra
Boolean Algebra
Hau Moy
 
Booth's algorithm part 1
Booth's algorithm part 1Booth's algorithm part 1
Booth's algorithm part 1
babuece
 
1s and 2s complement
1s and 2s complement1s and 2s complement
1s and 2s complement
Then Murugeshwari
 
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
Arti Parab Academics
 
Decimal number system
Decimal number systemDecimal number system
Decimal number system
Nisarg Amin
 

What's hot (20)

1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
 
Number System (Binary,octal,Decimal,Hexadecimal)
Number System (Binary,octal,Decimal,Hexadecimal)Number System (Binary,octal,Decimal,Hexadecimal)
Number System (Binary,octal,Decimal,Hexadecimal)
 
Floating point presentation
Floating point presentationFloating point presentation
Floating point presentation
 
Number Systems
Number SystemsNumber Systems
Number Systems
 
Binary addition.pptx
Binary addition.pptxBinary addition.pptx
Binary addition.pptx
 
BINARY NUMBER SYSTEM
BINARY NUMBER SYSTEMBINARY NUMBER SYSTEM
BINARY NUMBER SYSTEM
 
BINARY SUBTRACTION
BINARY SUBTRACTIONBINARY SUBTRACTION
BINARY SUBTRACTION
 
Boolean Algebra
Boolean AlgebraBoolean Algebra
Boolean Algebra
 
binary number system
 binary number system binary number system
binary number system
 
Digital Logic circuit
Digital Logic circuitDigital Logic circuit
Digital Logic circuit
 
PPT ON NUMBER SYSTEM
PPT ON NUMBER SYSTEMPPT ON NUMBER SYSTEM
PPT ON NUMBER SYSTEM
 
13 Boolean Algebra
13 Boolean Algebra13 Boolean Algebra
13 Boolean Algebra
 
Binary to Decimal Conversion
Binary to Decimal ConversionBinary to Decimal Conversion
Binary to Decimal Conversion
 
Number system
Number systemNumber system
Number system
 
Fixed point and floating-point numbers
Fixed point and  floating-point numbersFixed point and  floating-point numbers
Fixed point and floating-point numbers
 
Boolean Algebra
Boolean AlgebraBoolean Algebra
Boolean Algebra
 
Booth's algorithm part 1
Booth's algorithm part 1Booth's algorithm part 1
Booth's algorithm part 1
 
1s and 2s complement
1s and 2s complement1s and 2s complement
1s and 2s complement
 
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
 
Decimal number system
Decimal number systemDecimal number system
Decimal number system
 

Similar to Binary Arithmetic

binary arithmetic conversion.pptx
binary arithmetic conversion.pptxbinary arithmetic conversion.pptx
binary arithmetic conversion.pptx
JayVadgama9
 
Alu1
Alu1Alu1
2sComplementArithmetic1.ppt
2sComplementArithmetic1.ppt2sComplementArithmetic1.ppt
2sComplementArithmetic1.ppt
Sathishkumar.V
 
2sComplementArithmetic1.ppt
2sComplementArithmetic1.ppt2sComplementArithmetic1.ppt
2sComplementArithmetic1.ppt
MeghadriGhosh4
 
2sComplementArithmetic1 lecture slides ppt
2sComplementArithmetic1 lecture slides ppt2sComplementArithmetic1 lecture slides ppt
2sComplementArithmetic1 lecture slides ppt
nashitahalwaz95
 
L3 ARITHMETIC OPERATIONS.pptx
L3 ARITHMETIC OPERATIONS.pptxL3 ARITHMETIC OPERATIONS.pptx
L3 ARITHMETIC OPERATIONS.pptx
Harish257692
 
3810-08.ppt
3810-08.ppt3810-08.ppt
3810-08.ppt
SrinivasanCSE
 
09 binary number systems
09   binary number systems09   binary number systems
09 binary number systems
Lee Chadwick
 
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptx
amudhak10
 
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptx
amudhak10
 
2s complement arithmetic
2s complement arithmetic2s complement arithmetic
2s complement arithmetic
Sanjay Saluth
 
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
Ravi Kumar
 
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
Ravi Kumar
 
CA Unit ii
CA Unit iiCA Unit ii
CA Unit ii
AmirthavalliR
 
ARITHMETIC FOR COMPUTERS
ARITHMETIC FOR COMPUTERS	  ARITHMETIC FOR COMPUTERS
ARITHMETIC FOR COMPUTERS
Amirthavalli Senthil
 
Integer Representation
Integer RepresentationInteger Representation
Integer Representationgavhays
 
CA UNIT II.pptx
CA UNIT II.pptxCA UNIT II.pptx
CA UNIT II.pptx
ssuser9dbd7e
 
Number system utm notes
Number system utm notesNumber system utm notes
Number system utm notes
Kurenai Ryu
 
Lesson plan on data representation
Lesson plan on data representationLesson plan on data representation
Lesson plan on data representation
Pooja Tripathi
 
lect1.ppt
lect1.pptlect1.ppt
lect1.ppt
MarlonMagtibay2
 

Similar to Binary Arithmetic (20)

binary arithmetic conversion.pptx
binary arithmetic conversion.pptxbinary arithmetic conversion.pptx
binary arithmetic conversion.pptx
 
Alu1
Alu1Alu1
Alu1
 
2sComplementArithmetic1.ppt
2sComplementArithmetic1.ppt2sComplementArithmetic1.ppt
2sComplementArithmetic1.ppt
 
2sComplementArithmetic1.ppt
2sComplementArithmetic1.ppt2sComplementArithmetic1.ppt
2sComplementArithmetic1.ppt
 
2sComplementArithmetic1 lecture slides ppt
2sComplementArithmetic1 lecture slides ppt2sComplementArithmetic1 lecture slides ppt
2sComplementArithmetic1 lecture slides ppt
 
L3 ARITHMETIC OPERATIONS.pptx
L3 ARITHMETIC OPERATIONS.pptxL3 ARITHMETIC OPERATIONS.pptx
L3 ARITHMETIC OPERATIONS.pptx
 
3810-08.ppt
3810-08.ppt3810-08.ppt
3810-08.ppt
 
09 binary number systems
09   binary number systems09   binary number systems
09 binary number systems
 
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptx
 
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptx
 
2s complement arithmetic
2s complement arithmetic2s complement arithmetic
2s complement arithmetic
 
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
 
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
 
CA Unit ii
CA Unit iiCA Unit ii
CA Unit ii
 
ARITHMETIC FOR COMPUTERS
ARITHMETIC FOR COMPUTERS	  ARITHMETIC FOR COMPUTERS
ARITHMETIC FOR COMPUTERS
 
Integer Representation
Integer RepresentationInteger Representation
Integer Representation
 
CA UNIT II.pptx
CA UNIT II.pptxCA UNIT II.pptx
CA UNIT II.pptx
 
Number system utm notes
Number system utm notesNumber system utm notes
Number system utm notes
 
Lesson plan on data representation
Lesson plan on data representationLesson plan on data representation
Lesson plan on data representation
 
lect1.ppt
lect1.pptlect1.ppt
lect1.ppt
 

More from Meenakshi Paul

Introduction to Artificial Intelligences
Introduction to Artificial IntelligencesIntroduction to Artificial Intelligences
Introduction to Artificial Intelligences
Meenakshi Paul
 
19 Network Layer Protocols
19 Network Layer Protocols19 Network Layer Protocols
19 Network Layer Protocols
Meenakshi Paul
 
Other Wireless Networks
Other Wireless NetworksOther Wireless Networks
Other Wireless Networks
Meenakshi Paul
 
Wireless LANs
Wireless LANsWireless LANs
Wireless LANs
Meenakshi Paul
 
Wired LANs
Wired LANsWired LANs
Wired LANs
Meenakshi Paul
 
Codes
CodesCodes
Number System
Number SystemNumber System
Number System
Meenakshi Paul
 
Media Access Control (MAC Layer)
Media Access Control (MAC Layer)Media Access Control (MAC Layer)
Media Access Control (MAC Layer)
Meenakshi Paul
 
Data Link Control
Data Link ControlData Link Control
Data Link Control
Meenakshi Paul
 
Introduction to the Data Link Layer
Introduction to the Data Link LayerIntroduction to the Data Link Layer
Introduction to the Data Link Layer
Meenakshi Paul
 
Switching
SwitchingSwitching
Switching
Meenakshi Paul
 
Transmission Media
Transmission MediaTransmission Media
Transmission Media
Meenakshi Paul
 
Bandwidth Utilization Multiplexing and Spectrum Spreading
Bandwidth Utilization Multiplexing and Spectrum SpreadingBandwidth Utilization Multiplexing and Spectrum Spreading
Bandwidth Utilization Multiplexing and Spectrum Spreading
Meenakshi Paul
 
IP classes
IP classesIP classes
IP classes
Meenakshi Paul
 
Theory building
Theory buildingTheory building
Theory building
Meenakshi Paul
 
Information Systems and Knowledge Management
 Information Systems and Knowledge Management Information Systems and Knowledge Management
Information Systems and Knowledge Management
Meenakshi Paul
 
Ch01 The Role of Business Research
Ch01 The Role of Business ResearchCh01 The Role of Business Research
Ch01 The Role of Business Research
Meenakshi Paul
 
05 analog transmission
05 analog transmission05 analog transmission
05 analog transmission
Meenakshi Paul
 
04 digital transmission
04 digital transmission04 digital transmission
04 digital transmission
Meenakshi Paul
 
03 Introduction to Physical layer
03  Introduction to Physical layer03  Introduction to Physical layer
03 Introduction to Physical layer
Meenakshi Paul
 

More from Meenakshi Paul (20)

Introduction to Artificial Intelligences
Introduction to Artificial IntelligencesIntroduction to Artificial Intelligences
Introduction to Artificial Intelligences
 
19 Network Layer Protocols
19 Network Layer Protocols19 Network Layer Protocols
19 Network Layer Protocols
 
Other Wireless Networks
Other Wireless NetworksOther Wireless Networks
Other Wireless Networks
 
Wireless LANs
Wireless LANsWireless LANs
Wireless LANs
 
Wired LANs
Wired LANsWired LANs
Wired LANs
 
Codes
CodesCodes
Codes
 
Number System
Number SystemNumber System
Number System
 
Media Access Control (MAC Layer)
Media Access Control (MAC Layer)Media Access Control (MAC Layer)
Media Access Control (MAC Layer)
 
Data Link Control
Data Link ControlData Link Control
Data Link Control
 
Introduction to the Data Link Layer
Introduction to the Data Link LayerIntroduction to the Data Link Layer
Introduction to the Data Link Layer
 
Switching
SwitchingSwitching
Switching
 
Transmission Media
Transmission MediaTransmission Media
Transmission Media
 
Bandwidth Utilization Multiplexing and Spectrum Spreading
Bandwidth Utilization Multiplexing and Spectrum SpreadingBandwidth Utilization Multiplexing and Spectrum Spreading
Bandwidth Utilization Multiplexing and Spectrum Spreading
 
IP classes
IP classesIP classes
IP classes
 
Theory building
Theory buildingTheory building
Theory building
 
Information Systems and Knowledge Management
 Information Systems and Knowledge Management Information Systems and Knowledge Management
Information Systems and Knowledge Management
 
Ch01 The Role of Business Research
Ch01 The Role of Business ResearchCh01 The Role of Business Research
Ch01 The Role of Business Research
 
05 analog transmission
05 analog transmission05 analog transmission
05 analog transmission
 
04 digital transmission
04 digital transmission04 digital transmission
04 digital transmission
 
03 Introduction to Physical layer
03  Introduction to Physical layer03  Introduction to Physical layer
03 Introduction to Physical layer
 

Recently uploaded

Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
PrashantGoswami42
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
Kamal Acharya
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
Kamal Acharya
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
DuvanRamosGarzon1
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
Kamal Acharya
 

Recently uploaded (20)

Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
 

Binary Arithmetic

  • 2. BinaryArithmetic • Binary arithmetic is essential part of all the digital computers and many other digital system. • Binary arithmetic is used in digital systems mainly because the numbers (decimal and floating-point numbers) are stored in binary format in most computer systems. • All arithmetic operations such as addition, subtraction, multiplication, and division are done in binary representation of numbers.
  • 3. Binary Addition  The steps used for a computer to complete addition are usually greater than a human, but their processing speed is far superior. RULES  0 + 0 = 0  0 + 1 = 1  1 + 0 = 1  1 + 1 = 0 (With 1 to carry)  1 + 1 + 1 = 1 (With 1 to carry)
  • 5. Binary Addition EXAMPLE 1 0 01 1 1 0 1 1 0 +
  • 6. Binary Addition EXAMPLE 1 01 01 1 1 0 1 1 0 0 +
  • 7. Binary Addition EXAMPLE 1 01 01 1 1 0 1 1 1 0 0 +
  • 8. Binary Addition EXAMPLE 11 01 01 1 1 0 1 1 0 1 0 0 +
  • 9. Binary Addition EXAMPLE 11 01 01 1 1 0 1 1 1 0 1 0 0 +
  • 10. Binary Addition CHECK THE ANSWER 9 11 20 +
  • 11. Activity 1 Perform the following additions in binary.  10110 + 4010 =  32010 + 1810 =  7610 + 27110 =
  • 13. Binary Subtraction  Computers have trouble performing subtractions so the following rule should be employed: “X – X is the same as X + -X”  This is where two’s complement is used.
  • 14. Binary Subtraction RULES 2. Convert the number to binary. 3. Perform two’s complement on the second number. 4. Add both numbers together.
  • 15. Binary Subtraction EXAMPLE 1 Convert 12 - 8 using two’s complement. 3. Convert to binary 12 = 000011002  8 = 000010002 Perform one’s complement on the 810 000010002 111101112
  • 16. Binary Subtraction EXAMPLE 1 2. Perform two’s complement. 1 1 1 1 0 1 1 12 0 0 0 0 0 0 0 12 1 1 1 1 1 0 0 02 6. Add the two numbers together. = 1 0 0 0 0 0 1 0 02 (Ignore insignificant bits) +
  • 17. Binary Subtraction EXAMPLE 2 What happens if the first number is larger than the second? Try 610 - 1010
  • 18. Binary Subtraction EXAMPLE 2 2. Convert to binary 6 = 000001102  10 = 000010102 Perform one’s complement on the 1010 000010102 111101012
  • 19. Binary Subtraction EXAMPLE 2 2. Perform two’s complement. 1 1 1 1 0 1 0 12 2 = 1 1 1 1 0 1 1 02 0 0 0 0 0 0 0 1+
  • 20. Binary Subtraction EXAMPLE 2 2. Add the two numbers together. 0 0 0 0 0 1 1 02 1 1 1 1 0 1 1 02 1 = 1 1 1 1 1 0 02 (Ends with a negative bit) +
  • 21. Binary Subtraction EXAMPLE 2 2. Perform one’s complement on the result 1 1 1 1 1 1 0 02 0 0 0 0 0 0 1 12 5. Add 1 to the result. 0 0 0 0 0 0 1 12 0 0 0 0 0 0 0 12 = 0 0 0 0 0 1 0 02 +
  • 22. Binary Subtraction EXAMPLE 2 2. We then add the sign bit back. 0 0 0 0 0 1 0 02 = 1 0 0 0 0 1 0 02
  • 23. Activity 2 Perform the following subtractions. 3. 22 - 8 = 4. 76 - 11 = 5. 6 - 44 =
  • 24. Binary Multiplication  Multiplication follows the general principal of shift and add.  The rules include:     0 * 0 = 0 0 * 1 = 0 1 * 0 = 0 1 * 1 = 1
  • 25. Binary Multiplication EXAMPLE 1 Complete 15 * 5 in binary. 3. Convert to binary 15 = 000011112 5 = 000001012 6. Ignore any insignificant zeros. 000011112 000001012 x
  • 26. Binary Multiplication EXAMPLE 1 2. Multiply the first number. 1 1 1 12 1 0 1 2 1 1 1 1 7. Now this is where the shift and takes place. x 1111 x 1 = 1111
  • 27. Binary Multiplication EXAMPLE 1 2. Shift one place to the left and multiple the second digit. 1 1 1 12 1 0 1 2 1 1 1 1 0 0 0 0 0 x 1111 x 0 = 0000 Shift One Place
  • 28. Binary Multiplication EXAMPLE 1 2. Shift one place to the left and multiple the third digit. 1 1 1 12 1 0 1 2 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 x 1111 x 1 = 1111 Shift One Place
  • 29. Binary Multiplication EXAMPLE 1 2. Add the total of all the steps. 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 1 0 0 1 0 1 1 8. Convert back to decimal to check. +
  • 30. Activity 3 Calculate the following using binary multiplication shift and add.     12 * 3 = 1 0 0 1 0 02 13 * 5 = 1 0 0 0 0 0 12 97 * 20 = 1 1 1 1 0 0 1 0 1 0 02 121 * 67 = 1 1 1 1 1 1 0 1 0 1 0 1 12
  • 31. Binary Division  Division in binary is similar to long division in decimal.  It uses what is called a shift and subtract method.
  • 32. Binary Division EXAMPLE 1 Complete 575 / 25 using long division. 2. 0 25 575 Take the first digit of 575 (5) and see if 25 will go into it. If it can not put a zero above and take the next number. 02  How many times does 25 go into 57? 2. 25 575 TWICE
  • 33. Binary Division 02  How much is left over? 2. 25 575  57 – (25 * 2) = 7 50 7 02  Drop down the next value 2. 25 575 50 75
  • 34. Binary Division 023  Divide 75 by 25 2. 25 575  Result = 3 50 75 023  Check for remainder  75 – (3 * 25) = 0  FINISH! 2. 25 575 50 75 75 0
  • 35. Binary Division  Complete the following:  25/5 Step 1: Convert both numbers to binary. 25 = 1 1 0 0 1 5 = 1 0 1 Step 2: Place the numbers accordingly: 1 0 1 1 1 0 0 1
  • 36. Binary Division Step 3: Determine if 1 0 1 (5) will fit into the first bit of dividend. 1 0 1 1 1 0 1(5) will not fit into 1(1) Step 4: Place a zero above the first bit and try the next bit. 1 1 0 0
  • 37. Binary Division 1 1 0 0 Step 5: Determine if 1 0 1 (5) will fit into the next two bits of dividend. 0 1 0 1 1 1 0 1(5) will not fit into 1 1(3) Step 6: Place a zero above the second bit and try the next bit.
  • 38. Binary Division • Step 7: Determine if 1 0 1 (5) will fit into the next three bits of dividend. • 0 0 • 1 0 1 1 • 1 0 1(5) will fit into 1 1 0(6) • Step 8: Place a one above the third bit and times it by the divisor (1 0 1) 1 1 0 0
  • 39. Binary Division 1 0 1 0 1 1 1 0 1 0 1 A subtraction should take place, however you cannot subtract in binary. Therefore, the two’s complement of the 2nd number must be found and the two numbers added together to get a result. Step 9: The multiplication of the divisor should be placed under the THREE bits you have used. 0 0 1
  • 40. Binary Division 0 1 1 1 0 0 1 1 0 0 1 Step 10: The two’s complement of 1 0 1 is 0 1 1 0 0 1 1 0 1 +
  • 41. Binary Division 0 1 1 1 0 0 1 1 0 0 1 0 Step 11: Determine if 1 0 1 will fit into the remainder 0 0 1. The answer is no so you must bring down the next number. 0 0 1 1 0 1 +
  • 42. Binary Division 0 1 1 1 0 0 1 1 0 0 1 0 1 1 0 1 + Step 12: 1 01 does not fit into 0 0 1 0. Therefore, a zero is placed above the last bit. And the next number is used. 0 0 1 0
  • 43. Binary Division 0 1 1 1 0 0 1 1 0 0 0 1 0 1 + 0 0 1 0 1 + 0 1 1 Step 13: 1 0 1 does fit into 1 0 1 so therefore, a one is placed above the final number and the process of shift and add must be continued. 0 0 1 0 1
  • 44. Binary Division Step 14: The final answer is 1 0 1 (5) remainder zero.
  • 45. Activity 4  Complete the following divisions:  340 / 20  580 / 17
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57. Subtraction using 1’s And 2’s Complement
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64. Subtraction by 2’s Complement • The operation is carried out by means of the following steps: • At first, 2’s complement of the subtrahend is found. • Then it is added to the minuend. • If the final carry over of the sum is 1, it is dropped and the result is positive. • If there is no carry over, the two’s complement of the sum will be the result and it is negative.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69. Octal Arithmetic • Octal rules are similar to the decimal or binary arithmetic. • This number system is normally used to enter long strings of binary data into a digital system like a microcomputer. • This makes the task of entering binary data in a microcomputer easier. • Arithmetic operations can be performed by converting the octal numbers to binary numbers and then using the rules of binary arithmetic.
  • 72. Application of Octal Number System
  • 73. Hexadecimal Arithmetic • Hexadecimal rules are similar to the decimal, octal or binary arithmetic. • The information can be handled only in binary form in a digital circuit and it Is easier to enter the information using hexadecimal number system. • Arithmetic operations can be performed by converting the Hexadecimal numbers to binary numbers and then using the rules of binary arithmetic.
  • 76.
  • 77.
  • 79. BCD Subtraction • Rules – If EAC(end around carry)=1 then transfer true result of adder 1 • If Cn=1, 0000 added in adder 2 • If cn =0, 1010 added in adder 2 – If EAC=0 then transfer 1’s compliment of result of adder 1 • If cn=1, 1010 added in adder 2 • If cn =0, 0000 added in adder 2 • If any carry generated in adder 2 discard it.
  • 81. BCD Subtraction • (546) – (429) = (117) • (429) – (546) = (-117)
  • 82. Excess3 Addition Rules Step 1 – Convert the numbers into excess 3 forms by adding 0011 Step 2 – Two numbers are added using the basic laws of binary addition Step 3 – Now which of the four groups have produced a carry we have to add 0011 with them and subtract 0011 from the groups which have not produced a carry during the addition. Step 4 – The result which we have obtained after this operation is in Excess 3 form and this is our desired result
  • 84. Excess 3 Code Subtraction • Step 1 Like the previous method both the numbers have to be converted into excess 3 code • Step 2 Following the basic methods of binary subtraction, subtraction is done • Step 3 Subtract ‘0011’ from each BCD four-bit group in the answer if the subtraction operation of the relevant four-bit groups required a borrow from the next higher adjacent four-bit group • Step 4 Add ‘0011’ to the remaining four-bit groups, if any, in the result.