PHY 107 – Programming For Science. Positional Notation  Used in nearly all modern numerical systems  Right-to-left ordering of digits within larger.

Slides:



Advertisements
Similar presentations
DATA REPRESENTATION CONVERSION.
Advertisements

CIS 020 Assembly Programming Chapter 02 - Numbering Systems & Data Representation © John Urrutia 2012, All Rights Reserved.5/27/20121.
Copyright (c) 2004 Professor Keith W. Noe Number Systems & Codes Part I.
CSC 110 – Intro to Computing Lecture 14: Midterm Review.
CS 151 Digital Systems Design Lecture 2 Number Systems Prof. Ahmed Sameh Room 239A.
CSC 110 – Intro to Computing Lecture 3: Converting between bases & Arithmetic in other bases.
CSC 110 – Intro to Computing Lecture 4: Arithmetic in other bases & Encoding Data.
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
Chapter 02 Binary Values and Number Systems Nell Dale & John Lewis.
Binary Numbers Converting Decimal to Binary Binary to Decimal.
Computer Systems 1 Fundamentals of Computing
 Binary Binary  Binary Number System Binary Number System  Binary to Decimal Binary to Decimal  Decimal to Binary Decimal to Binary  Octal and Hexadecimal.
Number systems Converting numbers between binary, octal, decimal, hexadecimal (the easy way)
Binary Conversions Number systems Binary to decimal Decimal to binary.
Numbering Systems Decimal (Denary) base 10. Clumsy when dealing with computers. Other systems –Binary –Octal –Hexadecimal Convenient when dealing with.
Chapter 16 Binary and Hexadecimal Numbers. §16.2 thru 16.3 – Addition and Subtraction of Binary Numbers Binary = Base 2 Addition and subtraction are similar.
Lecture for Week Spring.  Numbers can be represented in many ways. We are familiar with the decimal system since it is most widely used in everyday.
CS105 INTRODUCTION TO COMPUTER CONCEPTS BINARY VALUES & NUMBER SYSTEMS Instructor: Cuong (Charlie) Pham.
1 Number SystemsLecture 8. 2 BINARY (BASE 2) numbers.
Numbering Systems. CSCE 1062 Outline What is a Numbering System Review of decimal numbering system Binary representation range Hexadecimal numbering system.
Supplemental Chapter Number Bases
Chapter 2 Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in.
Engineering 1040: Mechanisms & Electric Circuits Spring 2014 Number Systems.
1-1 Lecture 1 Class Overview and Appendix A -- Number Systems.
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,
1 Week 2: Binary, Octal and Hexadecimal Numbers READING: Chapter 2.
Chapter 2 Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in.
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
Binary Values and Number Systems
CMSC 104, Lecture 051 Binary / Hex Binary and Hex The number systems of Computer Science.
Positional Notation 642 in base 10 positional notation is:
Lecture 2 Binary Values and Number Systems. The number 943 is an example of a number written in positional notation. The relative positions of the digits.
Data Representation – Chapter 3 Section 3-1. Terminology “Digital” –Discrete, well defined values/steps –Opposite of analog –Analogy: digital is to analog.
Prof. Matthew Hertz WTC 207D /
CSC 107 – Programming For Science. Positional Notation  Used in nearly all modern numerical systems  Right-to-left ordering of digits within larger.
Lecture 1: 8/27/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
Discrete Mathematics Numbering System.
ECE 362 Microprocessor Systems and Interfacing ©5-1 Lecture 1 Hexadecimal Computation Outline n Decimal n Binary n Octal n Hexadecimal.
© 2010 Pearson Prentice Hall. All rights reserved. CHAPTER 4 Number Representation and Calculation.
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.
Chapter 01 Numbers. Chapter 02 Base 10 example Decimal Number Place Place (place - 1) ===============================
Number Systems & Binary How to count. How do we represent numbers? Early systems: – Actual count : ||||| = 5 – Roman numers : XI = 11 Hard to do math:
Numeral Systems Rubel Biswas.
Binary Values. Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative Numbers.
DigitValue Denotation NumericValue Denotation 2thousands1,000 0hundreds100 4tens10 8ones1 Computer Organization Basic Computer Concepts Number Systems.
Coding Part 2. Weight of the Digit 3672 Thousands (10 3 )Hundreds (10 2 )Tens (10 1 )Units (1) = Weights Decimal Example (3672) 10 Binary.
Lecturer: Santokh Singh
Introduction To Number Systems
Different Numeral Systems
Chapter 02 Nell Dale & John Lewis.
Discrete Mathematics Numbering System.
Integer Real Numbers Character Boolean Memory Address CPU Data Types
Lecture 3: Binary values and number systems
Convert Decimal to Binary
Chapter R Prealgebra Review Decimal Notation.
2.0 COMPUTER SYSTEM 2.2 Number System and Representation
Number Systems & Binary
Number System conversions
University of Gujrat Department of Computer Science
Introduction to IT By: Muhammed s. anwar.
Binary / Hex Binary and Hex The number systems of Computer Science.
Numeral systems (radix)
Converting from Base-n to Base-10
Information Representation
Number systems Converting numbers between binary, octal, decimal, hexadecimal (the easy way)
Presentation transcript:

PHY 107 – Programming For Science

