Number Systems.

Slides:



Advertisements
Similar presentations
1 Chapter 2 The Digital World. 2 Digital Data Representation.
Advertisements

 A binary number is a number that includes only ones and zeroes.  The number could be of any length  The following are all examples of binary numbers.
SIMS-201 Representing Information in Binary. 2  Overview Chapter 3: The search for an appropriate code Bits as building blocks of information Binary.
Computer Number Systems This presentation will show conversions between binary, decimal, and hexadecimal numbers.
Binary Numbers.
© Copyright 2012 by Pearson Education, Inc. All Rights Reserved. 1 Number Systems 0, 1 0, 1, 2, 3, 4, 5, 6, 7 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 0, 1, 2, 3,
Digital Logic Chapter 2 Number Conversions Digital Systems by Tocci.
1 Survey of Computer Science CSCI 110, Spring 2011 Lecture 16 Digital Circuits, binary Numbers.
Data Representation S2. This unit covers how the computer represents- Numbers Text Graphics Control.
Foundations of Computer Science Computing …it is all about Data Representation, Storage, Processing, and Communication of Data 10/4/20151CS 112 – Foundations.
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
HOW COMPUTERS MANIPULATE DATA Chapter 1 Coming up: Analog vs. Digital.
Number Systems What is the Standard Base we
The Wonders of Conversion. A number system is a system in which a number is represented. There are potential infinite number systems that can exist (there.
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.
Bits & Bytes A bit is the smallest amount of memory used to store information. A bit is represented by either a “0” or a “1”. “Bit” is a contraction of.
Digital Electronics Octal & Hexadecimal Number Systems.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Number Systems 0, 1 0, 1, 2,
EEL 3801C EEL 3801 Part I Computing Basics. EEL 3801C Data Representation Digital computers are binary in nature. They operate only on 0’s and 1’s. Everything.
Section 4.3 Other Bases.
Data Representation, Number Systems and Base Conversions
Visualizing Decimal and Binary
1 Ethics of Computing MONT 113G, Spring 2012 Session 1 Digital Circuits, binary Numbers Course webpage:
Announcement!!! First exam next Thursday (I’m trying to give you a first exam before the drop date) I’ll post a sample exam over the weekend and will try.
Octal & Hexadecimal Number Systems
MECH1500 Chapter 3.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Computer Number System
Cis303a_chapt03_exam1_answer.ppt CIS303A: System Architecture Exam 1: Chapter 3 Answer List the characters (digits) for the following bases. 1) Decimal:
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
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.
Numbering Systems and Conversion Understand How Computing Devices Work 1.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Fall’ 2014 Lesson - 1 Number System & Program Design CSE 101.
Understanding Computers
Fall’ 2014 Number System CSE Number System How Computers Represent Data Binary Numbers The Binary Number System Bits and Bytes Text Codes Binary.
Number systems Visualizing Decimal and Binary. We count in base 10 because people started by counting on their fingers Base 10 is a number system that.
Understanding Binary Understanding Computers. Understanding Computers L3 – Understanding Binary Learning Objectives All will Understand why all data is.
Number Systems Decimal Can you write 12,045 in expanded form? Base? Allowable digits for each place?
Number Systems & Binary Arithmetic
CUIT105: Logic Design and Switching Circuits
Appendix F Number Systems binary 0, 1 0, 1, 2, 3, 4, 5, 6, 7
Understanding binary Understanding Computers.
Digital Design Chapter One Digital Systems and Binary Numbers
What is a byte? What is it? How would you use it?
Integer Real Numbers Character Boolean Memory Address CPU Data Types
CHAPTER 1 : INTRODUCTION
Representation of data in computer systems
COMPUTING FUNDAMENTALS
Binary & Hexidecimal Numbers
Number System conversions
IT 0213: INTRODUCTION TO COMPUTER ARCHITECTURE
Binary / Hex Binary and Hex The number systems of Computer Science.
Digital Logic & Design Lecture 02.
Binary Numbers? Foley SED 514 Section /2/2019.
Digital Electronics and Microprocessors
Chapter 2: Number Systems
Data Binary Conversion.
How Computers Store Data
Objective 1.02 Understand Numbering Systems
Machine Architecture and Number Systems
Chapter Four Data Representation in Computers By Bezawit E.
The basics of any electronic device means either electricity is flowing or it is not i.e. a switch is either on or off Computers are electronic devices.
Information Technology Department
Hexadecimal.
Electronic Memory.
Chapter 3 - Binary Numbering System
CHAPTER 69 NUMBER SYSTEMS AND CODES
Section 4.3 Other Bases.
1 1. Binary Basics Year 8 Unit 1 Bitmap Graphics.
Presentation transcript:

Number Systems

Java Bits & Bytes Object Oriented Programming The material in this chapter is not tested on the AP CS exams.

