How to Represent Numbers on a Computer

Slides:



Advertisements
Similar presentations
Chapter 2. Definition Characteristics ExamplesNon-examples Input Graphic.
Advertisements

Data Representation (in computer system) Computer Fundamental CIM2460 Bavy LI.
 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.
Introduction to Number Systems
Number Systems.
Computer Systems Chapter 1 Pages Hardware-physical pieces Key hardware components in a computer system: The physical parts. – Central processing.
Data Representation S2. This unit covers how the computer represents- Numbers Text Graphics Control.

Number Representation. Representing numbers n Numbers are represented as successive powers of a base, or radix.
+ Fractions and Decimals Review 10/12/12. + Question 1 Which number is greater? -0.5 or -0.6.
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.
Lesson 8 – Binary Numbers Computer Programming 12.
1 3 Computing System Fundamentals 3.2 Computer Architecture.
Bits and Bytes. Decimal Numbers 6,357 has four digits -base-10 (6 * 1000) + (3 * 100) + (5 * 10) + (7 * 1) = = 6357 (6 * 10^3) + (3.
Visualizing Decimal and Binary
THE BINARY NUMBER SYSTEM “There are only 10 types of people in this world: Those who understand BINARY and those who do not.”
Binary A double zero educational presentation. Binary Basics Binary is the language computers use Only 1’s and 0’s can be found in Binary Very large numbers.
1 1 7-Dec-15 Binary Converting to and from decimal.
Binary System Presented by Mr. Wilhelmi Internal Representation of Data Input Input  Data that is put into the computer for processing Data Data  The.
Lecture 6 Excess Notation. Excess 8 notation indicates that the value for zero is the bit pattern for 8, that is 1000 Excess 8 notation indicates that.
Computer Number System
Binary 101 Gads Hill School. Aim To strengthen understanding of how computers use the binary number system to store information.
Fractions and Decimal Fractions Fractions Decimal Fractions
Computer Studies Today Chapter 19 1 Chapter 19. Computer Studies Today Chapter 19 2 »Information stored in a computer is in two states: –ON –OFF.
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.
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.
Dr. Clincy Slide 1 CS Chapter 2 (Part 1 of 3) Dr. Clincy Professor of CS Ch 2 Appendix pages will not be on the exam – already covered this.
Number Systems Decimal Can you write 12,045 in expanded form? Base? Allowable digits for each place?
Floating Point Numbers
Nat 4/5 Computing Science Lesson 1: Binary
Programmable Logic Controller
Objectives Today: P4 Data Types – Floating Points P4 Variable Quiz P3 Iteration and Selection Practical Are you logged on? Then come around the table Unit.
Cosc 2150: Computer Organization
Binary & Hex Review.
Consider this number: , Ones (7 ones) Tens (no tens)
BINARY CODE.
Dr. Clincy Professor of CS
Computer Fundamentals
Chapter 2 – Computer hardware
इंट्रस्टिंग बनने के लिए आपको इंट्रस्टेड होना पड़ेगा।
Visualizing Decimal and Binary
How do computers work? Storage.
Principles of Computing – UFCFA Lecture-3
Dr. Clincy Professor of CS
Binary Lesson 3 Hexadecimal
Binary Lesson 2 Bytes.
Everything that goes on under the hood of a computer is done in binary -- the language of 0s and 1s. If we have only two numbers, it's very easy to represent.
Binary Lesson 2 Bytes.
Binary Lesson 3 Hexadecimal
Number Systems Lecture 2.
Binary Lesson 3 Hexadecimal
Data Binary Conversion.
C1 Number systems.
Plan Attendance Files Posted on Campus Cruiser Homework Reminder
Binary Lesson 2 Bytes.
Number Systems.
How Computers Store Data
Binary Lesson 3 Hexadecimal
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.
Binary Addition (1 of 2) Two 1-bit values A B A + B 1
Storing Integers and Fractions
Write the number that is half way between these 2 numbers.
Binary System.
Binary Lesson 4 Hexadecimal and Binary Practice
The Understanding of Binary Math & Conversion
Binary & Hex Review.
Electronic Memory.
Chapter 3 - Binary Numbering System
Binary Lesson 7 Review of Binary and Hexadecimal
Presentation transcript:

How to Represent Numbers on a Computer Digital Data How to Represent Numbers on a Computer

Memory: One Bulb On=Yes Off=No Memory is made up of two-state devices, like a light bulb. One bulb has two states. We could store two things (yes or no). On=Yes Off=No

Two bulbs, four states: Off, off: Off, on: On, off: On, on: No, no No, yes Yes, no Yes, Yes

Three bulbs, eight states: Off, off, off Off, off, on Off, on, off Off, on, on On, off, off On, off, on On, on, off On, on, on

Four bulbs, 16 states:

Pretend they are numbers, where off=0 and on=1: 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111

How do we interpret the numbers? Base 10 numbers: 10 digits: 0 through 9 Place value is based on powers of 10 ___ ___ ___ ___ ___ ___ 105 104 103 102 101 100 100,000 10,000 1,000 100 10 1

Base 10 1 2 3 4 5 6 . 105 104 103 102 101 100 100,000 10,000 1,000 100 10 1 So 123,456 = 1 * 100,000 = 100,000 2 * 10,000 = 20,000 3 * 1,000 = 3,000 4 * 100 = 400 5 * 10 = 50 6 * 1 = 6 123,456

With 2 digits: Base 2 number system: __ __ __ __ __ __ __ __ 2 digits: 0 through 1 Place value is based on powers of 2 __ __ __ __ __ __ __ __ 27 26 25 24 23 22 21 20 128 64 32 16 8 4 2 1

Base 2 1 0 1 0 1 0 1 0 __ __ __ __ __ __ __ __ 27 26 25 24 23 22 21 20 128 64 32 16 8 4 2 1 So 10101010= 1 * 128 = 128 0 * 64 = 0 1 * 32 = 32 0 * 16 = 0 1 * 8 = 8 0 * 4 = 0 1 * 2 = 2 0 * 1 = 0 170

The first 8 binary numbers (with leading zeros) 0000= 0+0+0+0 = 0 0001= 0+0+0+1 = 1 0010= 0+0+2+0 = 2 0011= 0+0+2+1 = 3 0100= 0+4+0+0 = 4 0101= 0+4+0+1 = 5 0110= 0+4+2+0 = 6 0111= 0+4+2+1 = 7

Binary numbers are represented in BYTES – groups of 8 bits Byte: a group of 8 bits. The basic unit of storage on most computers. 0 = 0000 0000 1 = 0000 0001 2 = 0000 0010 3 = 0000 0011 4 = 0000 0100 5 = 0000 0101 6 = 0000 0110 7 = 0000 0111

Some other binary numbers 0000 0000 = 0 0101 0101 = 1 + 4 + 16 + 64 = 85 1000 0001 = 1 + 128 = 129 1111 1111 = 1 + 2 + 4 + 8 + 16 + 32 +64 + 128 = 255

Need numbers greater than 255? Use two bytes: Smallest number = 0000 0000 0000 0000 Biggest number = 1111 1111 1111 1111 = 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 + 256 + 512 + 1024 + 2048 + 4096 + 8192 + 16,384 + 32,768 = 65,535

Need numbers greater than 65,535? Use 4 bytes: Smallest number: 0000 0000 0000 0000 0000 0000 0000 0000 Biggest number: 1111 1111 1111 1111 1111 1111 1111 1111 = 4,294,967,295

Other numbers There are also ways to represent: Decimal fractions Negative numbers These will be covered elsewhere.

The End