Number Bases

Binary, octal, hexadecimal, and decimal. Converting between bases. Why binary is fundamental to computing.

41 lessons
166 min
Codeforces: 800-1200LeetCode: 1200-1500

Lessons

1. Intro

Why number bases matter

2m

2. What Is a Number Base?

Core concept

5m

3. Decimal System Review

Base-10 familiar ground

4m

4. Binary Fundamentals

Base-2 system

4m

5. Why Computers Use Binary

Physical limitations

5m

6. Binary to Decimal Conversion

Reading binary numbers

4m

7. Quiz: Binary Reading

Knowledge check

2m1 problems

8. Decimal to Binary Conversion

Writing binary numbers

5m

9. Powers of Two Reference

Memorize these

5m

10. Hexadecimal Fundamentals

Base-16 system

4m

11. Hexadecimal Digit Reference

Hex to decimal mapping

4m

12. Hex in Programming

Real-world usage

5m

13. Binary to Hex Conversion

Grouping by fours

5m

14. Quiz: Hex Conversion

Knowledge check

2m1 problems

15. Octal System

Base-8 basics

5m

16. Converting Between Any Bases

Universal method

5m

17. Binary Addition

Arithmetic in base-2

5m

18. Binary Subtraction

Borrowing in base-2

5m

19. Representing Negative Numbers

Sign magnitude approach

5m

20. Two's Complement

Standard for negatives

5m

21. Reading Two's Complement

Decoding negative values

5m

22. Quiz: Two's Complement

Knowledge check

2m1 problems

23. Problem - Number of 1 Bits

LeetCode 191

2m1 problems

24. Count Bits - Checking Each Bit

Shift and mask

5m

25. Count Bits - Brian Kernighan Trick

Flip rightmost 1

5m

26. Count Bits - Implementation

Pseudocode solution

5m1 problems

27. Problem - Reverse Bits

LeetCode 190

2m1 problems

28. Reverse Bits - Building the Result

Shift and accumulate

5m

29. Reverse Bits - Implementation

Pseudocode solution

5m1 problems

30. Bitwise Operations Reference

AND OR XOR NOT

5m

31. Quiz: Bitwise Operations

Knowledge check

2m1 problems

32. Common Bit Tricks

Useful patterns

5m

33. Problem - Power of Two

LeetCode 231

2m1 problems

34. Power of Two - The Bit Pattern

Single 1 bit

5m

35. Power of Two - Implementation

One-line check

4m1 problems

36. Problem - Add Binary

LeetCode 67

2m1 problems

37. Add Binary - Digit-by-Digit Addition

Managing carry

5m

38. Add Binary - Implementation

Pseudocode solution

5m1 problems

39. Base Conversion in Code

Built-in functions

5m

40. Lessons from Number Bases

summary

2m

41. Section Recap

What we learned

2m

Ready to start learning?

Access all 41 lessons with interactive content and progress tracking.