4.2 Number Bases in Positional Systems

Slides:



Advertisements
Similar presentations
Copyright (c) 2004 Professor Keith W. Noe Number Systems & Codes Part I.
Advertisements

Introduction to Computer Engineering by Richard E. Haskell Number Systems Module M3.1 Sections
Information Processing
CISCO NETWORKING ACADEMY Chabot College ELEC 74A Hexadecimal Introduction.
Number Systems and Codes In PLC
 Binary Binary  Binary Number System Binary Number System  Binary to Decimal Binary to Decimal  Decimal to Binary Decimal to Binary  Octal and Hexadecimal.
Numbering Systems Decimal (Denary) base 10. Clumsy when dealing with computers. Other systems –Binary –Octal –Hexadecimal Convenient when dealing with.
Data Storage Introduction to computer, 2nd semester, 2010/2011 Mr.Nael Aburas Faculty of Information Technology Islamic.
A-Level Computing Data representation. Objectives Know how data can be represented in a computer system Understand the need for various forms of representation.
1 Number SystemsLecture 8. 2 BINARY (BASE 2) numbers.
Supplemental Chapter Number Bases
Salisbury Numbers we use in Auto Shop Why do I need to know this. When working on the computers in the auto shop sometimes we need to look into the.
Colors. Color of HTML Elements You can control the color of the following elements: You can control the color of the following elements: All text within.
Number Systems Ron Christensen CIS 121.
Data Basics. Binary Number System Numeration systems are methods of representing numbers. All current number systems are positional in nature. In
NUMBER SYSTEM Decimal System Binary System. We use two digits in this system (0,1) just like the existing system of computers.. And write the number in.
The Hexadecimal Number System and Memory Addressing ISAT 121.
CMSC 104, Lecture 051 Binary / Hex Binary and Hex The number systems of Computer Science.
Positional Notation 642 in base 10 positional notation is:
Converting From decimal to Binary & Hexadecimal to Binary
AP Computer Science A – Healdsburg High School 1 Unit 1 - Binary Numbers - Hexadecimal Numbers.
Chapter 2 Number Systems: Decimal, Binary, and Hex.
Chapter 2 Bits, Data Types, and Operations. 2-2 Hexadecimal Notation It is often convenient to write binary (base-2) numbers as hexadecimal (base-16)
Hexadecimal Data Representation. Objectives  Know how the Hexadecimal counting system works  Be able to convert between denary, binary & hexadecimal.
CSC 107 – Programming For Science. Positional Notation  Used in nearly all modern numerical systems  Right-to-left ordering of digits within larger.
Data Representation Hexadecimal  Although computers work in binary it is sometimes inconvenient for humans to read everything in Binary. For example in.
THE BINARY NUMBER SYSTEM “There are only 10 types of people in this world: Those who understand BINARY and those who do not.”
DECIMALBINARY a) b) c) d) e) f) Revision Exercise DECIMALBINARY a) b) c)
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
PHY 107 – Programming For Science. Positional Notation  Used in nearly all modern numerical systems  Right-to-left ordering of digits within larger.
COMPUTER SCIENCE Data Representation and Machine Concepts Section 1.5 Instructor: Lin Chen Sept 2013.
Chapter 2 Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in.
Principles & Applications
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Information Representation: Positive Integers Dale Roberts,
© 2010 Pearson Prentice Hall. All rights reserved. CHAPTER 4 Number Representation and Calculation.
Computer Science 4 On and OFF. Homework What have we created.
Digital Electronics Principles & Applications Fifth Edition Chapter 2 Numbers We Use in Digital Electronics ©1999 Glencoe/McGraw-Hill Roger L. Tokheim.
Chapter 2: Binary Values and Number Systems Chapter 2 Binary Values and Number Systems Page 14 Information may be reduced to its fundamental state by.
CSC 110 – Intro to Computing Lecture 3: Converting between bases & Arithmetic in other bases.
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.
CMSC 1041 Binary / Hex Binary and Hex The number systems of Computer Science.
Decimal Numbers.
Unit 18: Computational Thinking
Digital Electronics INTRODUCTION ANALOG VS DIGITAL NUMBER SYSTEMS.
Binary Positional Notation
Positional Notation A positional or place-value notation is a numeral system in which each position is related to the next by a constant multiplier, called.
Copyright (c) 2004 Professor Keith W. Noe
2.0 COMPUTER SYSTEM 2.2 Number System and Representation
RFID - EN Encoding information Encoding information J.-D. Chatelain.
Number System conversions
Data Storage Introduction to computer, 2nd semester, 2010/2011
Binary Quiz UIN: ____________________
Number Systems Base 2, 10, 16.
Binary, Octal and Hex Numbers Copyright Thaddeus Konar
Digital Electronics Ms. Deepa Mehta.
Unit 2.6 Data Representation Lesson 1 ‒ Numbers
Binary / Hex Binary and Hex The number systems of Computer Science.
Binary Lesson 3 Hexadecimal
Binary Lesson 3 Hexadecimal
Binary Lesson 3 Hexadecimal
Binary Lesson 4 Hexadecimal and Binary Practice
Chapter 2 Number Systems.
Chapter 2 Number Systems.
CS 286 Computer Organization and Architecture
Binary Lesson 4 Hexadecimal and Binary Practice
Chapter 2 Number Systems.
Information Representation
Chapter 2 Number Systems.
Number System.
Presentation transcript:

4.2 Number Bases in Positional Systems

