0% found this document useful (0 votes)
10 views8 pages

Unit 1 - Dfs

Uploaded by

fowmila j
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views8 pages

Unit 1 - Dfs

Uploaded by

fowmila j
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Unit 1: Number System and Arithmetic Circuits

📘 Syllabus Topics:
1. Number Systems and Binary Codes
2. Arithmetic Operations:
o Addition
o Subtraction
o Multiplication
o Division
o Floating Point Representation
o Complements (1’s, 2’s)
o BCD
o Excess-3
o Gray Code
3. Arithmetic Circuits:
o Half Adder
o Full Adder
o Half Subtractor
o Full Subtractor
o Parallel Binary Adder
4. Logic Gates:
o Basic Gates: AND, OR, NOT
o Universal Gates: NOR, NAND
o Exclusive Gates: XOR
[Class Begins – Interaction Style]
Today, we are starting one of the most important and interesting topics in digital electronics – Number Systems and
Binary Codes. Before we go deep into logic circuits and microprocessors, you should clearly understand how
computers represent numbers. So let’s begin from the basics. Please listen carefully and take notes!
Why We Use and Study Number Systems in Computer Science / Digital
Fundamentals
✅ 1. Computer Only Understands Binary
 Computers don’t understand human languages or our decimal numbers (0–9).
 Computers work using electric signals — ON (1) and OFF (0).
 So, all data (numbers, text, images) must be converted to binary.
🔍 Example:
If you write 5, the computer stores it as 101 in binary.
✅ 2. Bridge Between Human & Machine
 We use Decimal numbers.
 Computers use Binary.
➡️We study number systems to understand how to convert between them and communicate with
machines.
✅ 3. To Design Digital Systems
 Digital electronics (like calculators, watches, etc.) are built using binary circuits.
 Engineers must use binary, octal, and hexadecimal in hardware and software.
🔧 Example:
Memory addresses are shown in hexadecimal (base 16) to reduce length:- 11111111 (binary) = FF (hex)
✅ 4. Efficient Storage & Processing
 Binary saves space and speed.
 Some systems use Octal or Hexadecimal for compact representation.
💡 Why?-Instead of writing 8-digit binary, we can write 2-digit hex. Easy and fast.
✅ 5. Used in Digital Codes and Circuits
We use binary number systems in:
 Digital codes (BCD, Gray, Excess-3)
 Arithmetic circuits (adders, subtractors)
 Memory access and addressing
🌍 Where Used? (Table)
Number System Used For
Binary (2) All digital systems, logic circuits
Decimal (10) Human input/output
Octal (8) Compact codes in old systems
Hexadecimal (16) Memory addresses, debugging tools
“We study number systems to understand how computers represent and process data using binary. It helps in
designing circuits, writing programs, and communicating with machines efficiently.”

What is a Number System?


 A number system is a way to represent numbers using a set of symbols or digits.
Each number system has: A base (or radix), A set of valid digits
 A number system is a method to express numbers using digits or symbols.
Different systems use different bases.
System Base Digits Used
Decimal 10 0–9
Binary 2 0, 1
Octal 8 0–7
Hexadecimal 16 0–9 and A–F

Where are these Number Systems used?


📍 Decimal → In everyday life, money, shopping
📍 Binary → Inside CPUs, memory, microcontrollers
📍 Octal → In some microprocessors, compact binary
📍 Hexadecimal → Memory addresses, web colors, MAC IDs
🧠 Example:
 HTML color #FF0000 → Hex for red color
 RAM address like 0x3F2B → in hex!
Why do we use Binary in Computers?
Let’s think logically…🖥️A computer is just an electronic device, right?
It uses electrical pulses — current ON or OFF.
That means it can easily understand two states:
🔌 ON → 1
❌ OFF → 0 , So Binary (0 and 1) is perfect for computers. That’s why every number, text, image, video…
everything is stored as binary inside your PC or mobile. “So, to understand how a computer works, we must first
understand how it stores numbers!”
we often use different number systems. Unlike the usual numbers we see daily (like 1, 2, 3...), computers speak in
binary. Let's understand the 4 most common number systems: Decimal, Binary, Octal, and Hexadecimal."
Why do we study it?
Computers use binary numbers (0 and 1). To understand how data is stored,
processed, and calculated in computers, we must learn binary and other number
systems.
1. Decimal Number System (Base 10)
📌 Definition:
The Decimal system is the standard number system used in daily life. It is based on base 10 and uses ten digits:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9.
📌 Place Value Rule:
Each digit's value depends on its position (units, tens, hundreds, etc.) and is calculated using powers of 10.
📍 Example:
Convert 478 to its positional value:
478 = (4 × 10²) + (7 × 10¹) + (8 × 10⁰)
= (4 × 100) + (7 × 10) + (8 × 1)
= 400 + 70 + 8
= 478
✅ So, 478 in decimal = 478

