Chapter 2 Number System.

Slides:



Advertisements
Similar presentations
NUMBER SYSTEM. How to convert hexadecimal numbers to decimal numbers? 230 Working from right to left, MULTIPLY each position with 8 raised to the power.
Advertisements

Number SystemsNumber Systems Modified By: AM. Sihan (Hardware Engineering)
Chapter 2 Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in.
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
Chapter 02 Binary Values and Number Systems Nell Dale & John Lewis.
Prepared By Rama Gaikwad 1. Number Systems. Common Number Systems SystemBaseSymbols Used by humans? Used in computers? Decimal100, 1, … 9YesNo Binary20,
Revision Introductory Lesson
Number Systems.
1 Number SystemsLecture 8. 2 BINARY (BASE 2) numbers.
Chapter 2 Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in.
Conversion of Number System Conversion Among Bases The possibilities: Hexadecimal DecimalOctal Binary
NUMBER SYSTEM.
NUMBER SYSTEMS Prepared By K.Anitha Associate Professor Dept of ECE PVPSIT.
Chapter 2 Binary Values and Number Systems. 2 2 Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645,
Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in other bases.
Number systems, Operations, and Codes
Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system.
Chapter1: Number Systems
Number Systems Prepared by Department of Preparatory year.
CPS120: Introduction to Computer Science Computer Math: Converting to Decimal.
Positional Notation 642 in base 10 positional notation is:
Digital Electronics Octal & Hexadecimal Number Systems.
Number System sneha.
Chapter 2 Number Systems: Decimal, Binary, and Hex.
Octal to Decimal Hexadecimal DecimalOctal Binary.
1. Number Systems. Common Number Systems SystemBaseSymbols Used by humans? Used in computers? Decimal100, 1, … 9YesNo Binary20, 1NoYes Octal80, 1, … 7No.
Discrete Mathematics Numbering System.
Computer Programming 12 Mr. Jean February 11 th, 2014.
Octal & Hexadecimal Number Systems
NUMBER SYSTEM. Number System Number Base B => B symbols – Base 16(Hexa):0, 1,……9, A,…, E, F – Base 10 (Decimal): 0, 1, 2,……, 7, 8, 9 – Base 8(Octal):
Chapter 2 Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in.
Computer Number System
1. Number Systems Chapt. 2 Location in course textbook.
ITEC 1011 Introduction to Information Technologies 1. Number Systems Chapt. 2 Location in course textbook.
1. Number Systems. Common Number Systems SystemBaseSymbols Used by humans? Used in computers? Decimal100, 1, … 9YesNo Binary20, 1NoYes Octal80, 1, … 7No.
The Hexadecimal System is base 16. It is a shorthand method for representing the 8-bit bytes that are stored in the computer system. This system was chosen.
Number Systems. There are 10 kinds of people in the world, those who understand binary and those who don’t.
Binary Values. Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative Numbers.
Binary Values and Number Systems
Chapter 02 Nell Dale & John Lewis.
Octal to Decimal Decimal Octal Binary Hexadecimal.
Discrete Mathematics Numbering System.
1. Number Systems.
NUMBER SYSTEM Prepared by: Engr Zakria.
Number System.
Lecture 3: Binary values and number systems
Writer:-Rashedul Hasan. Editor:- Jasim Uddin
ITE102 – Computer Programming (C++)
Base ‘b’ number for i = 0 to n – 1 for an n digit quantity
CSE 102 Introduction to Computer Engineering
Convert Binary Number to Octal
Location in course textbook
Number System conversions
Chapter 1 Number Systems & Conversions
Textbook Computer Science Illuminated 4th Edition  By Nell Dale, John Lewis - Jones and Bartlett Publishers 11/20/2018.
MMNSS COLLEGE,KOTTIYAM DEPARTMENT OF PHYSICS
1. Number Systems.
Numbering Systems and Arithmetic operations on Hex, binary, and octal
Digital Electronics and Microprocessors
Binary Values and Number Systems
Number Systems.
Number Systems created by: S.Shahrukh haider
Chapter 2 Number Systems.
Binary Values and Number Systems
Chapter 2 Number Systems.
Chapter 2 Number Systems.
Binary Values and Number Systems
Chapter 2 Number Systems.
1. Number Systems Chapt. 2.
Presentation transcript:

