0% found this document useful (0 votes)
26 views

Lecture On Binary in Computer Studies

Module for Major 15

Uploaded by

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

Lecture On Binary in Computer Studies

Module for Major 15

Uploaded by

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

Lecture on Binary in Computer Studies

Introduction: Binary is the fundamental building block of computer systems. It is the language
computers use to process and store data. Understanding binary is crucial for anyone studying
computer science or working in the field of technology.

Learning Objectives:

• Understand the binary number system and how it differs from the decimal system.
• Learn how to convert between binary and decimal.
• Explore the representation of data in binary, including numbers, text, and images.
• Apply binary arithmetic to perform basic operations like addition, subtraction,
multiplication, and division.

1. What is Binary?

Binary Number System:

• The binary number system is a base-2 numeral system.


• It uses only two symbols: 0 and 1.
• Each digit in a binary number is called a bit (binary digit).

Comparison with Decimal System:

• The decimal system is base-10, using digits from 0 to 9.


• Binary, being base-2, has a simpler structure but can represent all the same values.

Example:

• Decimal number 5 is represented in binary as 101.


• Decimal number 10 is represented in binary as 1010.

2. Binary to Decimal Conversion

Step-by-Step Conversion:

• To convert a binary number to decimal, multiply each bit by 2 raised to the power of its
position, starting from 0 on the right.

Example:
• Convert binary 1101 to decimal.

• So, binary 1101 equals decimal 13.

Practice:

1. Convert 1010 (binary) to decimal.


2. Convert 1110 (binary) to decimal.

3. Decimal to Binary Conversion

Step-by-Step Conversion:

• To convert a decimal number to binary, divide the number by 2, record the remainder,
and repeat with the quotient until the quotient is 0. The binary number is the sequence of
remainders read in reverse order.

Example:

• Convert decimal 14 to binary.


o 14 ÷ 2 = 7, remainder = 0
o 7 ÷ 2 = 3, remainder = 1
o 3 ÷ 2 = 1, remainder = 1
o 1 ÷ 2 = 0, remainder = 1

The binary representation of 14 is 1110.

Practice:

1. Convert 20 (decimal) to binary.


2. Convert 25 (decimal) to binary.

4. Binary Arithmetic

Addition:

• Binary addition follows these rules:


o 0+0=0
o 0+1=1
o 1+0=1
o 1 + 1 = 10 (which means 0, carry 1)

Example:

• Add binary 1011 and 1101.

diff
Copy code
1011
+ 1101
---------
11000

Subtraction:

• Binary subtraction uses the borrow method, similar to decimal subtraction.

Example:

• Subtract 101 from 1101.

yaml
Copy code
1101
- 0101
---------
1000

Practice:

1. Add 1101 and 0110.


2. Subtract 1001 from 1100.

5. Representing Data in Binary

Text:

• Computers represent text using binary codes like ASCII or Unicode.


• For example, the ASCII code for A is 65, which is 01000001 in binary.

Images:
• Images are represented as binary data, with each pixel's color and intensity stored as a
binary value.

Practice:

1. Convert the letter B to its ASCII binary representation.


2. If a grayscale image pixel is represented by the binary value 11000000, what is its
decimal equivalent?

6. Advanced Concepts

Binary Multiplication and Division:

• Similar to decimal operations but simpler due to fewer digits (0 and 1).
• Multiplication: Align the numbers and multiply as in decimal, but remember that
anything multiplied by 1 is itself, and by 0 is 0.
• Division: Follows the same rules as decimal division.

Example:

• Multiply 101 by 11.

Practice:

1. Multiply 1010 by 110.


2. Divide 1110 by 10.

7. Applications of Binary

In Computing:

• Binary is used in everything from machine code instructions to data storage (e.g., in hard
drives).
• It is the backbone of all computer operations.

In Communication:

• Binary is used in encoding data for communication protocols, ensuring that digital data
can be transmitted and received accurately.

Practice:
1. Explore how binary is used in error detection and correction techniques like parity bits.
2. Research the role of binary in modern encryption methods.

Conclusion: Understanding binary is essential for grasping how computers operate at their most
fundamental level. From representing simple numbers to complex data structures, binary is the
language of computers. Mastery of this concept is foundational for anyone pursuing a career in
computing or technology.

Further Reading and Practice:

• "The Art of Computer Programming" by Donald Knuth (focus on binary arithmetic).


• Online binary conversion and arithmetic exercises.

You might also like