2. Binary Number System (Base 2)


📌 Definition:
Binary system is a base-2 system that uses only two digits: 0 and 1.
Used in computers and digital circuits.
📌 Place Value Rule:
Each binary digit represents a power of 2, starting from the right.
📍 Example:
Convert 1011 (binary) to decimal:
1011 = (1 × 2³) + (0 × 2²) + (1 × 2¹) + (1 × 2⁰)
= (1 × 8) + (0 × 4) + (1 × 2) + (1 × 1)
= 8 + 0 + 2 + 1
= 11
✅ So, 1011 (binary) = 11 (decimal)

3. Octal Number System (Base 8)


📌 Definition:
Octal system is a base-8 system that uses digits from 0 to 7.
It was used in early computer systems as a shorthand for binary.
📌 Place Value Rule:
Each digit represents a power of 8 from right to left.
📍 Example:
Convert 157 (octal) to decimal:
157 = (1 × 8²) + (5 × 8¹) + (7 × 8⁰)
= (1 × 64) + (5 × 8) + (7 × 1)
= 64 + 40 + 7
= 111
✅ So, 157 (octal) = 111 (decimal)

🟨 4. Hexadecimal Number System (Base 16)


📌 Definition:
Hexadecimal is a base-16 system used in memory addresses, color coding, machine-level programming.
📌 Digits Used:
0–9 and A(10) to F(15)
📌 Place Value Rule:
Each digit represents a power of 16, from right to left.
📍 Example:
Convert 2F (hex) to decimal:
2F = (2 × 16¹) + (F × 16⁰)
= (2 × 16) + (15 × 1) [F = 15]
= 32 + 15
= 47
✅ So, 2F (hex) = 47 (decimal).

Why do we convert between Binary and Decimal?


🔹 1. Humans vs. Machines – Different Languages
Let’s imagine:
 Humans naturally use Decimal (base 10) — we count with 10 fingers!
 Computers, on the other hand, can only understand Binary (base 2) — just 0 and 1.
So we need to convert between decimal (for us) and binary (for computers) to communicate.
🔹 2. Decimal to Binary: For Input to Computers
When we give a number like 25 to a computer,
🧠 the machine internally converts it to binary → (11001)₂
✅ So we convert decimal to binary for machine processing.

🔹 3. Binary to Decimal: For Output to Humans


When a computer finishes some calculation, it produces a binary result.
But we don’t understand binary easily, right?
👉 So the computer converts binary like (1011)₂ to decimal 11, so that we can read it.

🔹 4. Binary is Efficient for Machines


In a computer, every value — even your name, photos, videos — is stored as binary because:
 Digital circuits understand two voltage levels:
✅ ON (1), ❌ OFF (0)
 Binary saves space and is faster to computer

🔹 5. Conversions help us Design Digital Circuits


If you’re building:
 A calculator
 A microprocessor
 A digital clock
 An embedded device
You’ll need to convert values to binary and work with them. So these conversions are essential for engineers and
programmers.
Decimal to Binary Conversion (Base 10 → Base 2)- "Decimal numbers are base-10. To
convert to binary (base-2), we divide by 2 again and again until the quotient is 0.
Then we write the remainders in reverse."
Convert 10₁₀ to Binary Convert 25₁₀ to Binary Convert 50₁₀ to Binary
Divide Step Divide by 2 Quotient Remainder Step Divide by 2 Quotient Remainder
Step Quotient Remainder
by 2 1 50 ÷ 2 25 0
1 25 ÷ 2 12 1
1 10 ÷ 2 5 0 2 12 ÷ 2 6 0 2 25 ÷ 2 12 1
2 5÷2 2 1 3 6÷2 3 0 3 12 ÷ 2 6 0
3 2÷2 1 0 4 3÷2 1 1 4 6÷2 3 0
4 1÷2 0 1 5 1÷2 0 1 5 3÷2 1 1
➡ Now write remainders in ➡️Reverse: 1 1 0 0 1 6 1÷2 0 1
reverse: ✅ Binary = 11001₂ ➡️Reverse: 1 1 0 0 1 0
🔁1 0 1 0 ✅ Binary = 110010₂
✅ Binary = 1010₂

