Master the language of computers with 9th Class Computer Science Chapter 2 Number Systems notes. Learn to convert between Binary, Decimal, Octal, and Hexadecimal systems.
2MB • 14 Pages
Computers process and store data using electrical signals. To represent information, computers use a binary system that consists of only two digits: 0 and 1. These are called bits (binary digits).
Electronic components like transistors can exist in two states:
All data in computers—numbers, text, images, audio, video—is ultimately represented as a series of 0s and 1s. A group of 8 bits is called a byte, which is the basic unit of storage in computers.
A number system is a mathematical notation for representing numbers using digits or symbols in a consistent manner. In computer science, four number systems are commonly used:
Each system has a specific base (or radix), which determines how many unique digits are available.
The decimal system is the number system we use in everyday life. It has a base of 10, meaning it uses 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.
Positional Value: Each digit's position represents a power of 10:
Example: The decimal number 2547 can be expressed as:
$2547 = (2 × 10^3) + (5 × 10^2) + (4 × 10^1) + (7 × 10^0)$
$= 2000 + 500 + 40 + 7 = 2547$
The binary system is the fundamental number system used in computers. It has a base of 2, using only two digits: 0 and 1.
Positional Value: Each digit position represents a power of 2:
Example: The binary number $1011_2$ converted to decimal:
$1011_2 = (1 × 2^3) + (0 × 2^2) + (1 × 2^1) + (1 × 2^0)$
$= 8 + 0 + 2 + 1 = 11_{10}$
Binary is essential because digital circuits can easily represent two states (ON/OFF), making it ideal for computer hardware.
The octal system uses base 8, with eight digits: 0, 1, 2, 3, 4, 5, 6, 7. It was commonly used in early computing systems as a shorthand for binary.
Positional Value: Each position represents a power of 8:
Example: The octal number $157_8$ converted to decimal:
$157_8 = (1 × 8^2) + (5 × 8^1) + (7 × 8^0)$
$= 64 + 40 + 7 = 111_{10}$
Octal is useful because three binary digits can be represented by one octal digit, making binary numbers easier to read.
The hexadecimal system uses base 16, with sixteen symbols: 0-9 and A-F. The letters represent:
Positional Value: Each position represents a power of 16:
Example: The hexadecimal number $2A3F_{16}$ converted to decimal:
$2A3F_{16} = (2 × 16^3) + (10 × 16^2) + (3 × 16^1) + (15 × 16^0)$
$= 8192 + 2560 + 48 + 15 = 10815_{10}$
Hexadecimal is widely used in computing for representing memory addresses, color codes, and machine code because four binary digits equal one hexadecimal digit.
Converting between number systems is an essential skill in computer science. The most common conversions are:
Example - Decimal 25 to Binary:
25 ÷ 2 = 12 remainder 1
12 ÷ 2 = 6 remainder 0
6 ÷ 2 = 3 remainder 0
3 ÷ 2 = 1 remainder 1
1 ÷ 2 = 0 remainder 1
Reading remainders from bottom to top: $25_{10} = 11001_2$
Binary addition follows four basic rules:
Example: Add $1011_2 + 1101_2$
1 1 (carries) 1011 + 1101 ------ 11000
Result: $11000_2$ (which equals $24_{10}$)
Binary subtraction follows these rules:
Example: Subtract $1101_2 - 1010_2$
1101 - 1010 ------ 0011
Result: $0011_2 = 3_{10}$
When borrowing is needed, take 1 from the next position (which represents 2 in binary), similar to borrowing 10 in decimal subtraction.
Computers need to represent text characters as numbers. Two major encoding systems are:
ASCII (American Standard Code for Information Interchange):
Unicode:
Unicode has become the global standard for text representation in modern computing systems.