These notes (handout SN-2) cover number systems and Boolean algebra, two of the first topics in BSCS courses such as Digital Logic Design, Computer Organization and Discrete Structures. Below is a short study guide to the main ideas in the notes, with worked examples.
What is a number system?
A number system is a way of writing numbers using a fixed set of digits. The number of digits it uses is called its base (or radix). Computers store everything in binary, but programmers also use octal and hexadecimal because they are shorter ways of writing binary values.
| System | Base | Digits used | Example |
|---|---|---|---|
| Binary | 2 | 0, 1 | 1011012 |
| Octal | 8 | 0 to 7 | 558 |
| Decimal | 10 | 0 to 9 | 4510 |
| Hexadecimal | 16 | 0 to 9 and A to F (A = 10 … F = 15) | 2D16 |
All four examples in the table are the same value, forty-five.
Converting decimal to another base
Divide the decimal number by the target base again and again, writing down each remainder. Read the remainders from the last one to the first: the last remainder is the most significant digit (MSB) and the first is the least significant digit (LSB).
Example: 45 to binary. 45 ÷ 2 = 22 r 1; 22 ÷ 2 = 11 r 0; 11 ÷ 2 = 5 r 1; 5 ÷ 2 = 2 r 1; 2 ÷ 2 = 1 r 0; 1 ÷ 2 = 0 r 1. Reading upwards gives 1011012.
Example: 45 to hexadecimal. 45 ÷ 16 = 2 r 13 (D); 2 ÷ 16 = 0 r 2. Reading upwards gives 2D16.
Converting another base to decimal
Multiply each digit by the base raised to its position (counting from 0 at the right), then add the results.
- 1011012 = 1×32 + 0×16 + 1×8 + 1×4 + 0×2 + 1×1 = 45
- 558 = 5×8 + 5×1 = 45
- 2D16 = 2×16 + 13×1 = 45
Shortcut: binary to octal and hexadecimal
Because 8 = 23 and 16 = 24, you can group binary digits from the right: groups of three for octal and groups of four for hexadecimal.
- 101 101 → 5 5 → 558
- 0010 1101 → 2 D → 2D16
Boolean algebra basics
Boolean algebra works with variables that have only two values, 0 (false) and 1 (true). Its three basic operations are AND (written A·B), OR (A + B) and NOT (A′). Each operation matches a logic gate, which is why Boolean algebra is used to design and simplify digital circuits.
| A | B | A·B (AND) | A + B (OR) | A′ (NOT A) |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 |
Important laws
| Law | AND form | OR form |
|---|---|---|
| Identity | A·1 = A | A + 0 = A |
| Null | A·0 = 0 | A + 1 = 1 |
| Idempotent | A·A = A | A + A = A |
| Complement | A·A′ = 0 | A + A′ = 1 |
| Absorption | A·(A + B) = A | A + A·B = A |
| De Morgan | (A·B)′ = A′ + B′ | (A + B)′ = A′·B′ |
Example of simplification: A·B + A·B′ = A·(B + B′) = A·1 = A. The circuit for the left side needs two AND gates, an OR gate and a NOT gate; the simplified form needs no gates at all.
How to study these notes
- Practise conversions in both directions until you can do them without a calculator.
- Check every answer by converting it back to decimal.
- Learn the Boolean laws in pairs (AND form and OR form); most simplification questions use them.
- Draw the truth table whenever you are unsure whether two expressions are equal.
Frequently asked questions
What is the base of the hexadecimal number system?
16. It uses the digits 0 to 9 and the letters A to F, where A = 10 and F = 15.
What does De Morgan's law say?
The complement of an AND is the OR of the complements, (A·B)′ = A′ + B′, and the complement of an OR is the AND of the complements, (A + B)′ = A′·B′.
Related Books
- Discrete Structures US-3 Notes for BSCS (Computer Science)
- Discrete Structures US-6 Notes for BSCS (Computer Science)
- Database Management System Overview and Chapter Guide – BSCS University
- Object Oriented Programming Using C++ Overview and Chapter Guide – IT Series BSCS
- Key Book to OOP C++ Programming Exercises Overview and Chapter Guide – IT Series BSCS
- The Concepts of Information Technology Overview and Chapter Guide – IT Series (2nd Edition)
© Copyright Policy
Freebooks.pk is an educational resource for students in Pakistan. Textbooks and other books belong to their respective boards, authors and publishers, and all rights remain with them. If you are the copyright holder of any material on this page and want it changed or removed, please contact us or file a request under our DMCA policy. We review every request and remove reported content promptly.
Urdu Medium 9th class and 10th class book
please send me links on
[email protected]
Sana ullah ki organic chemistry upload kar do plz