Chapter 2 Number System

Natural Numbers How many ones are there in 642? Hundreds = 6 Tens = 4 600 + 40 + 2 ? Hundreds = 6 Tens = 4 Ones = 2 4

Natural Numbers Aha! 642 is 600 + 40 + 2 in BASE 10 The base of a number determines the number of digits and the value of digit positions 5

Positional Notation 642 in base 10 positional notation is: Continuing with our example… 642 in base 10 positional notation is: 6 x 102 = 6 x 100 = 600 + 4 x 101 = 4 x 10 = 40 + 2 x 10º = 2 x 1 = 2 = 642 in base 10 The power indicates the position of the number This number is in base 10 6

Positional Notation What if 642 has the base of 13? 642 in base 13 is equivalent to 1068 in base 10 + 6 x 132 = 6 x 169 = 1014 + 4 x 131 = 4 x 13 = 52 + 2 x 13º = 2 x 1 = 2 = 1068 in base 10 8 6

Positional Notation dn * Rn-1 + dn-1 * Rn-2 + ... + d2 * R + d1 R is the base of the number As a formula:  dn * Rn-1 + dn-1 * Rn-2 + ... + d2 * R + d1 n is the number of digits in the number d is the digit in the ith position in the number 642 is  63 * 102 +  42 * 10 +  21 7

Common Number Systems System Base Symbols Decimal 10 0, 1, … 9 Binary 2 0, 1 Octal 8 0, 1, … 7 Hexa- decimal 16 0, 1, … 9, A, B, … F

Binary Decimal is base 10 and has 10 digits: 0,1,2,3,4,5,6,7,8,9 Binary is base 2 and has 2 digits: 0,1 For a number to exist in a given number system, the number system must include those digits. For example, the number 284 only exists in base 9 and higher. 9

Bases Higher than 10 How are digits in bases higher than 10 represented? With distinct symbols for 10 and above. Base 16 has 16 digits: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E, and F 10

Binary Numbering systems Base: 2 Digits: 0, 1 binary number: 1101012 positional powers of 2: 25 24 23 22 21 20 decimal positional value: 32 16 8 4 2 1 binary number: 1 1 0 1 0 1

Conversions Decimal Octal Binary Hexadecimal

Octal to Decimal Decimal Octal Binary Hexadecimal

Octal to Decimal Technique Multiply each digit by 8n, where n is the “weight” of the digit The weight is the position of the digit, starting from 0 on the right Add the results

Example 7248 => 4 x 80 = 4 2 x 81 = 16 7 x 82 = 448 46810

Converting Octal to Decimal What is the decimal equivalent of the octal number 642? 6 x 82 = 6 x 64 = 384 + 4 x 81 = 4 x 8 = 32 + 2 x 8º = 2 x 1 = 2 = 418 in base 10 11

Converting Octal to Decimal 278 = 2×81+7×80 = 16+7 = 2310 308 = 3×81+0×80 = 2410 43078 = 4×83+3×82+0×81+7×80= 224710 Octal numbers uses digits 0 1 2 3 4 5 6 7 8 denotes octal base and 10 represents decimal base.

Hexadecimal to Decimal Octal Binary Hexadecimal

Hexadecimal to Decimal Technique Multiply each digit by 16n, where n is the “weight” of the digit The weight is the position of the digit, starting from 0 on the right Add the results

Example ABC16 => C x 160 = 12 x 1 = 12 B x 161 = 11 x 16 = 176 A x 162 = 10 x 256 = 2560 274810

Converting Hexadecimal to Decimal What is the decimal equivalent of the hexadecimal number DEF? D x 162 = 13 x 256 = 3328 + E x 161 = 14 x 16 = 224 + F x 16º = 15 x 1 = 15 = 3567 in base 10 Remember, the digits in base 16 are 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

Converting Hexadecimal to Decimal 2F16 = 2Fh = 2×161+15×160 = 4710 BC1216 = BC12h = 11×163+12×162+1×161+2×160= 4814610 Hexa numbers : 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F 16 denotes Hax base and 10 represents decimal base.

Binary to Decimal Decimal Octal Binary Hexadecimal

