You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
This lesson covers how computers represent signed integers using two's complement and how fixed-point binary is used to represent fractional numbers. Both are required for the OCR H446 specification.
Computers need to represent both positive and negative integers. Since binary only has 0s and 1s, a convention is needed to distinguish between positive and negative values.
| Method | Description | Used in Practice? |
|---|---|---|
| Sign and magnitude | The MSB is the sign (0 = positive, 1 = negative); remaining bits = magnitude | Rarely — has +0 and -0 |
| One's complement | Negative = flip all bits of the positive value | Rarely — has +0 and -0 |
| Two's complement | Negative = flip all bits and add 1 | Yes — standard method |
Two's complement is the standard because:
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.