Number System & Boolean Algebra SN-2 Notes

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.

SystemBaseDigits usedExample
Binary20, 11011012
Octal80 to 7558
Decimal100 to 94510
Hexadecimal160 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.

ABA·B (AND)A + B (OR)A′ (NOT A)
00001
01011
10010
11110

Important laws

LawAND formOR form
IdentityA·1 = AA + 0 = A
NullA·0 = 0A + 1 = 1
IdempotentA·A = AA + A = A
ComplementA·A′ = 0A + A′ = 1
AbsorptionA·(A + B) = AA + 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

2 thoughts on “Number System & Boolean Algebra SN-2 Notes”

Leave a Comment