DECIMAL, BINARY, AND HEXADECIMAL. Decimal Numbering System Ten symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Represent larger numbers as a sequence of digits.

Slides:



Advertisements
Similar presentations
NUMBER SYSTEM. How to convert hexadecimal numbers to decimal numbers? 230 Working from right to left, MULTIPLY each position with 8 raised to the power.
Advertisements

John Owen, Rockport Fulton HS
DATA REPRESENTATION CONVERSION.
James Tam Beyond base 10: Non-decimal based number system What exactly is decimal? How do other number systems work (binary, octal and hex) How to convert.
Binary Conversion In today’s lesson we will link together the binary and algorithm topics by looking at how to get the computer to: convert binary to decimal.
Converting Binary to Octal
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)
Number Systems.
ECE 2110: Introduction to Digital Systems Signed Number Conversions.
Supplemental Chapter Number Bases
Number Systems Ron Christensen CIS 121.
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.
CMSC 104, Lecture 051 Binary / Hex Binary and Hex The number systems of Computer Science.
Converting From decimal to Binary & Hexadecimal to Binary
Number Systems Binary to Decimal Octal to Decimal Hexadecimal to Decimal Binary to Octal Binary to Hexadecimal Two’s Complement.
How a Computer Processes Information. Java – Numbering Systems OBJECTIVE - Introduction to Numbering Systems and their relation to Computer Problems Review.
AEEE2031 Data Representation and Numbering Systems.
1 Computer Science LESSON 1 on Number Bases. 2 Objective In this lesson you’ll learn about different Number Bases, specifically about those used by the.
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
Number Representation (Part 1) Computer Architecture (Fall 2006)
NUMBER SYSTEMS.
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
ECE 3110: Introduction to Digital Systems Signed Number Conversions and operations.
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.
Number Systems. ASCII – American Standard Code for Information Interchange – Standard encoding scheme used to represent characters in binary format on.
Computer Maintenance Numbering Systems Copyright © Texas Education Agency, All rights reserved.1.
ECE 2110: Introduction to Digital Systems Signed Number Conversions.
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
Appendix F Number Systems binary 0, 1 0, 1, 2, 3, 4, 5, 6, 7
Topic: Binary Encoding – Part 1
Computer Maintenance Numbering Systems Trade & Industrial Education
Binary Numbers CSE 351 Spring 2017
Discrete Mathematics Numbering System.
Integer Real Numbers Character Boolean Memory Address CPU Data Types
Base ‘b’ number for i = 0 to n – 1 for an n digit quantity
Location in course textbook
2.0 COMPUTER SYSTEM 2.2 Number System and Representation
Tools of Web Development 1: Module A: Numbering Systems
Number System conversions
Binary Quiz UIN: ____________________
Introduction to IT By: Muhammed s. anwar.
Binary Numbers CSE 120 Spring 2017
Binary, Octal and Hex Numbers Copyright Thaddeus Konar
Digital Electronics Ms. Deepa Mehta.
Dr. Clincy Professor of CS
Numbering System TODAY AND TOMORROW 11th Edition
Binary Lesson 3 Hexadecimal
Binary, Octal and Hex Numbers Copyright Thaddeus Konar
Digital Electronics and Microprocessors
Binary Lesson 3 Hexadecimal
Chapter 1 Number System RGGP, Narwana.
Binary Lesson 3 Hexadecimal
How Computers Store Data
Computer Organization
Binary Lesson 3 Hexadecimal
AP Computer Science LESSON 1 on Number Bases.
Binary Addition (1 of 2) Two 1-bit values A B A + B 1
Numeral systems (radix)
Binary Lesson 4 Hexadecimal and Binary Practice
GCSE COMPUTER SCIENCE Topic 3 - Data 3.4 Hexadecimal Conversion.
CS334: Number Systems Lab 1.
Beyond Base 10: Non-decimal Based Number Systems
Information Representation
Number systems Converting numbers between binary, octal, decimal, hexadecimal (the easy way)
Binary Lesson 7 Review of Binary and Hexadecimal
Presentation transcript:

