4.1.4
Binary Arithmetic
Binary Addition
Binary Addition
We can add two binary numbers in exactly the same way as denary numbers.
![Illustrative background for Adding two digits](https://image-v2.cdn.app.senecalearning.com/2018-08/c7c2a77c-8f38-450a-a083-bbfd3f6801d4/plus-sign-add-,h_400,q_80,w_640.png)
![Illustrative background for Adding two digits ?? "content](https://image-v2.cdn.app.senecalearning.com/2018-08/c7c2a77c-8f38-450a-a083-bbfd3f6801d4/plus-sign-add-,h_400,q_80,w_640.png)
Adding two digits
Adding two digits
- If we add 0 + 0 we get 0.
- If we add 1 + 0 (or 0 + 1) we get 1.
- If we add 1 + 1, then we cannot use the symbol 2. So we need to carry the 1 and put 0 in the current place.
![Illustrative background for Adding in a third bit](https://image-v2.cdn.app.senecalearning.com/courseImages/physics/4.3.5 - Digital Circuits/binary-min,h_400,q_80,w_640.jpg)
![Illustrative background for Adding in a third bit ?? "content](https://image-v2.cdn.app.senecalearning.com/courseImages/physics/4.3.5 - Digital Circuits/binary-min,h_400,q_80,w_640.jpg)
Adding in a third bit
Adding in a third bit
- It might be the case that we have 1 + 1 and also a 1 carried over from the previous column.
- If this is the case, then we carry the 1 and have 1 left over.
- So we carry 1 and put 1 in the current place.
![Illustrative background for Overflow errors](https://image-v2.cdn.app.senecalearning.com/2018-08/5186415f-5044-4244-b7d5-e3ee41372c0d/sign-alert-,h_400,q_80,w_640.jpg)
![Illustrative background for Overflow errors ?? "content](https://image-v2.cdn.app.senecalearning.com/2018-08/5186415f-5044-4244-b7d5-e3ee41372c0d/sign-alert-,h_400,q_80,w_640.jpg)
Overflow errors
Overflow errors
- Binary numbers are stored as a fixed length.
- If a number is carried past the last place column, then this is called an overflow error.
- Overflow errors can lead to inaccurate results and software crashes.
Binary Shifts
Binary Shifts
A binary shift is a technique for performing multiplication or division on a binary number.
![Illustrative background for Binary shift](https://image-v2.cdn.app.senecalearning.com/2018-07/489f501c-2143-4e06-96e9-abf89c790f6e/Code-Encryption-Matrix-Screen-Computer-,h_400,q_80,w_640.jpg)
![Illustrative background for Binary shift ?? "content](https://image-v2.cdn.app.senecalearning.com/2018-07/489f501c-2143-4e06-96e9-abf89c790f6e/Code-Encryption-Matrix-Screen-Computer-,h_400,q_80,w_640.jpg)
Binary shift
Binary shift
- In a binary shift, each digit is moved one column to the left or the right.
- Extra 0 bits are added to the start or end of the binary number to fill any missing spaces.
![Illustrative background for Left binary shift](https://image-v2.cdn.app.senecalearning.com/2018-06/6ede39b1-6f96-4078-ba64-5d07f569a573/depositphotos_5660618-stock-illustration-binary-code-seamless-pattern,h_400,q_80,w_640.jpg)
![Illustrative background for Left binary shift ?? "content](https://image-v2.cdn.app.senecalearning.com/2018-06/6ede39b1-6f96-4078-ba64-5d07f569a573/depositphotos_5660618-stock-illustration-binary-code-seamless-pattern,h_400,q_80,w_640.jpg)
Left binary shift
Left binary shift
- In a left binary shift, each digit is moved one place to the left.
- This has the effect of multiplying the number by two.
- You must take care, when performing a left shift, that there is no overflow error (where we run out of space to store the last digit of the number).
![Illustrative background for Right binary shift](https://image-v2.cdn.app.senecalearning.com/2018-08/299fd687-0b03-4954-a77c-ecdb601d4f38/Security-Encryption-Code-Internet-Computer-,h_400,q_80,w_640.jpg)
![Illustrative background for Right binary shift ?? "content](https://image-v2.cdn.app.senecalearning.com/2018-08/299fd687-0b03-4954-a77c-ecdb601d4f38/Security-Encryption-Code-Internet-Computer-,h_400,q_80,w_640.jpg)
Right binary shift
Right binary shift
- In a right binary shift, each digit is moved one place to the right.
- This has the effect of dividing the number by two.
- You must take care when performing a right shift that no data is shifted off the right hand side. This can cause a loss of accuracy.
1Components of a Computer
1.1Structure & Function of the Processor
1.2Types of Processors
2Software & Software Development
2.1Systems Software
2.2Applications Generation
2.3Software Development
3Exchanging Data
3.1Compression, Encryption & Hashing
3.3Networks
4Data Types, Data Structures & Algorithms
4.1Data Types
5Legal, Moral, Cultural & Ethical Issues
5.1Computing Related Legislation
6Elements of Computational Thinking
6.1Thinking Abstractly
6.2Thinking Procedurally
6.3Thinking Logically
7Problem Solving & Programming
7.1Programming Techniques
7.2Programming Construction
Jump to other topics
1Components of a Computer
1.1Structure & Function of the Processor
1.2Types of Processors
2Software & Software Development
2.1Systems Software
2.2Applications Generation
2.3Software Development
3Exchanging Data
3.1Compression, Encryption & Hashing
3.3Networks
4Data Types, Data Structures & Algorithms
4.1Data Types
5Legal, Moral, Cultural & Ethical Issues
5.1Computing Related Legislation
6Elements of Computational Thinking
6.1Thinking Abstractly
6.2Thinking Procedurally
6.3Thinking Logically
7Problem Solving & Programming
7.1Programming Techniques
7.2Programming Construction
![Go student ad image](/en-GB/revision-notes/_next/image?url=%2Fen-GB%2Frevision-notes%2Fimages%2Fgo-student-uk-ad.jpg&w=640&q=100)
Unlock your full potential with GoStudent tutoring
Affordable 1:1 tutoring from the comfort of your home
Tutors are matched to your specific learning needs
30+ school subjects covered