CS 101 – Aug. 31 Interpreting binary  decimal √ Decimal  binary Shorthand ways of expressing binary –Octal –“Hex” Negative numbers.

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

Appendix 1 Number Systems Objectives: Review of number systems and radix conversion methods Review of binary, octal, hexadecimal and BCD unsigned codes.
DATA REPRESENTATION CONVERSION.
CS 151 Digital Systems Design Lecture 3 More Number Systems.
Agenda Shortcuts converting among numbering systems –Binary to Hex / Hex to Binary –Binary to Octal / Octal to Binary Signed and unsigned binary numbers.
Decimal Addition What is going on? (carry) (subtract the base)
ENGIN112 L3: More Number Systems September 8, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems.
1 Number Systems. 2 Numbers Each number system is associated with a base or radix – The decimal number system is said to be of base or radix 10 A number.
Two’s Complement 1.As an action: (Assume the starting value is 1011) 1.Flip the bits from the starting value => Add one to get the answer.
Binary, Decimal, & Hexadecimal Numbers
Number Systems Computer Science 210 Computer Organization.
Binary Number Systems.
NEGATIVE BINARY NUMBER – Digital Circuit 1 Choopan Rattanapoka.
Data Storage Introduction to computer, 2nd semester, 2010/2011 Mr.Nael Aburas Faculty of Information Technology Islamic.
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.
ECE 2110: Introduction to Digital Systems Signed Number Conversions.
Simple Data Type Representation and conversion of numbers
Newport Math Club Copyright © 2009 by Newport Math Club.
CS 101 – Sept. 2 Chapter 3: data representation Many kinds of data  all in binary Today: integers –Unsigned –Signed Later: text, images, code, etc.
A-Level Computing Data representation. Objectives Know how data can be represented in a computer system Understand the need for various forms of representation.
Numbering Systems CS208.
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
46 Number Systems Problem: Implement simple pocket calculator Need: Display, adders & subtractors, inputs Display: Seven segment displays Inputs: Switches.
Lecture 2 Bits, Bytes & Number systems
Number systems, Operations, and Codes
Introduction to Computing Dr. Nadeem A Khan. Lecture 10.
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.
ECE2030 Introduction to Computer Engineering Lecture 2: Number System Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Tech.
CPS120: Introduction to Computer Science Computer Math: Converting to Decimal.
NUMBER SYSTEMS Binary Base 2 Octal Base 8 DecimalBase 10 HexadecimalBase 16.
Digital Electronics Octal & Hexadecimal Number Systems.
Octal to Decimal Hexadecimal DecimalOctal Binary.
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
COMPUTER SCIENCE Data Representation and Machine Concepts Section 1.6 Instructor: Lin Chen Sept 2013.
CS 111 – Sept. 1 Intro to data representation Binary numbers –Convert binary  decimal –Convert decimal  binary Text –ASCII and Unicode Commitment: –For.
Digital Representations ME 4611 Binary Representation Only two states (0 and 1) Easy to implement electronically %0= (0) 10 %1= (1) 10 %10= (2) 10 %11=
69 Decimal (Base 10) Numbers n Positional system - each digit position has a value n 2534 = 2*1, * *10 + 4*1 n Alternate view: Digit position.
Octal & Hexadecimal Number Systems
NUMBER SYSTEMS.
CS 160 Lecture 4 Martin van Bommel. Overflow In 16-bit two’s complement, what happens if we add =
1 Digital Logic Design Lecture 2 More Number Systems/Complements.
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
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.
Cis303a_chapt03_exam1_answer.ppt CIS303A: System Architecture Exam 1: Chapter 3 Answer List the characters (digits) for the following bases. 1) Decimal:
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.
ECE 2110: Introduction to Digital Systems Signed Number Conversions.
Lecturer: Santokh Singh
Octal to Decimal Decimal Octal Binary Hexadecimal.
COMPUTER ORGANIZATION
Binary Positional Notation
Computer Science 210 Computer Organization
Number Systems.
Data Representation Integers
CSE 102 Introduction to Computer Engineering
TAO1221 COMPUTER ARCHITECTURE AND ORGANIZATION LAB 6
Binary, Octal and Hex Numbers Copyright Thaddeus Konar
Data Storage Introduction to computer, 2nd semester, 2010/2011
Binary Quiz UIN: ____________________
Computer Science 210 Computer Organization
Binary, Octal and Hex Numbers Copyright Thaddeus Konar
Unit 2.6 Data Representation Lesson 1 ‒ Numbers
Numbering Systems and Arithmetic operations on Hex, binary, and octal
Binary, Octal and Hex Numbers Copyright Thaddeus Konar
There are 10 types of people of people in this world…
CS 101 – Sept. 4 Number representation Integer Unsigned √ Signed √
Number Systems Rayat Shikshan Sanstha’s
Number Systems Rayat Shikshan Sanstha’s
Binary & Hex Review.
Information Representation
Presentation transcript:

CS 101 – Aug. 31 Interpreting binary  decimal √ Decimal  binary Shorthand ways of expressing binary –Octal –“Hex” Negative numbers

Number of Possible Values 1 bit: 0 and 1 2 bits: 00, 01, 10, 11 3 bits: 000, 001, …? For a given number of bits, how many patterns?

decimal  binary You already know binary  decimal But given a decimal number like 45, what is binary form? Binary numbers are longer than decimal. –(Ex. 5 digit number may require 15 bits) My technique is the “binary store”

Binary store At the Binary Store, price is a power of 2: $1, $2, $4, $8, $16… If you had $45, what could you buy? 45 = Write powers of 2: Write binary number:

Another example Let’s convert 61 to binary: Go to binary store with $61… 61 = = Finally:

Octal Octal means base 8: each digit is a power of 8. Because 8 = 2 3, each octal digit corresponds to 3 bits = = ?

Hexadecimal (“hex”) Base 16: each digit is a power of 16 Since 16 = 2 4, each hex digit corresponds to 4 bits. Hex also means we have 16 different digits. a = 10, b = 11, c = 12, d = 13, e = 14, f = 15

Hex examples = d = Now let’s go the other way: = ______ = _______ 16

Decimal  octal, hex Often the best way to come up with octal or hex is to go thru binary first. Ex. What is 71 in octal? –Binary store gives: 71 = –Binary number is –Grouped as octal: = We can check answer.

Why couldn’t the computer scientist tell the difference between Halloween (Oct 31) and Christmas (Dec 25) ?

Negatives? We can used a “signed” representation. We want half the rep’ns to be negative. Ex. 5 bits  32 numbers. –16 numbers are negative –Thus, range is –16 to +15. For n bits: range is –2 n–1 to 2 n – 1 – 1

How to represent negatives In ordinary (unsigned) binary, this was impossible! In signed: 3 steps to represent –x: 1.Find rep’n of +x. 2.Invert the bits. 3.Add 1. Try some examples.