DECIMAL, BINARY, AND HEXADECIMAL

Decimal Numbering System Ten symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Represent larger numbers as a sequence of digits Each digit is one of the available symbols Example: 7061 in decimal (base 10) = (7 x 10 3 ) + (0 x 10 2 ) + (6 x 10 1 ) + (1 x 10 0 )

Octal Numbering System Eight symbols: : 0, 1, 2, 3, 4, 5, 6, 7 Notice that we no longer use 8 or 9 Base Comparison: Base 10: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12… Base 8: 0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14… Example: What is 15 8 in base 10? 15 8 = (1 x 8 1 ) + (5 x 8 0 ) = Example: What is in base 10? = (7 x 8 3 ) + (0 x 8 2 ) + (6 x 8 1 ) + (1 x 8 0 ) =

Question What is 34 8 in base 10? (A)32 10 (B)34 10 (C)7 10 (D)28 10 (E)35 10

Binary Numbering System Binary is base 2 Symbols: 0, 1 Convention: 2 10 = 10 2 = 0b10 Example: What is 0b110 in base 10? 0b110 = = (1 x 2 2 ) + (1 x 2 1 ) + (0 x 1 0 ) = 6 10 Base 10Base 8Base

Hexadecimal Number System Hexadecimal is base 16 (>10) Symbols? 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, …? Convention: = = 0x10 Example: What is 0xA5 in base 10? 0xA5 = A5 16 = (10 x 16 1 ) + (5 x 16 0 ) = , 9, A, B, C, D, E, F

Question Which of the following orderings is correct? (A)0xC < 0b1010 < 11 (B)0xC < 11 < 0b1010 (C)11 < 0b1010 < 0xC (D)0b1010 < 11 < 0xC (E)0b1010 < 0xC < 11

BASE CONVERSION

Converting to Base 10 Can convert from any base to base =(1 x 2 2 ) + (1 x 2 1 ) + (0 x 1 0 ) = xA5 = A5 16 =(10 x 16 1 ) + (5 x 16 0 ) = We learned to think in base 10, so this is fairly natural for us Challenge: Convert into other bases (e.g. 2, 16)

Challenge Question Convert to binary Hints: 2 3 = = = = 1

Converting from Decimal to Binary Given a decimal number N: List increasing powers of 2 from right to left until ≥ N From left to right, ask is that (power of 2) ≤ N? – If YES, put a 1 below and subtract that power from N – If NO, put a 0 below and keep going Example for 13: 2 4 =162 3 =82 2 =42 1 =22 0 =

Converting from Decimal to Base B Given a decimal number N: List increasing powers of B from right to left until ≥ N From left to right, ask is that (power of B) ≤ N? – If YES, put how many of that power go into N and subtract from N – If NO, put a 0 and keep going Example for 165 into hexadecimal (base 16): 16 2 = = =1 5 0 A (10)50

Base 10Base 16Base A B C D E F1111

Convert 0b How many digits? Pad: 0b Substitute: 0x4DAD Base 10Base 16Base A B C D E F1111 ? 15

Why are we learning this? Why does all of this matter? Humans think about numbers in base 10 but computers think about numbers in base 2 How is it that computers can do all of the amazing things that they do? – Binary encoding

BINARY ENCODING

Numerical Encoding

Binary Encoding ? 2 N

So What’s It Mean? A sequence of bits can have many meanings! Consider the hex sequence 0x4E6F21 Common interpretations include: The decimal number The characters “No!” The background color of this slide The real number x [floating point] It is up to the program/programmer to decide how to interpret the sequence of bits

Summary Humans think about numbers in decimal; computers think about numbers in binary Base conversion to go between Hex is more human-readable than binary All information on a computer is in binary Nice because big difference between “high” and “low” Binary encoding can represent anything! Program needs to know how to interpret bits

Summary