Number Systems PDF
Document Details
Uploaded by ConsiderateSeattle
Amity University Chhattisgarh
Tags
Summary
This document provides a comprehensive guide to number systems, including the decimal, binary, octal, and hexadecimal systems. It explains the conversion methods among these systems, with examples and tables.
Full Transcript
NUMBER SYSTEMS UNIT-1 DIGITAL Logic and Applications Number Systems A number system is a code that uses symbols to count the number of items. Radix or Base: The number of digits or basic symbols used in that number system. For Example, Radix or Base of Decimal number system is...
NUMBER SYSTEMS UNIT-1 DIGITAL Logic and Applications Number Systems A number system is a code that uses symbols to count the number of items. Radix or Base: The number of digits or basic symbols used in that number system. For Example, Radix or Base of Decimal number system is 10 as It uses 10 distinct digits (0,1,2,3….8,9) Different Number Systems System Name Symbols Radix or Base Decimal 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 10 Binary 0, 1 2 Octal 0, 1, 2, 3, 4, 5, 6, 7 8 Hexadecimal 0, 1, 2, 3, 4, 5, 6, 7, 8,9, A, B, C, D, E, F 16 Decimal Number System ▪ 10 digits can be combined in various ways to represent any number. ▪ Base 10 ▪ In a decimal number, each place represents a different multiple of 10. ▪ These multiples are also called as weighted values or positional weights. ▪ Positional or weighted number system. ……. 10 3 10 1 10 0 10 -1 10 -2 10 -3 …….. 2. 10 Decimal Point Decimal Number System ▪ LSD (Least Significant Digit) The digit at the extreme right with the lowest weight. ▪ MSD (Most Significant Digit) The digit at the extreme left with the highest weight. For the decimal number 642, 2 is the LSD and 6 is the MSD Binary Number System BINARY NUMBER SYSTEM Uses only two digits namely 0 and 1 Base or radix is 2 Like Decimal, Positional or weighted number system. Each place is multiple of 2 MSB(Most Significant Bit)- Leftmost Bit with highest weight. LSB(Least Significant Bit)- Rightmost Bit with lowest weight. DECIMAL EQUIVALENT BINARY NUMBER 0 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001 10 1010 11 1011 12 1100 13 1101 14 1110 15 1111 ▪ Bit : Single digit in a binary number. ▪ Nibble : A group of 4 bits are referred to as Nibble ▪ Byte : A group of 8 bits or 2 nibbles are referred to as Byte. Few terms in Binary ▪ Word: A of group 16 bits or 2 bytes or 4 nibbles are referred to as word ▪ Double Word: A group of 32 bits or 2 words or 4 Bytes or 8 Nibbles is referred to as Double Word. REPRESENTATION TERM BIT 1 OR 0 NIBBLE 1010 BYTE 1101 1001 WORD 0101 1100 0110 1011 DOUBLE 1101 0100 111011011 0001 1100 0111 0011 WORD Decimal to Binary Conversion (Double Dabble Method) Example: Convert Decimal (29)10 to equivalent binary. DIVISION QUOTIENT REMAINDER (LSB) 29 ÷ 2 14 1 14 ÷ 2 7 0 7 ÷ 2 3 1 BOTTOM to TOP 3 ÷ 2 1 1 1 ÷ 2 0 1 (MSB) ANSWER: (29)10 = (1 1 1 0 1)2 Decimal to Binary Conversion (Double Dabble Method) Example: Convert (0.61)10 to equivalent binary fraction. Decimal fraction Base Answer Recorded Bit (MSB) 0.61 X 2 = 1.22 1 0.22 X 2 = 0.44 0 0.44 X 2 = 0.88 0 TOP to BOTTOM 0.88 X 2 = 1.76 1 0.76 X 2 = 1.52 1 (LSB) ANSWER: (0.61)10 = (0. 1 0 0 1 1)2 Decimal to Binary Conversion EXAMPLE: Convert (43.85)10 to equivalent binary Binary to Decimal Conversion ❑ Given Binary number is converted into equivalent decimal number as follows: STEP 1: Write down Binary number. STEP 2: Write the positional weights beneath each bit. STEP 3: Strike off weights corresponding to zero in the binary number. STEP 4: Add the remaining weights to get decimal equivalent. Binary to Decimal Conversion Convert (1010)2 to equivalent Decimal. 1 0 1 0 Binary Number 23 22 21 20 Positional weight 8 + 0 + 2 + 0 Add all weights together Binary to Decimal Conversion Convert ( 1 1 0 0 1 0 1 1. 0 1 1 1 0)2 to equivalent Decimal. OCTAL NUMBER SYSTEM Important features of Octal Number System ▪ The Base used for Octal Number system is 8 ▪ Only 0, 1, 2, 3, 4, 5, 6 ,7 digits are used. ▪ Positional or weighted Number System Decimal to Octal Conversion (octal Dabble Method) ❑ Steps to convert Decimal number (Integer part) into equivalent octal. STEP 1: Divide the integer part of decimal number by 8 and note down quotient and remainder. STEP 2: Continue to divide the quotient by 8 till you get result (quotient) equal to zero. STEP 3: Write the remainder values in reverse order from the bottom to top to find the equivalent binary number. Decimal to octal Conversion (octal Dabble Conversion) EXAMPLE : Convert (2552)10 to its equivalent octal form. DIVISION QUOTIENT REMAINDER (LSD) 2552 ÷ 8 319 0 319 ÷ 8 39 7 BOTTOM to TOP 39 ÷ 8 4 7 4 ÷ 8 0 4 (MSD) ANSWER: (2552)10 = (4 7 7 0 )8 Decimal to octal Conversion (octal Dabble Method) ❑ Steps to convert Decimal number (Fractional part) into equivalent binary STEP 1: Multiply the given fractional decimal number repeatedly by 8 STEP 2: Record (from the answer occurred in step 1) the number which is just before decimal point. STEP 3: Continue the process till the fractional part is zero or enough bits have been formed. Decimal to Octal Conversion (Octal Dabble Conversion) Example: Convert (0.32)10 to equivalent octal fraction. Decimal fraction Base Answer Recorded Digit (MSD) 0.32 X 8 = 2.56 2 TOP to BOTTOM 0.56 X 8 = 4.48 4 0.48 X 8 = 3.84 3 0.84 X 8 = 6.72 6 (LSD) ANSWER: (0.32)10 = (0. 2 4 3 6)8 Octal to Decimal Conversion Steps to be followed: Step 1: Write down the given number. Step 2: Write down the weights corresponding to different positions. Step 3: Multiply each digit in the given number with the corresponding weight to obtain product numbers. octal to Decimal Conversion Convert (7 4 6)8 to equivalent Decimal. 7 4 6 Octal Number 82 81 80 Positional weight ( 7x 8 2 ) + (4 x 8 1 ) + ( 6 x 8 0 ) Add all weights together (7 x 64) + (4 x 8) + (6 x 1) Answer: 448 + 32 +6 (7 4 6 )8 = (4 8 6 )10 octal to binary Conversion Octal Number Equivalent Binary 0 000 1 001 2 010 3 011 4 100 5 101 6 110 7 111 hex NUMBER SYSTEM Hexadecimal number system has a base of 16 It has 16 possible digits.( 0 through 9 and A through F) Alphanumeric number system. Positional or weighted number system. Decimal to hex Conversion (hex Dabble Method) ❑ Steps to convert Decimal number (Integer part) into equivalent Hex STEP 1: Divide the integer part of decimal number by 16 and note down Quotient and Remainder. STEP 2: Continue to divide the quotient by 16 till you get result (quotient) equal to zero. STEP 3: Write the remainder values in reverse order from the bottom (this Digit becomes MSD) to top (this Digit becomes LSD) to find the equivalent Hex number. Decimal to HEX Conversion (HEX Dabble Conversion) EXAMPLE : Convert (1023)10 to its equivalent Hex form. DIVISION QUOTIENT REMAINDER (LSD) 1023 ÷ 16 63 15 (F) 63 ÷ 16 3 15 (F) BOTTOM to TOP 3 ÷ 16 0 3 (MSD) ANSWER: (1023)10 = (3FF )16 Decimal to hex Conversion (hex Dabble Method) ❑ Steps to convert Decimal number (Fractional part) into equivalent Hex STEP 1: Multiply the given fractional decimal number repeatedly by 16 STEP 2: Record (from the answer occurred in step 1) the number which is just before decimal point. STEP 3: Continue the process till the fractional part is zero or enough bits have been formed. Decimal to hex Conversion (Octal Dabble Conversion) Example: Convert (0.245)10 to equivalent Hex fraction. Decimal fraction Base Answer Recorded Digit (MSD) 0.245 X 16 = 3.920 3 TOP to BOTTOM 0.920 X 16 = 14.720 14 (E) 0.720 X 16 = 11.520 11 (B) 0.520 X 16 = 8.320 8 (LSD) ANSWER: (0.245)10 = (0. 3 E B 8)16 DECIMAL NUMBER BINARY OCTAL HEXADECIMAL 0 0000 0 0 1 0001 1 1 2 0010 2 2 3 0011 3 3 4 0100 4 4 5 0101 5 5 6 0110 6 6 7 0111 7 7 8 1000 10 8 9 1001 11 9 10 1010 12 A 11 1011 13 B 12 1100 14 C 13 1101 15 D 14 1110 16 E 15 1111 17 F hex to Decimal Conversion Steps to be followed: Step 1: Write down the given HEX number. Step 2: Write down the weights corresponding to different positions. Step 3: Multiply each digit in the given number with the corresponding weight to obtain product numbers. Step 4: Add all the product numbers to get decimal