Representing Information Digitally (Number systems) Nell Dale & John Lewis (adapted by Erin Chambers, Michael Goldwasser, Andrew Harrington)

Slides:



Advertisements
Similar presentations
Chapter 2 Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in.
Advertisements

Level ISA3: Information Representation
09/11/06 Hofstra University – Overview of Computer Science, CSC005 1 Chapter 2 Binary Values and Number Systems.
Binary Expression Numbers & Text CS 105 Binary Representation At the fundamental hardware level, a modern computer can only distinguish between two values,
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
Chapter 02 Binary Values and Number Systems Nell Dale & John Lewis.
Introduction to Information Technology
IT-101 Section 001 Lecture #4 Introduction to Information Technology.
Computer Systems 1 Fundamentals of Computing
Chapter 1 Number Systems and Codes 1. Outline 1. NUMBER SYSTEMS AND CODES 2. DIGITAL ELECTRONIC SIGNALS AND SWITCHES 3. BASIC LOGIC GATES 4. PROGRAMMABLE.
Aug CMSC 104, LECT-021 Machine Architecture and Number Systems Some material in this presentation is borrowed form Adrian Ilie From The UNIVERSITY.
(2.1) Fundamentals  Terms for magnitudes – logarithms and logarithmic graphs  Digital representations – Binary numbers – Text – Analog information 
Numbering systems.
CS105 INTRODUCTION TO COMPUTER CONCEPTS BINARY VALUES & NUMBER SYSTEMS Instructor: Cuong (Charlie) Pham.
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
1 Machine Architecture and Number Systems Topics Major Computer Components Bits, Bytes, and Words The Decimal Number System The Binary Number System Converting.
How Computers Work Dr. John P. Abraham Professor UTPA.
Computer Systems Chapter 1 Pages Hardware-physical pieces Key hardware components in a computer system: The physical parts. – Central processing.
Copyright © 2003 by Prentice Hall Module 5 Central Processing Unit 1. Binary representation of data 2. The components of the CPU 3. CPU and Instruction.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION.
Machine Architecture CMSC 104, Section 4 Richard Chang 1.
Chapter 2 Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in.
Data Representation – Chapter 3 Section 3-1. Terminology “Digital” –Discrete, well defined values/steps –Opposite of analog –Analogy: digital is to analog.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Engineering 1040: Mechanisms & Electric Circuits Spring 2014 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,
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
Positional Notation 642 in base 10 positional notation is:
Data Representation – Chapter 3 Section 3-1. Terminology “Digital” –Discrete, well defined values/steps –Opposite of analog –Analogy: digital is to analog.
CISC1100: Binary Numbers Fall 2014, Dr. Zhang 1. Numeral System 2  A way for expressing numbers, using symbols in a consistent manner.  " 11 " can be.
Computer Math CPS120: Lecture 3. Binary computers have storage units called binary digits or bits: Low Voltage = 0 High Voltage = 1 all bits have 0 or.
Chapter 2 Number Systems: Decimal, Binary, and Hex.
Data Representation Bits, Bytes, Binary, Hexadecimal.
Data Representation (in computer system). Data Representation How do computers represent data? b The computers are digital Recognize.
CEC 220 Digital Circuit Design Number Systems & Conversions Friday, January 9 CEC 220 Digital Circuit Design Slide 1 of 16.
Chapter 2 Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in.
CPEN Digital Logic Design Binary Systems Spring 2004 C. Gerousis © Digital Design 3 rd Ed., Mano Prentice Hall.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Information Representation: Positive Integers Dale Roberts,
CEC 220 Digital Circuit Design Number Systems & Conversions Wednesday, Aug 26 CEC 220 Digital Circuit Design Slide 1 of 16.
Binary Decimal Hexadecimal
Chapter 2 Binary Values and Number Systems in base 10 positional notation is: 6 x 10 2 = 6 x 100 = x 10 1 = 4 x 10 = x 10º = 2.
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
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.
Understanding Computers
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
Unit 1 Introduction Number Systems and Conversion.
Introduction To Number Systems
Understanding binary Understanding Computers.
Computer basics.
Chapter 02 Nell Dale & John Lewis.
3.1 Denary, Binary and Hexadecimal Number Systems
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
CHAPTER 1 : INTRODUCTION
Information Support and Services
Writer:-Rashedul Hasan. Editor:- Jasim Uddin
Number System conversions
IT 0213: INTRODUCTION TO COMPUTER ARCHITECTURE
Machine Architecture and Number Systems
Textbook Computer Science Illuminated 4th Edition  By Nell Dale, John Lewis - Jones and Bartlett Publishers 11/20/2018.
Binary Values and Number Systems
Why computers use binary
Chapter Four Data Representation in Computers By Bezawit E.
Binary Values and Number Systems
Binary System.
Information Representation
Binary Values and Number Systems
Presentation transcript:

Representing Information Digitally (Number systems) Nell Dale & John Lewis (adapted by Erin Chambers, Michael Goldwasser, Andrew Harrington)