Positional Notation  Used in nearly all modern numerical systems  Right-to-left ordering of digits within larger number  Expresses value using value of each digit (0, 1, 2, … 9)  Value of position in which the digit is places  e.g., 3, 13, 913, 0913, 10913,  Numbers & arithmetic easy to understand  Subtracting roman numerals is not for faint-of-heart

Positional Notation for = 2 ones= 2 * 1 =2

Positional Notation for = 2 ones= 2 * 1 =2 6= 6 tens= 6 * 10 =60

Positional Notation for = 2 ones= 2 * 1 =2 6= 6 tens= 6 * 10 =60 8= 8 hundreds= 8 * 100 =800

Positional Notation for = 2 ones= 2 * 1 =2 6= 6 tens= 6 * 10 =60 8= 8 hundreds= 8 * 100 =800 5= 5 thousands= 5 * 1000 =5000

Positional Notation for = 2 ones= 2 * 1 =2 6= 6 tens= 6 * 10 =60 8= 8 hundreds= 8 * 100 =800 5= 5 thousands= 5 * 1000 =

Decimal Positional Notation  Formal equation for a number d n...d 3 d 2 d 1 d 0  d 0 is digit in ones place, d 1 is in tens place, … d 0 * 10 0 d 1 * 10 1 d 2 * 10 2 d 3 * 10 3 … + d n * 10 n

Base-10 Positional Notation d0d0 2= 2 ones= 2 * 1 =2 d1d1 6= 6 tens= 6 * 10 =60 d2d2 8= 8 hundreds= 8 * 100 =800 d3d3 5= 5 thousands= 5 * 1000 =

Base-10 Positional Notation d0d0 2= 2 ones= 2 * 10 0 =2 d1d1 6= 6 tens= 6 * 10 1 =60 d2d2 8= 8 hundreds= 8 * 10 2 =800 d3d3 5= 5 thousands= 5 * 10 3 =

Base-10 Positional Notation 0d00d0 2= 2 ones 0 = 2 * 10 0 =2 1d11d1 6= 6 tens 1 = 6 * 10 1 =60 2d22d2 8= 8 hundreds 2 = 8 * 10 2 =800 3d33d3 5= 5 thousands 3 = 5 * 10 3 =

Base-10 Positional Notation d0d0 2= 2 ones= 2 * 10 0 =2 d1d1 6= 6 tens= 6 * 10 1 =60 d2d2 8= 8 hundreds= 8 * 10 2 =800 d3d3 5= 5 thousands= 5 * 10 3 =

Computer Number Systems  Previous equation worked in decimal (base-10)  Usual number system used in day-to-day life  System requires representing 10 different digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9  Computers always in one of two states  Turned on, your PS4 can play Bloodborne  Cell phones great paperweights when turned off  Binary digits ( 0,1 ) only used by computers  To use them, helps to know powers-of-two bases

Digits In Other Bases  Binary (base-2) uses 2 digits: 0, 1  Octal (base-8) uses 8 digits: 0, 1, 2, 3, 4, 5, 6, 7  Hexadecimal (base-16) has 16 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F A 16 = D 16 = B 16 = E 16 = C 16 = F 16 = 15 10

Positional Notation  To convert d n... d 3 d 2 d 1 d 0 into decimal: From base-10 d 0 * 10 0 d 1 * 10 1 d 2 * 10 2 d 3 * 10 3 … + d n * 10 n

Positional Notation  To convert d n... d 3 d 2 d 1 d 0 into decimal: From base-b d 0 * b 0 d 1 * b 1 d 2 * b 2 d 3 * b 3 … + d n * b n

Converting Binary to Decimal = d0d0 d1d1 d2d2 d3d3 d4d4 d5d5

Converting Binary to Decimal = d0d0 1* d1d1 1* d2d2 0* d3d3 1* d4d4 0* d5d5 1*

Converting Binary to Decimal = d0d0 1* 2 0 = d1d1 1* 2 1 = d2d2 0* 2 2 = d3d3 1* 2 3 = d4d4 0* 2 4 = d5d5 1* 2 5 =

Converting Hex to Decimal = d0d0 d1d1 3F 16 = d0d0 d1d1

Converting Hex to Decimal = d0d = 7 10 d1d = F 16 = d0d0 F 16 =15 10 d1d = 3 10

Converting Hex to Decimal = d0d = 7 10 * 16 0 = d1d = 2 10 * 16 1 = 3F 16 = d0d0 F 16 =15 10 * 16 0 = d1d = 3 10 * 16 1 =

Positional Notation Review  To convert d n... d 3 d 2 d 1 d 0 into decimal: From base-b d 0 * b 0 d 1 * b 1 d 2 * b 2 d 3 * b 3 … + d n * b n

Converting Decimal To Binary  Converting from decimal to binary (base-2): While decimal number ≠ 0 Divide decimal number by 2 Move remainder to left end of answer Replace decimal number with quotient =

Converting Decimal To Base-b  More generally, convert from decimal to base-b: While decimal number ≠ 0 Divide decimal number by b Move remainder to left end of answer Replace decimal number with quotient = 16

Your Turn  Get in groups & work on following activity

For Next Lecture  Read pages 91 – 98 for Monday  What is the boolean data type?  How do the boolean operations work?  What happens when we execute an if statement  Week #3 weekly assignment due Tuesday  Problems available via D2L  If problem takes more than 10 minutes, TALK TO ME!