Computer-Science-A-level-Ocr
-
3-3-networks8 主题
-
3-2-databases7 主题
-
3-1-compression-encryption-and-hashing4 主题
-
2-5-object-oriented-languages7 主题
-
2-4-types-of-programming-language4 主题
-
2-3-software-development5 主题
-
2-2-applications-generation6 主题
-
2-1-systems-software8 主题
-
1-3-input-output-and-storage2 主题
-
1-2-types-of-processor3 主题
-
1-1-structure-and-function-of-the-processor1 主题
-
structuring-your-responses3 主题
-
the-exam-papers2 主题
-
8-2-algorithms-for-the-main-data-structures4 主题
-
8-1-algorithms10 主题
-
7-2-computational-methods11 主题
-
7-1-programming-techniques14 主题
-
capturing-selecting-managing-and-exchanging-data
-
entity-relationship-diagrams
-
data-normalisation
-
relational-databases
-
hashing
-
symmetric-vs-asymmetric-encryption
-
run-length-encoding-and-dictionary-coding
-
lossy-and-lossless-compression
-
polymorphism-oop
-
encapsulation-oop
-
inheritance-oop
-
attributes-oop
-
methods-oop
-
objects-oop
-
capturing-selecting-managing-and-exchanging-data
-
6-5-thinking-concurrently2 主题
-
6-4-thinking-logically2 主题
-
6-3-thinking-procedurally3 主题
-
6-2-thinking-ahead1 主题
-
6-1-thinking-abstractly3 主题
-
5-2-moral-and-ethical-issues9 主题
-
5-1-computing-related-legislation4 主题
-
4-3-boolean-algebra5 主题
-
4-2-data-structures10 主题
-
4-1-data-types9 主题
-
3-4-web-technologies16 主题
-
environmental-effects
-
automated-decision-making
-
computers-in-the-workforce
-
layout-colour-paradigms-and-character-sets
-
piracy-and-offensive-communications
-
analysing-personal-information
-
monitoring-behaviour
-
censorship-and-the-internet
-
artificial-intelligence
-
the-regulation-of-investigatory-powers-act-2000
-
the-copyright-design-and-patents-act-1988
-
the-computer-misuse-act-1990
-
the-data-protection-act-1998
-
adder-circuits
-
flip-flop-circuits
-
simplifying-boolean-algebra
-
environmental-effects
binary-addition-and-subtraction
Binary Addition
What is binary addition?
-
Binary addition involves summing numbers in base-2, which uses only the digits 0 and 1
-
Like denary addition, start from the rightmost digit and move towards the left
-
Carrying over occurs when the sum of a column is greater than 1, passing the excess to the next left column
Example addition

Binary addition example
Overflow errors
-
Overflow occurs when the sum of two binary numbers exceeds the given number of bits
-
In signed number representations, the leftmost bit often serves as the sign bit; overflow can flip this, incorrectly changing the sign of the result
-
Overflow generally leads to incorrect or unpredictable results as the extra bits are truncated or wrapped around

An overflow occurring after a binary addition
Binary Subtraction
-
As well as adding binary numbers, we can also subtract binary numbers
-
One method of doing this is to use two’s complement
Example 1
Subtract 0011 (3) from 1001 (9)
1. Given numbers
|
Number 1 |
|
|
|
|
|
Number 2 |
|
|
|
|
2. Two’s complement
-
Convert the number to subtract (
0011) to its two’s complement -
Invert:
1100 -
Add 1:
1100 + 0001 = 1101
|
Number 1 |
|
|
|
|
|
Number 2 (Converted) |
|
|
|
|
3. Addition operation
-
Now add 1001 and 1101
-
Binary sum:
1001 + 1101 = 1 0110 -
That’s 5 bits: the leftmost
1is overflow (carry out of MSB)
|
Carry |
|
|
|
|
|
|
Number 1 |
|
|
|
|
|
|
Number 2 |
|
|
|
|
|
|
Addition |
|
|
|
|
|
4. Remove overflow
-
The result is
10110with overflow -
Drop the leading
1(overflow):0110= 6 (in decimal) -
In two’s complement arithmetic, the overflow bit does not contribute to the actual value of the operation but is more of a by-product of the method
-
Final answer = 6
-
9 – 3 = 6
Responses