Example 4: Convert 5₁₀ Example 5: Convert 64₁₀ Example 6: Convert 7₁₀


Divide by 2 QR Divide Q R ÷2 Q R
5÷2 2 1 64 ÷ 2 32 0
2÷2 1 0 32 ÷ 2 16 0 7÷2 3 1
1÷2 0 1 16 ÷ 2 8 0 3÷2 1 1
Remainders (reversed): 1 0 1 8÷2 4 0
✅ Binary = 101₂ 4÷2 2 0 1÷2 0 1
2÷2 1 0 🔁1 1 1
1÷2 0 1 ✅ Binary = 111₂
🔁 Reverse: 1 0 0 0 0 0 0
✅ Binary = 1000000₂
Example 7: Convert 31₁₀ Example 8: Convert 100₁₀ Example 9: Convert 255₁₀
÷2 Q R ÷2 Q R ÷2 Q R
31 ÷ 2 15 1 100 ÷ 2 50 0 255 ÷ 2 127 1
15 ÷ 2 7 1 50 ÷ 2 25 0 127 ÷ 2 63 1
7÷2 3 1 25 ÷ 2 12 1 63 ÷ 2 31 1
3÷2 1 1 12 ÷ 2 6 0 31 ÷ 2 15 1
1÷2 0 1 6÷2 3 0 15 ÷ 2 7 1
🔁11111
3÷2 1 1 7÷2 3 1
✅ Binary = 11111₂
1÷2 0 1 3÷2 1 1
Example 10: Convert 128₁₀ 🔁1100100 1÷2 0 1
1 0 0 0 0 0 0 0 ✅ Binary = 1100100₂ 🔁11111111
✅ Binary = 10000000₂ ✅ Binary = 11111111₂
Binary to Decimal Conversion
🧠 What is it?- Binary numbers are made up of only 0 and 1.
Decimal is our normal number system (0–9).
We convert binary → decimal using positional weight of 2 (powers of 2).
✅ Formula: Each digit is multiplied by 2 raised to the power of its position (from right
to left starting at 0).
Eg: 1️1010₂ 2️1111₂ 3️1001₂
1011₂ = 1×2³ + 0×2² + 1×2¹ + = 1×2³ + 1×2² + 1×2¹ + = 1×2³ + 0×2² + 0×2¹ +
= 1×2³ + 0×2² + 1×2¹ + 0×2⁰ 1×2⁰ 1×2⁰
1×2⁰ = 8 + 0 + 2 + 0 = 10 = 8 + 4 + 2 + 1 = 15 =8+0+0+1=9
= 8 + 0 + 2 + 1 = 11₁₀

4️1100₂ 5️0110₂ 6️0001₂ 7️1000₂


= 1×2³ + 1×2² + 0×2¹ + = 0×2³ + 1×2² + 1×2¹ + = 0×2³ + 0×2² + 0×2¹ + = 1×2³ + 0×2² + 0×2¹ +
0×2⁰ 0×2⁰ 1×2⁰ 0×2⁰
= 8 + 4 + 0 + 0 = 12 =0+4+2+0=6 =0+0+0+1=1 =8+0+0+0=8

8️0011₂ 9️0101₂ 🔟 1110₂ Binary: 11010₂


= 0×2³ + 0×2² + 1×2¹ + = 0×2³ + 1×2² + 0×2¹ + = 1×2³ + 1×2² + 1×2¹ + = 1×2⁴ + 1×2³ + 0×2² +
1×2⁰ 1×2⁰ 0×2⁰ 1×2¹ + 0×2⁰
=0+0+2+1=3 =0+4+0+1=5 = 8 + 4 + 2 + 0 = 14 = 16 + 8 + 0 + 2 + 0
= 26

3. Binary to Octal Conversion


👩‍🏫 Teacher Explanation:

🔹 What is Binary to Octal Conversion?


It is the process of converting a number from base 2 (binary) to base 8 (octal).

🔹 Why do we convert Binary to Octal?