Recall: Decimal (base 10) System 10000 1000 100 10 1 104 103 102 101 4 3 5 2 4 x 10000 3 x1000 5 x100 1 x10 2 = 43512 Uses 10 digits (symbols): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Each position implies power of 10

Binary (base 2) System Computer signals in terms of ‘yes’/’no’, ‘on’/’off’, ‘high voltage’/’low voltage’, 1/0. Computer data storage also in terms of ‘on’/’off’, ‘north pole’/’south pole’, 1/0. Binary system uses 2 symbols: 0, 1 E.g., 1two = 1ten 10two = 2ten 11two = 3ten 100two = 4ten 101two = 5ten

Binary (base 2) System 64 +0 +1 = 65dec Uses 2 digits (symbols): 0, 1 Each position implies power of 2

Binary (base 2) System Decimal Binary 1 2 10 3 11 4 100 5 101 6 110 7 111 8 1000 9 1001 1010 1011 12 1100 13 1101

Converting Binary to Decimal Express the following binary notation in decimal notation. 0110binary = (0 x 23) + (1 x 22) + (1 x 21) + (0 x 20) = 0 + 4 + 2 + 0 = 6 1111binary = (1 x 23) + (1 x 22) + (1 x 21) + (1 x 20) = 8 + 4 + 2 + 1 = 15

Your Turn 111binary = (1 x 22) + (1 x 21) + (0 x 20) = 4 + 2 + 1 = 7 Express the following binary notation in decimal notation. 111binary = (1 x 22) + (1 x 21) + (0 x 20) = 4 + 2 + 1 = 7 10001binary = (1 x 24) + (0 x 23) + (0 x 22) + (0 x 21) + (1 x 20) = 16 + 0 + 0 + 0 + 1 = 17

Hexadecimal Notation (base 16) C++ Code Find the gcd of two numbers E.g., given: 12 and 36 gcd = 12

Computer Program Code Machine Language Code (What? No binary code?) Hexadecimal Notation can serve as a short hand for Binary Notation. In the last line: 8 B 4 5 1000 1101 0100 0101 A C 5 0 1100 1110 0101 0000 F F D 6 1111 1111 1101 0110

Hexadecimal (base 16) Notation Uses 16 symbols: E.g., 2Bhexadecimal = 43ten A3hexadecimal = 163ten Decimal 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Hexadec A B C D E F

Hexadecimal (base 16) Notation 4096 256 16 1 163 162 161 160 3 A C 2 3 x 4096 10 x 256 12 x 16 2 12288 2560 192 2 = 15042dec Uses 16 digits (symbols): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Each position implies power of 16

Converting Hexadecimal to Decimal Notation Converting Hexadecimal  to Decimal Notation Dec Hex 1 2 3 4 5 6 7 8 9 10 A 11 B 12 C 13 D 14 E 15 F Convert from hexadecimal to decimal notation: 2Bhex Recall: Pos. val. 161 160 16 1 Digit 2 B Dec. val. (2 x 16) + (11 x 1) 32 + 11 = 43dec A3hex (10 x 16) + (3 x 1) 160 + 3 = 163dec

Your Turn Convert from hexadecimal to decimal notation: 8B hex 1 2 3 4 5 6 7 8 9 10 A 11 B 12 C 13 D 14 E 15 F Convert from hexadecimal to decimal notation: 8B hex Recall: Pos. val. 161 160 16 1 Digit 8 B Dec. val. (8 x 16) + (11 x 1) 128 + 11 = 138dec 45 hex (4 x 16) + (5 x 1) 64 + 5 = 69dec

Converting Hexadecimal to Decimal Notation Converting Hexadecimal  to Decimal Notation (15 x 256+ (15 x 16) + (15 x 1) = 3840 + 240 + 15 = 3095 Find the decimal numeral for the following hex numeral. 12A FFF (15 x 256+ (15 x 16) + (15 x 1) = 3840 + 240 + 15 = 3095 Pos val. 162 161 160 256 16 1 Digit 2 A Value 1 x 256 2 x 16 10 x 1 32 10 = 298

Your Turn Convert the Hexadecimal Numeral to Decimal Numeral: 13E. 1 2 3 4 5 6 7 8 9 10 A 11 B 12 C 13 D 14 E 15 F Convert the Hexadecimal Numeral to Decimal Numeral: 13E. Pos val. 162 161 160 256 16 1 Digit 3 E Value 1 x 256 3 x 16 14 x 1 48 14 = 308

How Is Binary Notation Related to Hex Notation? 128 64 32 16 8 4 2 1 27 26 25 24 23 22 21 20 64 +16 +8 +2 = 90ten 16 1 161 160 128 64 32 8 4 2 27 26 25 24 23 22 21 20 5 A 5 x 16 10 x 1 = 90ten

Dec Binary Hex 1 2 10 3 11 4 100 5 101 6 110 7 111 8 1000 9 1001 1010 A 1011 B 12 1100 C 13 1101 D 14 1110 E 15 1111 F Your Turn Convert from binary to hexadecimal 11010110 Binary: 1001 0110 Hex: 9 6 10101011 Binary: 1010 1011 Hex: A B 1011000110001101 Binary: 1011 0001 1000 1101 Hex: B 1 8 C

Your Turn A3 Hex: A3 Binary: 1010 0011 FC Hex: FC Binary: 1111 1100 Dec Binary Hex 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001 10 1010 A 11 1011 B 12 1100 C 13 1101 D 14 1110 E 15 1111 F Your Turn Convert from hexadecimal to binary. A3 Hex: A3 Binary: 1010 0011 FC Hex: FC Binary: 1111 1100