Bits & Bytes A bit (a contraction of binary digit) is the basic capacity of information in computing and telecommunications; a bit can have a value of either 1 or 0 (one or zero). You can think of a bit as a one digit binary number. The only possible values are 0 and 1.

Bits & Bytes In the world of digital computers a bit is an electronic switch that has two states – on or off. You can think of a bit as a one digit binary number. The only possible values are 0 and 1. It’s very similar to a light switch.

Bits & Bytes Since a bit can only represent two possible values (0 or 1) we combine bits into groups called bytes. You can think of a bit as a one digit binary number. The only possible values are 0 and 1. It’s very similar to a light switch.

Bits & Bytes A byte is comprised of 8 bits. A byte is the basic addressable element in many computer architectures. You can think of a bit as a one digit binary number. The only possible values are 0 and 1. It’s very similar to a light switch.

Bits & Bytes A byte is comprised of 8 bits. A byte is the basic addressable element in many computer architectures. 8 bits You can think of a bit as a one digit binary number. The only possible values are 0 and 1. It’s very similar to a light switch. _ _ _ _ _ _ _ _ byte

Bits & Bytes 0 0 0 0 0 0 0 1 byte = 1 Binary 1 equals decimal 1.

Bits & Bytes 1 1 1 1 1 1 1 1 byte = 255 Binary 11111111 = 255. = 255 Binary 11111111 = 255. What if we want to work with numbers larger than 255? We need a different data type!

How Digital Computers Store Information

Digital Computers A What is this? The letter ‘A’.

01000001 Digital Computers What is this? How a computer sees the letter ‘A’.

Digital Computers Computers are called digital devices because all of the information inside it is represented and manipulated as binary numbers. All of the numbers in a spreadsheet, all of the text characters in a Word document, all of the pictures and sounds stored in a computer, are ALL represented as binary numbers. The original meaning of “digit” is “finger” and since people often count using their fingers, the term digit also came to to be applied to numbers.

Digital Computers ‘A’ has a hexidecimal value of 41 – which is a decimal value of 65 – or a binary value of 01000001

Digital Computers The number system that you use is base 10. When you write the number 1853, for example it means: Why do we use a base 10 number system? Each digit (0-9) within a base 10 number is multiplied by the power of ten corresponding to its position. Notice that each digit place has 10 times the value of the digit place to the right of it. But you knew all this, of course.

Digital Computers Base10 is not convenient for a computer (which has no fingers) to use. What computers DO have, are electrical circuits, which are either on or off. Just two states to work with. So the natural number system for use in an electronic computer is base2 (called the binary number system). The original meaning of “digit” is “finger” and since people often count using their fingers, the term digit also came to to be applied to numbers.

Digital Computers In a computer’s memory, a tiny electronic switch that is on (conducting a current) might represent a 1, while that same switch that is off would represent a 0 (zero).

Digital Computers It gets cumbersome saying “binary digit” all the time, so the shorter term “bit” was invented. A bit is one binary digit. A bit can hold either a 1 or a 0 (zero). A string of bits can hold larger numbers (just as you use strings of base 10 digits to represent numbers larger than 9).

Digital Computers A particularly handy size chunk of computer memory happens to be 8 bits long. A byte can be used to represent any number from zero (00000000) to 255 (11111111). This is the basic unit we use to measure computer memory size.

Digital Computers A computer would store the value 181 in it’s binary form. 181 (base10) = 10110101 (base2)

Decimal Number System

Decimal Number System 1 2 3 4 5 6 7 8 9 Now what? 1 2 3 4 5 6 7 8 9 Now what? We just ran out of numbers! Nine is the largest number in the base 10 system. What happens when you add 1 to 9?

Decimal Number System 1 2 3 4 5 6 7 8 9 10 We bring in a new digit! 1 2 3 4 5 6 7 8 9 We bring in a new digit! Nine is the largest number in the base 10 system. What happens when you add 1 to 9? 10

Binary Number System

Binary Number System 1 Now what? We just ran out of numbers! 1 Now what? We just ran out of numbers! Nine is the largest number in the base 10 system. What happens when you add 1 to 9?

Binary Number System 1 10 We bring in a new digit! 1 We bring in a new digit! 10 One is the largest number in the base 2 system. What happens when you add 1 to 1?

Decimal Binary Equivalency

Equivalent Values Every decimal number has an equivalent binary number and every binary number has an equivalent decimal value.

Equivalent Values Decimal Binary 1 2 10

Equivalent Values What do we get when we add 1 to a binary 10? Decimal Binary 1 2 10 3

Equivalent Values Decimal Binary 1 2 10 3 11

Equivalent Values What do we get when we add 1 to a binary 11? Decimal Binary 1 2 10 3 11 4