Because:

 Binary numbers can be long and difficult to read.


 Octal is a shorthand for binary – 3 binary digits = 1 octal digit.
 It makes representation simpler, especially in electronics and memory addressing.

🔹 Where is it used?
In digital circuits, microprocessors, and computer memory organization where grouped binary values are used.

Steps to Convert Binary to Octal:

1️⃣ Group the binary digits from right to left into groups of 3 digits.
👉 Add extra 0s at the left if needed to make complete groups of 3.

2️⃣ Convert each group of 3 binary digits into its octal equivalent.

Binary to Octal Chart (3 bits = 1 digit):


0 1 2 3 4 5 6 7
000 001 010 011 100 101 110 111
Binary to Octal Conversion – Example: 101

🔹 Step 1: Group the binary digits into 3s from the right

Binary number: 101


Grouping (3 bits): 101

If there are fewer than 3 digits, no need to pad zeros unless for uniformity.

🔹 Step 2: Convert each group into octal (decimal)

Binary group: 101


= (1 × 2²) + (0 × 2¹) + (1 × 2⁰)
= 4 + 0 + 1
= 5✅ Answer: 5 (Octal)
Example 1: 101 🔹 Example 2: 1000 🔹 Example 3: 1101 🔹 Example 4: 101101
Step 1: Group = 101 Step 1: Add leading 0 → Step 1: Add leading 0 → 001 Step 1: Group → 101 101
Step 2: 001 000 101 Group 1: 101 → 4+0+1 = 5
= (1 × 2²) + (0 × 2¹) + (1 × Group 1: 000 → (0×4) + Group 1: 101 → (1×4) + Group 2: 101 → 4+0+1 = 5
2⁰) (0×2) + (0×1) = 0 (0×2) + (1×1) = 5 ✅ Octal: 55
= (1 × 4) + (0 × 2) + (1 × Group 2: 001 → (0×4) + Group 2: 001 → (0×4) +
1) (0×2) + (1×1) = 1 (0×2) + (1×1) = 1
=4+0+1 ✅ Octal: 10 ✅ Octal: 15
✅ Octal: 5

🔹 Example 5: 111000 🔹 Example 6: 1001101 🔹 Example 7: 11111111 🔹 Example 8: 1000001

Step 1: Group → 111 000 Step 1: Add leading 0 → Step 1: Add leading 0 → 011 Step 1: Add leading 0 → 001
Group 1: 000 → 0 001 001 101 111 111 000 001
Group 2: 111 → 4+2+1 = 101 → 4+0+1 =5 111 → 4+2+1 =7 001 → 0+0+1 =1
7 001 → 0+0+1 =1 111 → 4+2+1 =7 000 → 0
✅ Octal: 70 001 → 0+0+1 =1 011 → 0+2+1 =3 001 → 0+0+1 =1
✅ Octal: 115 ✅ Octal: 377 ✅ Octal: 101

🔹 Example 9: 101011011 🔹 Example 10: Example 11 🔸 Example 12


Step 1: Group → 101 011 110110011 Binary: 1100101 Binary: 1011110
011 👉 Step 1: Group from right 👉 Step 1: Group from right
Step 1: Group → 110 110 into 3-bits:
011 → 0+2+1 = 3 011 into 3-bits:
001 100 101 010 111 110
011 → 0+2+1 = 3 011 → 0+2+1 = 3 👉 Step 2: Convert each 👉 Step 2: Convert each
101 → 4+0+1 = 5 110 → 4+2+0 = 6 group using positional group using positional
✅ Octal: 533 110 → 4+2+0 = 6 weights: weights:
✅ Octal: 663 001 → (0×2²) + (0×2¹) +
(1×2⁰) = 0 + 0 + 1 = 1
010 → (0×2²) + (1×2¹) +
100 → (1×2²) + (0×2¹) + (0×2⁰) = 0 + 2 + 0 = 2
(0×2⁰) = 4 + 0 + 0 = 4 111 → (1×2²) + (1×2¹) +
101 → (1×2²) + (0×2¹) + (1×2⁰) = 4 + 2 + 1 = 7
(1×2⁰) = 4 + 0 + 1 = 5 110 → (1×2²) + (1×2¹) +
✅ Octal: 145 (0×2⁰) = 4 + 2 + 0 = 6
✅ Octal: 276
🌟 Memory Tip:
🧠 "From Right → Group 3 digits → Convert using 4-2-1 rule → Write octal digit"

You might also like