4.1.4
Binary Arithmetic
Binary Addition
Binary Addition
We can add two binary numbers in exactly the same way as denary numbers.
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.
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.
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.
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.
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).
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
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