Equivalent Values Decimal Binary 1 2 10 3 11 4 11 +1

Equivalent Values Decimal Binary 1 2 10 3 11 4 11 +1 1 + 1 = 10

Equivalent Values Decimal Binary 1 2 10 3 11 4 1 11 +1 Carry the 1

Equivalent Values Decimal Binary 1 2 10 3 11 4 1 11 +1 100 1 2 10 3 11 4 1 11 +1 100 1 + 1 = 10. Bring down the 10.

Equivalent Values Decimal Binary 1 2 10 3 11 4 100

Equivalent Values Decimal Binary 1 2 10 3 11 4 100 5 101

Equivalent Values What do we get when we add 1 to a binary 101? Decimal Binary 1 2 10 3 11 4 100 5 101 6

Equivalent Values Decimal Binary 1 2 10 3 11 4 100 5 101 6 110

Equivalent Values Decimal Binary 1 2 10 3 11 4 100 5 101 6 110 7 111

Equivalent Values What do we get when we add 1 to a binary 111? Decimal Binary 1 2 10 3 11 4 100 5 101 6 110 7 111 8

Equivalent Values Decimal Binary 1 2 10 3 11 4 100 5 101 6 110 7 111 8 1 2 10 3 11 4 100 5 101 6 110 7 111 8 1000

Equivalent Values 1 2 10 4 100 8 1000 Do you see a pattern? Decimal Binary 1 2 10 3 11 4 100 5 101 6 110 7 111 8 1000 Do you see a pattern?

Binary To Decimal Conversion

Binary To Decimal Conversion 1   128 64 32 16 8 4 2 Notice that each binary digit position in the base 2 number has 2 times the value of the binary digit position to the right of it (since this is base 2; remember how base 10 worked).

Binary To Decimal Conversion 1   128 64 32 16 8 4 2

Binary To Decimal Conversion 1   128 64 32 16 8 4 2

Binary To Decimal Conversion 1   128 64 32 16 8 4 2

Binary To Decimal Conversion 1   128 64 32 16 8 4 2

Binary To Decimal Conversion 1   128 64 32 16 8 4 2

Binary To Decimal Conversion 1   128 64 32 16 8 4 2

Binary To Decimal Conversion 1   128 64 32 16 8 4 2

Binary To Decimal Conversion 1   128 64 32 16 8 4 2

Binary To Decimal Conversion 1   128 64 32 16 8 4 2 181

Decimal To Binary Conversion Take out a sheet of paper and a pen or a pencil.

Decimal To Binary Conversion 11111111 (base2) = ______ (base10) Solve the problem! Have students solve the problem on a sheet of paper and hold their answers up over their heads when done.

Decimal To Binary Conversion 111111112 = 25510

Decimal To Binary Conversion

Decimal To Binary Conversion 18110 = _____________2 181

Decimal To Binary Conversion Divide the original number 181 by the base of the number you are converting it into – in this case 2. 181 / 2 is 90 with a remainder of 1. The 1 is a binary number. Division by 2 will always result in 0 or 1 as a remainder. 90 2 181 1

Decimal To Binary Conversion 45 Now divide 90 by 2. 90 / 2 is 45 with a remainder of 0. The 0 is a binary number. 2 90 181 1

Decimal To Binary Conversion 22 2 45 1 Now divide 45 by 2. 45 / 2 is 22 with a remainder of 1. The 1 is a binary number. 90 181 1

Decimal To Binary Conversion 11 2 22 45 1 Now divide 22 by 2. 22 / 2 is 11 with a remainder of 0. The 0 is a binary number. 90 181 1

Decimal To Binary Conversion 5 2 11 1 22 45 1 Now divide 11 by 2. 11 / 2 is 5 with a remainder of 1. The 1 is a binary number. 90 181 1

Decimal To Binary Conversion 2 2 5 1 11 1 22 45 1 Now divide 5 by 2. 5 / 2 is 2 with a remainder of 1. The 1 is a binary number. 90 181 1

Decimal To Binary Conversion 1 2 2 5 1 11 1 22 45 1 Now divide 2 by 2. 2 / 2 is 1 with a remainder of 0. The 0 is a binary number. Thus, 18110 = 101101012 90 181 1

Decimal To Binary Conversion 1 2 2 18110 = 101101012 5 1 11 1 22 45 1 Now divide 2 by 2. 2 / 2 is 1 with a remainder of 0. The 0 is a binary number. Thus, 18110 = 101101012 90 181 1

Decimal To Binary Conversion Take out a sheet of paper and a pen or a pencil.

Decimal To Binary Conversion 77 (base10) = __________ (base2) Solve the problem! Have students solve the problem on a sheet of paper and hold their answers up over their heads when done.

Decimal To Binary Conversion 7710 = 10011012

Questions?