Binary to Decimal Technique Multiply each digit by 2n, where n is the “weight” of the bit The weight is the position of the digit, starting from 0 on the right Add the results

Example 1010112 => 1 x 20 = 1 1 x 21 = 2 0 x 22 = 0 1 x 23 = 8 0 x 24 = 0 1 x 25 = 32 4310

Converting Binary to Decimal What is the decimal equivalent of the binary number 1101110? 1 x 26 = 1 x 64 = 64 + 1 x 25 = 1 x 32 = 32 + 0 x 24 = 0 x 16 = 0 + 1 x 23 = 1 x 8 = 8 + 1 x 22 = 1 x 4 = 4 + 1 x 21 = 1 x 2 = 2 + 0 x 2º = 0 x 1 = 0 = 110 in base 10 13

Converting Binary to Decimal 101012 = 10101b = 1×24+0×23+1×22+0×21+1×20 = 16+4+1= (21)d 101112 = 10111b = 1×24+0×23+1×22+1×21+1×20 = 16+4+2+1= (23)d 1000112 = 100011b = 1×25+0×24+0×23+0×22+1×21+1×20 =32+2+1= (35)d Binary numbers uses only 0 and 1 digits. b denotes binary base and d represents decimal base.

Other Conversions wrt Binary System Octal Binary Hexadecimal

Binary to Octal Conversion (cont.) Three-bit Group Decimal Digit Octal Digit 000 0 0 001 1 1 010 2 2 011 3 3 100 4 4 101 5 5 110 6 6 111 7 7

Binary to Octal Conversion Since the maximum value represented in 3 bit is equal to: 23 – 1 = 7 i.e. using 3 bits we can represent values from 0 –7 which are the digits of the Octal numbering system. Thus, three binary digits can be converted to one octal digit and visa versa.

Binary to Octal Groups of Three (from right) Convert each group 10101011 10 101 011 2 5 3 10101011 is 253 in base 8 17

Binary to Octal Conversion Ex : Convert 101001102 = 8 110 = 6 100 = 4 010 = 2 ( pad empty digits with 0) 101001102 = 2468

Octal to Binary Conversion Ex : Convert 7428 = 2 7 = 111 4 = 100 2 = 010 7428 = 111 100 0102

Binary to Hexa conversion Four-bit Group Decimal Digit Hexadecimal Digit 0000 0 0 0001 1 1 0010 2 2 0011 3 3 0100 4 4 0101 5 5 0110 6 6 0111 7 7 1000 8 8 1001 9 9 1010 10 A 1011 11 B 1100 12 C 1101 13 D 1110 14 E 1111 15 F

Binary to Hexa Conversion Since the maximum value represented in 4 bit is equal to: 24 – 1 = 15 i.e. using 4 bits we can represent values from 0 –15 which are the digits of the Hexadecimal numbering system. Thus, Four binary digits can be converted to one Hexadecimal digit.

Converting Binary to Hexadecimal Groups of Four (from right) Convert each group 10101011 1010 1011 A B 10101011 is AB in base 16 18

Binary to Hexa Conversion Convert 101001102 = 16 0110 = 6 1010 = A 101001102 = A616

Hexa to Binary Conversion Convert 3D916 = 2 3 = 0011 D = 1101 9 = 1001 3D916 = 0011 1101 10012

Converting Decimal to other System Octal Binary Hexadecimal

Decimal to Binary Technique Divide by two, keep track of the remainder First remainder is digit 0 (LSB, least-significant bit) Second remainder is digit 1 Etc.

Example 2 125 62 1 12510 = ?2 2 31 0 2 15 1 2 7 1 2 3 1 2 1 1 2 0 1 12510 = 11111012

Decimal to Octal Technique Divide by 8 Keep track of the remainder

Example 123410 = ?8 8 1234 154 2 8 19 2 8 2 3 8 0 2 123410 = 23228

Decimal to Hexadecimal Technique Divide by 16 Keep track of the remainder

Example 123410 = ?16 16 1234 77 2 16 4 13 = D 0 4 123410 = 4D216

Converting Decimal to Hexadecimal 222 13 0 16 3567 16 222 16 13 32 16 0 36 62 13 32 48 47 14 32 15 F E D 21