Fundamentals of Digital, Analog Electronics, Measurement and Electrical Safety (10hrs) · Basics of Electrical & Electronics Engineering

basic number operations

Watch lectures

basic number operations

1. What Basic Operations Are (beyond addition)

For binary/octal/hex, the four operations are addition, subtraction, multiplication, division — but exam focuses on binary addition/subtraction (already covered addition, now subtraction via complements, multiplication as repeated addition, division as repeated subtraction). This topic is the complement to binary addition.

2. Binary Subtraction — Two Methods

A. Direct binary subtraction (borrow): like decimal but borrow is 2.

0-0=0, 1-0=1, 1-1=0, 0-1=1 borrow 1 (borrow makes 10₂=2, 2-1=1)
Example: 1010 -0111: LSB 0-1 needs borrow: 10-1=1 borrow1, next 1-1- borrow? Actually 1-1-1borrow? Let's do 1010-0111=0011? 10-7=3=0011 ✓

B. Via complements (preferred for hardware): use 1's and 2's complement (covered in signed representation topics).

  • 1's complement subtraction: A−B=A+(Bˉ)A - B = A + (\bar{B}), with end-around carry (add carry back).
  • 2's complement subtraction (standard):
A−B=A+(−B)2′sA - B = A + (-B)_{2's}

where

(−B)2′s=Bˉ+1(-B)_{2's}= \bar{B}+1

, discard final carry if any. This is how ALU does subtraction.

For octal/hex, subtraction similar but borrow is 8/16.

3. Multiplication / Division (brief)

  • Multiplication: shift-and-add:
1011×101=1011⋅1+1011⋅00⋅2+1011⋅1⋅41011 ×101 =1011·1 +1011·00·2 +1011·1·4

etc.

  • Division: repeated subtraction / shift.

Example:

1011×102(3×2)=101102(6)1011×10₂ (3×2) =10110₂ (6)

shift left one.

4. Worked Examples

(a) Binary subtraction 1011 -0101 (11-5=6=0110): 1011-0101=0110 ✓
    Direct: 1-1=0,1-0=1,0-1 borrow ⇒10-1=1? Actually step: LSB 1-1=0, next 1-0=1, next 0-1 borrow 1 ⇒1, next 1-0- borrow? 1-0-1borrowed? 0 ⇒0 ⇒0110 ✓

(b) Using 2's complement 4-bit: 1011-0101 =1011 +1011 (2's of 0101 is 1011) =1011+1011=10110 discard carry ⇒0110 ✓

(c) Octal subtraction 17₈ -07₈ =10₈ (15-7=8=10₈) ✓

(d) Hex: 1A -0F =0B? 26-15=11=0B₁₆ ✓

5. Exam Points

  • Show subtraction via borrow and via 2's complement — 5-7 marks, very frequent (often ask to subtract using 2's complement).
  • Mention multiplication as shift-and-add — 3-5 marks, frequent.
  • Give octal/hex subtraction example — 3-5 marks, frequent.
AI LearningWeb Platform

Coursify — Personal AI Course Generator

Struggling with a difficult subject or concept? Turn any engineering topic into a structured course with interactive lessons, quizzes, and research-backed explanations.

← All Basics of Electrical & Electronics Engineering modules