ASCII vs UNICODE
The issue with ASCII
The problem with 7-bit ASCII character set is that it is only able to represent 128 different characters. An 8-bit system improves this but the real solution is...
UNICODE
- Languages like Japanese, Arabic and Hebrew have a much larger alphabet than English
- UNICODE uses up to four bytes to represent each character meaning that it can represent up to 110,000 different characters
Data Types
Untitled
Representing negative numbers
1. Sign and magnitude
- MSB represents the sign. 1 means that the number is negative and 0 for positive
2. Two's complement
<aside>
✅ Allows for binary addition
</aside>
To write in two's complement, write the usual binary number. Then, starting at the right hand side, leave every bit up to and including the first 1 alone, but invert all the bits after this.
Adding and subtracting binary
- Adding is fairly straight-forward
- For subtracting, convert the number to be subtracted into two's complement and then add together.