2-2 Analog vs. Digital Information Analog data is a continuous representation, analogous to the actual information it represents. A mercury thermometer is an analog device. The mercury rises in a continuous flow in the tube in direct proportion to the temperature. Digital data is a discrete representation, breaking the information up into separate elements.

2-3 The “bit” (binary digit) All of the historical computing devices we discussed last time were inherently digital, since the mechanisms had fixed number of states. Modern computers are based on storing information using physical means that can be in one of two distinct states. We call such a physical unit a bit.

2-4 Two-state Representation of Data “thumbs up” vs. “thumbs down” Flag can be raised or lowered dots/dashes in Morse Code light switch with circuit opened/closed “cores” (electromagnets - positive/negative field) “capacitor” (two small metallic plates with a small separation; can be statically charged/discharged) “flip/flop” (electronic circuit with output as high/low voltage signal)

2-5 Pros/Cons for Data Storage Varying level of power usage, cost, volatility: Core will keep its charge even after power is shutoff (but not as quick to access) Flip-Flop will lose its data when power is turned off (but extremely quick/cheap) Capacitors use such small charges, they sometimes lose their charge while running unless recharged regularly (“dynamic memory”)

2-6 As bits have many physical realizations, they also have many symbolic representations. 22 Binary and Computers ‘closed’‘open’ ‘on’‘off’ ‘true’‘false’ ‘1’‘0’ High voltageLow voltage

2-7 Orders of Magnitude One bit can be in one of two distinct states (0,1) Two bits can be in one of four distinct states Three bits can be in one of eight distinct states n bits can be in one of 2 n distinct states

2-8 Orders of Magnitude Common Quantities of Storage = 2 50 bytes= 2 10 TB1 Petabyte = 1trillion + bytes= 2 10 GB1 Terabyte (TB) = 1billion + bytes= 2 10 MB1 Gigabyte (GB) = bytes= 2 10 KB1 Megabyte (MB) = 1024 bytes= 2 10 bytes1 Kilobyte (KB) (thus 256 distinct settings)= 8 bits1 byte

2-9 3 Natural Numbers (0, 1, 2, 3, ….) Integers (…, -3, -2, -1, 0, 1, 2, 3, …) Rational Numbers (e.g., -249, -1, 0, ¼, - ½ ) An integer or the quotient of two integers Irrational Numbers (e.g., ,  2 ) Values not expressable as quotient of integers Let’s just focus on Natural Numbers for now… Representing Numbers

How many ones are there in 642? Natural Numbers Or is it Or maybe…

Aha! 642 is in BASE 10 The base of a number determines the number of digits and the value of digit positions (Why was base 10 chosen by humans?) Natural Numbers

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

What if 642 was a numeral in base 8? 6 x 8 2 = 6 x 64 = 384 Positional Notation 642 in base 8 is equivalent to 418 in base 10 = 418 in base x 8º = 2 x 1 = x 8 1 = 4 x 8 = 32

Decimal is base 10 and has 10 symbols: 0,1,2,3,4,5,6,7,8,9 Octal is base 8 and has 8 symbols: 0,1,2,3,4,5,6,7 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. Octal

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. Binary

2-16 What is the decimal equivalent of the binary number ? 1 x 2 6 = 1 x 64 = x 2 5 = 1 x 32 = x 2 4 = 0 x 16 = x 2 3 = 1 x 8 = x 2 2 = 1 x 4 = x 2 1 = 0 x 2 = x 2º = 0 x 1 = 0 = 108 in base Converting Binary to Decimal

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

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

DecimalOctalBinary 16 Power of 2 Number System

2-20 (Note: Loop stated differently in the book) Repeat: 1. Divide the decimal number by the new base 2. Make the remainder the next digit to the left in the answer 3. Replace the decimal number with the quotient Until the quotient is zero Algorithm for converting base 10 to other bases: 19 Converting Decimal to Other Bases

2-21 Let’s convert 59 (base 10) to base 3: 20 Why does this method work? 19 R R R R

start F E D 21 Converting Decimal to Hexadecimal Try another Conversion: 3567 (base 10) is what number in base 16? done

2-23 Try another Conversion: The base 10 number 108 is what number in base 5? 20 Converting Decimal to Other Bases

2-24 Groups of Three (from right) Convert each group is 253 in base 8 17 Converting Binary to Octal

2-25 Groups of Four (from right) Convert each group A B is AB in base Converting Binary to Hexadecimal

2-26 Let’s start with base 10: Carry Values Arithmetic in Decimal

2-27 What if this is in base 8? Carry Values Arithmetic in Other Bases = 8+4 = “14” (8) = 8+2 = “12” (8) = 8+0 = “10” (8) = 8+2 = “12” (8) = 8+5 = “15” (8)

2-28 Carry Values 14 Arithmetic in Binary Remember: there are only 2 digits in binary: 0 and 1 Position is key, carry values are used: = 2 = = 10 (2) = 3 = = 11 (2) = 2 = = 10 (2) = 2 = = 10 (2) = 2 = = 10 (2) 1+1 = 2 = = 10 (2)

2-29 Remember borrowing? Apply that concept here: Subtracting Binary Numbers

2-30

2-31