We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 31
Introduction to Computer
and Information Basics
Number systems – part 1 Number systems • Number systems are methods for expressing numbers using a consistent set of symbols and rules. They form the basis for mathematical calculations and various applications in computer science, engineering, and everyday life. Here are some common number systems. Decimal • 1. Decimal (Base 10) Digits Used: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Description: The most widely used number system, based on powers of 10. Each position represents a power of 10. Binary • 2. Binary (Base 2) Digits Used: 0, 1 Description: Used primarily in computing and digital electronics. Each position represents a power of 2. Octal • 3. Octal (Base 8) Digits Used: 0, 1, 2, 3, 4, 5, 6, 7 Description: Sometimes used in computing as a shorthand for binary. Each position represents a power of 8. Hexadecimal • 4. Hexadecimal (Base 16) Digits Used: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Description: Commonly used in programming and computing because it can represent binary data more compactly. Each position represents a power of 16. Converting between number systems • Converting between number systems involves understanding the base of each system and applying specific methods for conversion. Here’s a guide on how to convert between some common number systems Decimal to Binary • Decimal to Binary Method: Repeated Division by 2 1.Divide the decimal number by 2. 2.Record the remainder (0 or 1). 3.Divide the quotient by 2 and repeat until the quotient is 0. 4.The binary number is the remainders read in reverse order. Decimal to Binary • Example 1 : Convert 13 to binary 13 ÷ 2 = 6, remainder 1 6 ÷ 2 = 3, remainder 0 3 ÷ 2 = 1, remainder 1 1 ÷ 2 = 0, remainder 1 • Binary: 1101 Decimal to Binary • Example 2 : Convert 20 to binary • Example 3 : Convert 16 to binary • Example 4 : Convert 30 to binary • Example 5 : Convert 120 to binary • Example 6 : Convert 12 to binary • Example 7 : Convert 10 to binary Binary to Decimal • Method: Weighted Sum 1.Write down the binary number. 2.Assign powers of 2 to each digit from right to left. 3.Multiply each digit by its corresponding power of 2. 4.Sum all the results. Binary to Decimal • Example: Convert 1101 to decimal 1×23 + 1×22 + 0×21 +1×20 1×8 + 1×4 + 0×2 + 1×1=8+4+0+1=13 Binary to Decimal • Example 2 : Convert 1001 to decimal • Example 3 : Convert 1111 to decimal • Example 4 : Convert 1100 to decimal • Example 5 : Convert 0011 to decimal • Example 6 : Convert 1110 to decimal • Example 7 : Convert 0001 to decimal Decimal to Hexadecimal • Decimal to Hexadecimal Method: Repeated Division by 16 1.Divide the decimal number by 16. 2.Record the remainder (0-15). 3.Divide the quotient by 16 and repeat until the quotient is 0. 4.Convert remainders greater than 9 to their hexadecimal equivalents (A-F). Decimal to Hexadecimal • Example 1 : Convert 254 to hexadecimal 254 ÷ 16 = 15, remainder 14 (E) 15 ÷ 16 = 0, remainder 15 (F) Hexadecimal: FE Decimal to Hexadecimal • Example 2 : Convert 128 to hexadecimal • Example 3 : Convert 64 to hexadecimal • Example 4 : Convert 32 to hexadecimal • Example 5 : Convert 16 to hexadecimal • Example 6 : Convert 1024 to hexadecimal • Example 7 : Convert 256 to hexadecimal Hexadecimal to Decimal • Hexadecimal to Decimal Method: Weighted Sum 1.Write down the hexadecimal number. 2.Assign powers of 16 to each digit from right to left. 3.Multiply each digit by its corresponding power of 16. 4.Sum all the results. Hexadecimal to Decimal • Example 1 : Convert 2F to decimal • 2×161 + F×160 (where F = 15) • 2×16 + 15×1 = 32 + 15 = 47 Hexadecimal to Decimal • Example 2 : Convert 2A to decimal • Example 3 : Convert 5F to decimal • Example 4 : Convert 4B to decimal • Example 5 : Convert 2F to decimal • Example 6 : Convert 5C to decimal • Example 7 : Convert 6D to decimal Decimal to Octal • Decimal to octal Method: Repeated Division by 8 1.Divide the decimal number by 8. 2.Record the remainder (0-7). 3.Divide the quotient by 8 and repeat until the quotient is 0. Decimal to Octal • Example 1 : Convert 254 to octal 254 ÷ 8 = 31, remainder 6 31 ÷ 8 = 3, remainder 7 3 ÷ 8= 0, remainder 3 Octal: 376 Decimal to Octal • Example 2 : Convert 128 to Octal • Example 3 : Convert 64 to Octal • Example 4 : Convert 32 to Octal • Example 5 : Convert 16 to Octal • Example 6 : Convert 1024 to Octal • Example 7 : Convert 256 to Octal Octal to Decimal • Octal to Decimal Method: Weighted Sum 1.Write down the Octal number. 2.Assign powers of 8 to each digit from right to left. 3.Multiply each digit by its corresponding power of 8. 4.Sum all the results. Octal to Decimal • Example 1 : Convert 26 to decimal • 2×81 + 6×80 • 2×8 + 6×1 = 32 + 15 = 22 Octal to Decimal • Example 2 : Convert 25 to decimal • Example 3 : Convert 57 to decimal • Example 4 : Convert 43 to decimal • Example 5 : Convert 21 to decimal • Example 6 : Convert 53 to decimal • Example 7 : Convert 66 to decimal Binary to Hexadecimal • Binary to Hexadecimal Method: Grouping 1.Start from the right and group binary digits into sets of 4 (add leading zeros if necessary). 2.Convert each group to its hexadecimal equivalent. Binary to Hexadecimal • Example 1 : Convert 11010101 to hexadecimal Group: 1101 0101 Convert: D (for 1101) and 5 (for 0101) Hexadecimal: D5 Binary to Hexadecimal • Example 2 : Convert 11110000 to hexadecimal • Example 3 : Convert 00010101 to hexadecimal • Example 4 : Convert 11000101 to hexadecimal • Example 5 : Convert 11010001 to hexadecimal • Example 6 : Convert 01010100 to hexadecimal • Example 7 : Convert 11110001 to hexadecimal Hexadecimal to Binary • Hexadecimal to Binary Method: Direct Conversion Convert each hexadecimal digit to its 4-bit binary equivalent. Hexadecimal to Binary • Example 1 : Convert A3 to binary A = 1010, 3 = 0011 Binary: 10100011 Hexadecimal to Binary • Example 2 : Convert 3F to binary • Example 3 : Convert 4C to binary • Example 4 : Convert F5 to binary • Example 5 : Convert A2 to binary • Example 6 : Convert 9D to binary • Example 7 : Convert 02A to binary