Number systems
- Binary: Known as Base2
- Digits: 0 & 1 - Decimal: Known as Base10
- Digits: 0-9 - Octal: Known as Base 8
- Digits: 0-7 - Hexadecimal: Known as Base16,
- Uses both numbers and characters.
- Digits: 0-9 | A-F
- 10=A
- 11=B
- 12=C
- 13=D
- 14=E
- 15=F
- Binary Coded Decimal (BCD): Notes will be made later.
Positional notation
When we write decimal (Base10) numbers, positional notation is used. Each digit is multiplied by an appropriate number of 10 depending on its position in the number.
| Number System | Example | Positional Expansion | Base-10 Conversion |
|---|---|---|---|
| Base 10 | 17₁₀ | 1 × 10¹ + 7 × 10⁰ | 10 + 7 = 17₁₀ |
| Base 10 | 1216₁₀ | 1 × 10³ + 2 × 10² + 1 × 10¹ + 6 × 10⁰ | 1000 + 200 + 10 + 6 = 1216₁₀ |
| Binary | 1011₂ | 1 × 2³ + 0 × 2² + 1 × 2¹ + 1 × 2⁰ | 8 + 0 + 2 + 1 = 11₁₀ |
| Octal | 731₈ | 7 × 8² + 3 × 8¹ + 1 × 8⁰ | 448 + 24 + 1 = 473₁₀ |
| Hexadecimal | AD14₁₆ | 10 × 16³ + 13 × 16² + 1 × 16¹ + 4 × 16⁰ | 40960 + 3328 + 16 + 4 = 44308₁₀ |
| Digit | Positional Value |
|---|---|
1 | 1 × 2² |
0 | 0 × 2¹ |
1 | 1 × 2⁰ |
. | Binary point |
0 | 0 × 2⁻¹ |
1 | 1 × 2⁻² |
1 | 1 × 2⁻³ |
Place-Value, Binary
| Decimal | Binary |
|---|---|
| Ones, tens, hundredths, etc. | Ones, twos, fours, eighths, etc. |
| Weight | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
| Value | 1 | 1 | 0 | 1 | 0 | 1 | 1 |
| 8 | 4 | 2 | 1 | Digit |
|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 1 |
| 0 | 0 | 1 | 0 | 2 |
| 0 | 0 | 1 | 1 | 3 |
| 0 | 1 | 0 | 0 | 4 |
| 0 | 1 | 0 | 1 | 5 |
| 0 | 1 | 2 | 0 | 6 |
| 0 | 1 | 1 | 1 | 7 |
| 1 | 0 | 0 | 0 | 8 |
Binary Coded Decimal (BCD)
BCD splits the digits of a decimal into 4-bit binaries.
| Decimal | BCD |
|---|---|
23.12₁₀ | 00100011.00010010₂ |
79.92₁₀ | 01111001.10010010₂ |
Octal → Binary
| Octal digit | Binary |
|---|---|
3 | 011 |
5 | 101 |
7 | 111 |
Therefore: 357₈ → 011101111₂ |
Number-System Conversion
| Number System | Representation |
|---|---|
| Decimal | 239₁₀ |
| Octal | 357₈ |
| Hexadecimal | EF₁₆ |
| Binary | 11101111₂ |
| BCD | 001000111001 |
Arithmetic
| Normal | Binary |
|---|---|
| 10+3= 13 | 1010+0011= |
Sign-Magnitude
In a 4-bit system, the sign occupies one bit and is the most significant one– located at the right end. The rest of the bits store the values and are referred to as magnitude. In absolute calculations, we can tell our detector circuit to disregard the sign bit and just work with the magnitude ones
-6 = 1100
| Bit | Value |
|---|---|
| 1 | - |
| 1 |
Sign Bit Values:
0is+1is-
Minimum value for 4-bit:
Maximum value for 4-bit:
Minimum value for 6-bit:
- 9-4=5
Ones Complement
4-bit Ones Comp
+5 -> (0)101
-5 -> (1)010
To convert, simply
-3 —> 0011
+3 —> 1100
- 6-4 -> 6 + (-3)
- 6 -> (0)110
- -3 -> 001 -> (flip)1100
End-round carry must be added back to final value, drawback.