CSC 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
Calculating in Other Bases
Advertisements

DATA REPRESENTATION CONVERSION.
CIS 020 Assembly Programming Chapter 02 - Numbering Systems & Data Representation © John Urrutia 2012, All Rights Reserved.5/27/20121.
CSC 110 – Intro to Computing Lecture 14: Midterm Review.
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.
Number System Conversions Lecture L2.2 Section 2.3.
Binary Numbers Converting Decimal to Binary Binary to Decimal.
Computer Systems 1 Fundamentals of Computing
COE 202: Digital Logic Design Number Systems Part 1
 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)
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.
CS105 INTRODUCTION TO COMPUTER CONCEPTS BINARY VALUES & NUMBER SYSTEMS Instructor: Cuong (Charlie) Pham.
Numeral Systems Subjects: Numeral System Positional systems Decimal
Chapter 7 Section 7.1 Place Systems.
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
Number Systems What is the Standard Base we
Data Representation – Chapter 3 Section 3-1. Terminology “Digital” –Discrete, well defined values/steps –Opposite of analog –Analogy: digital is to analog.
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.
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. The Week’s Goal.
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,
PHY 107 – Programming For Science. Positional Notation  Used in nearly all modern numerical systems  Right-to-left ordering of digits within larger.
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.
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
 2012 Pearson Education, Inc. Slide Chapter 4 NumerationSystems.
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:
Chapter 4 Numeration and Mathematical Systems © 2008 Pearson Addison-Wesley. All rights reserved.
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
Chapter 02 Nell Dale & John Lewis.
Discrete Mathematics Numbering System.
Lecture 3: Binary values and number systems
Convert Decimal to Binary
Number Systems & Binary
Number System conversions
University of Gujrat Department of Computer Science
Introduction to IT By: Muhammed s. anwar.
Numbering System TODAY AND TOMORROW 11th Edition
Binary / Hex Binary and Hex The number systems of Computer Science.
Converting from Base-n to Base-10
Information Representation
Number systems Converting numbers between binary, octal, decimal, hexadecimal (the easy way)
Section 2.2 Scientific Notation.
Presentation transcript:

CSC 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 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 PS3 can play Guitar Hero 3  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 =

Your Turn  Get in groups of 3 & work on following activity

For Next Lecture  Read sections 3.1 – 3.7 in book for Friday  What is required for a C program?  Why is main so important?  What are comments & how do we write them?  Week #1 assignment posted to Angel  1 st problem deals with material from today  All 3 problems will be due next Tuesday  If problem takes more than 10 min., talk to me