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
negative-binary-numbers
Signed Binary Numbers
What are signed binary numbers?
-
A binary number can be signed or unsigned:
-
Unsigned – used to represent positive binary numbers
-
Signed – used to represent both positive and negative binary numbers
-
-
We can use signed binary numbers to represent negative numbers using methods such as:
-
Sign & magnitude
-
Two’s complement
-
-
Both of these methods use the Most Significant Bit (MSB) to represent whether the number is negative or positive:
-
If the MSB is 0, the number is positive
-
If the MSB is 1, the number is negative
-
Sign & Magnitude
-
Sign & magnitude binary numbers contain a:
-
Sign – This is when the MSB is used to represent whether the number is negative (1) or positive (0)
-
Magnitude – This is used to describe the rest of the bits after the MSB
-

Representing negative binary numbers using sign & magnitude
Binary to denary example
-
To convert a sign & magnitude binary number to denary, you need to:
-
Convert the number as normal from binary to denary (as described in Positive Binary number: Binary to Denary)
-
Apply the MSB at the end of the calculation
-
If the MSB is 1, the number is negative
-
If the MSB is 0, the number is positive
-
-

Converting sign & magnitude binary numbers to denary
Denary to binary example
-
To convert a denary number to a sign & magnitude binary number, you need to:
-
Identify whether the number is positive or negative
-
Convert the number to binary as normal (as described in Positive Binary Numbers: Denary to Binary)
-
If the number is negative, change the MSB to 1
-
|
MSB |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
|---|---|---|---|---|---|---|---|
|
1 |
1 |
0 |
0 |
0 |
1 |
1 |
1 |
-
64 + 4 + 2 + 1 = 71
-
Apply a sign of 1 to make -71
-
Therefore the denary number -71 in binary is 11000111
A consequence of using a sign bit
-
The MSB purpose changes from representing a value to representing positive or negative
-
Losing the MSB halves the maximum size of the number that can be stored
-
However, as a benefit it makes it possible to represent negative numbers

Sign & magnitude number system
Worked Example
Convert the 8-bit sign and magnitude binary number 10001011 to denary.
How to answer this question:
-
Identify the sign bit: The MSB is 1, so the number is negative
-
Isolate the magnitude: We are left with 0001011 by removing the sign bit
-
Convert to denary: The binary number 0001011 converts to 11 in denary
-
Apply the sign: The MSB was 1, so the number is -11 in denary
Answer:
Answer that gets full marks
10001011 converts to -11 in denary
Two’s Complement
-
Two’s complement is a different method for representing negative binary numbers
-
Calculations on two’s complement numbers are less computationally intensive
Method
-
Start with the absolute value of the number, in this case 12
-
Invert the bits so that all of the 1’s become 0’s and all of the 0’s become 1’s
-
Add 1

Representing two’s complement binary numbers
-
The purpose of the MSB has changed; it now represents the negative starting point of the number, and the rest of the bits are used to count upwards from that number
-
Using the binary number from the image above:
-
Begin counting at -16
-
Add 4 to make -12
-
-
Two’s complement has a similar consequence to sign and magnitude as the maximum value of an 8-bit value is halved
Denary to binary example
-
To convert the denary number -24 to a two’s complement binary number, you need to:
-
Convert the number to binary
-
|
-128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
|---|---|---|---|---|---|---|---|
|
0 |
0 |
0 |
1 |
1 |
0 |
0 |
0 |
-
Invert the bits
|
-128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
|---|---|---|---|---|---|---|---|
|
1 |
1 |
1 |
0 |
0 |
1 |
1 |
1 |
-
Add 1 to the number
|
-128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
|---|---|---|---|---|---|---|---|
|
1 |
1 |
1 |
Responses