Number Systems (Binary and Hexadecimal)
Context: FIT1047_MOC · positional notation in bases , , · the Assignment 1 hand skill · basis of Signed Integer Representation (Two’s Complement) and Floating Point Numbers (IEEE 754)
Quick Revision
- 🎯 Objective: each digit is worth (digit) × (base) ➔ convert any direction between binary/decimal/hex + add binary by hand.
- 📦 Core Components: weights table (binary→dec) ➔ repeated division (dec→binary) ➔ 4-bits-per-hex-digit (binary↔hex).
- ⚡ Key Constraint: bits represent values ( to ) — the counting question examiners love.
📝 Core
- Positional notation ➔ ; same idea in base 2: .
- Binary → decimal ➔ write weights over the bits, add the weights under the 1s.
- Decimal → binary ➔ repeated division by 2, remainders read bottom-up (standard method for the A1 skill; slides teach the weights direction — drill both).
- Capacity ➔ bits ⟹ values: 3 bits → , 5 bits → , 8 bits → .
- Binary addition ➔ long addition with carries: (write 0 carry 1).
- Hex ➔ base 16, digits ; one hex digit = exactly 4 bits ➔ group binary in 4s from the right: .
⚖️ Core Decision Matrix
| Conversion | Method | Micro-example |
|---|---|---|
| binary → decimal | weights table, sum the 1-positions | |
| decimal → binary | ÷2, remainders bottom-up | () |
| binary → hex | group 4 bits from right → digit each | |
| hex → binary | each digit → 4 bits | |
| decimal ↔ hex | via binary (fastest by hand) |
📊 Exam Execution Trace
Manual Execution Trace — binary addition
| Step | Column () | Bits + carry | Write | Carry |
|---|---|---|---|---|
| 1 | ||||
| 2 | ||||
| 3 | ||||
| 4 | ||||
| Result: ✓ (). |
✍️ Practice
(a) Convert to binary and hex. (b) How many different values can 6 bits represent, and what is the largest? (c) Add .
Answer
- (a) (check: ).
- (b) values, largest .
- (c) ( ✓).
- Key move: always verify by converting back to decimal.
⚠️ Common Mistakes
- 💡 values vs largest value ➔ bits give values but the max is (zero occupies a slot).
- 💡 Group hex from the RIGHT ➔ padding goes on the left; grouping from the left mangles the number.
- 💡 Write the base subscript ➔ is ambiguous; — unlabeled bases lose marks.