REPRESENTING INFORMATION: BINARY, HEX, ASCII C ORRESPONDING R EADING : UDC C HAPTER 2 CMSC 150: Lecture 2.

Slides:



Advertisements
Similar presentations
CMSC 150 DATA REPRESENTATION CS 150: Mon 30 Jan 2012.
Advertisements

EE1A2 Microprocessor Systems & Digital Logic Part I Digital Electronic System Design Dr. T. Collins.
Hexadecimal In today’s lesson we will look at: the need for something other than binary how hexadecimal works how to convert between hexadecimal and binary.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 1.
Data Representation in Computers
Number Systems and Codes Discussion D4.1. Number Systems Counting in Binary Positional Notation Hexadecimal Numbers Negative Numbers.
Binary and Decimal Numbers
1 12/08/03SW Abingdon and Witney College Binary Converting to and from decimal.
Bits, Bytes, KiloBytes, MegaBytes, GigaBytes & TeraBytes.
1 Survey of Computer Science CSCI 110, Spring 2011 Lecture 16 Digital Circuits, binary Numbers.
(2.1) Fundamentals  Terms for magnitudes – logarithms and logarithmic graphs  Digital representations – Binary numbers – Text – Analog information 
Memory Terminology & Data Representation CSCI 1060 Fall 2006.
Abstraction – Number Systems and Data Representation.
Copyright © Cengage Learning. All rights reserved. CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS THE LOGIC OF COMPOUND STATEMENTS.
Chapter 3 Representing Numbers and Text in Binary Information Technology in Theory By Pelin Aksoy and Laura DeNardis.
Binary Numbers and ASCII and EDCDIC Mrs. Cueni. Data Representation  Human speech is analog because it uses continuous signals (waves) that vary in strength.
COMPUTER NUMBER SYSTEMS & DIGITAL DEVICES By: Sohaib Rehman.
Binary Arithmetic & Data representation
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
Chapter 3 Section 1 Number Representation Modern cryptographic methods, unlike the classical methods we just learned, are computer based. Representation.
The Teacher CP4 Binary and all that… CP4 Revision.
Number Representation. Representing numbers n Numbers are represented as successive powers of a base, or radix.
CMSC 104, Lecture 051 Binary / Hex Binary and Hex The number systems of Computer Science.
1 IT 231, CMPE 331 Digital Logic Design Week 2 Number systems and arithmetic.
The Teacher CP4 Binary and all that… CP4 Revision.
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.
1 Data Representation Characters, Integers and Real Numbers Binary Number System Octal Number System Hexadecimal Number System Powered by DeSiaMore.
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.
Data Representation Conversion 24/04/2017.
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.
Data Representation, Number Systems and Base Conversions
Hexadecimal. Overview Hexadecimal (hex) ~ base 16 number system Use 0 through 9 and... A = 10 B = 11 C = 12 D = 13 E = 14 F = 15.
Computer Math CPS120 Introduction to Computer Science Lecture 4.
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
Introduction to Microprocessors Chapter 2. Decimal or Base 10 Numbers  Have ten different digits (0-9)  It is a weighted number system. Each position.
Agenda Character representation Numerical Conversions ASCII EBCDIC
Number Systems by Dr. Amin Danial Asham. References  Programmable Controllers- Theory and Implementation, 2nd Edition, L.A. Bryan and E.A. Bryan.
CS 125 Lecture 3 Martin van Bommel. Overflow In 16-bit two’s complement, what happens if we add =
CMSC 1041 Binary / Hex Binary and Hex The number systems of Computer Science.
Computer Math CPS120 Introduction to Computer Science Lecture 7.
Number Systems. ASCII – American Standard Code for Information Interchange – Standard encoding scheme used to represent characters in binary format on.
Chapter 01 Numbers. Chapter 02 Base 10 example Decimal Number Place Place (place - 1) ===============================
CHAPTER 3 BINARY NUMBER SYSTEM. Computers are electronic machines which operate using binary logic. These devices use two different values to represent.
COMPUTER ORGANIZATION 4 TH LECTURE. ASCII Code  ASCII ( American Standard Code for Information Interchange).  Input and output devices that communicate.
Programmable Logic Controller
Some basic concepts underlying computer archi­tecture
Decimal Numbers.
NUMBER SYSTEMS.
Binary Numbers and ASCII and EDCDIC
Discrete Mathematics Numbering System.
Unit 18: Computational Thinking
CSCI 198: Lecture 4: Data Representation
CSCI 161: Lecture 4: Data Representation
Data Encoding Characters.
Coding Schemes and Number Systems
Number Systems and Codes
Numbering System TODAY AND TOMORROW 11th Edition
COMS 161 Introduction to Computing
Binary Lesson 3 Hexadecimal
Binary Lesson 3 Hexadecimal
COMS 161 Introduction to Computing
2’s Complement form 1’s complement form 2’s complement form
Binary Lesson 3 Hexadecimal
Copyright © Cengage Learning. All rights reserved.
Abstraction – Number Systems and Data Representation
Beyond Base 10: Non-decimal Based Number Systems
UNIT – 3 & 4. Data Representation and Internal
Presentation transcript:

REPRESENTING INFORMATION: BINARY, HEX, ASCII C ORRESPONDING R EADING : UDC C HAPTER 2 CMSC 150: Lecture 2

Controlling Information Watch Newman on YouTube

Inside the Computer: Gates AND Gate Input Wires Output Wire 's & 1's represent low & high voltage, respectively, on the wires

Inside the Computer: Gates

Representing Information  We need to understand how the 0's and 1's can be used to "control information"

The Decimal Number System  Deci- (ten)  Base is ten  first (rightmost) place: ones (i.e., 10 0 )  second place: tens (i.e., 10 1 )  third place: hundreds (i.e., 10 2 )  …  Digits available: 0, 1, 2, …, 9 (ten total)

Example: your favorite number… 8,675,309

The Binary Number System  Bi- (two)  bicycle, bicentennial, biphenyl  Base two  first (rightmost) place: ones (i.e., 2 0 )  second place: twos (i.e., 2 1 )  third place: fours (i.e., 2 2 )  …  Digits available: 0, 1 (two total)

Representing Decimal in Binary  Moving right to left, include a "slot" for every power of two <= your decimal number  Moving left to right:  Put 1 in the slot if that power of two can be subtracted from your total remaining  Put 0 in the slot if not  Continue until all slots are filled filling to the right with 0's as necessary

Example  8,675, =  Fewer available digits in binary: more space required for representation

Converting Binary to Decimal  For each 1, add the corresponding power of two 

Converting Binary to Decimal  For each 1, add the corresponding power of two  =

Now You Get The Joke THERE ARE 10 TYPES OF PEOPLE IN THE WORLD: THOSE WHO CAN COUNT IN BINARY AND THOSE WHO CAN'T

Too Much Information?

An Alternative to Binary?  = 8,675,  = 8,544,237 10

An Alternative to Binary?  = 8,675,  = 8,544,237 10

An Alternative to Binary?  What if this was km to landing?

The Hexadecimal Number System  Hex- (six) Deci- (ten)  Base sixteen  first (rightmost) place: ones (i.e., 16 0 )  second place: sixteens (i.e., 16 1 )  third place: two-hundred-fifty-sixes (i.e., 16 2 )  …  Digits available: sixteen total 0, 1, 2, …, 9, A, B, C, D, E, F

Using Hex  Can convert decimal to hex and vice-versa  process is similar, but using base 16 and 0-9, A-F  Most commonly used as a shorthand for binary  Avoid this

More About Binary  How many different things can you represent using binary:  with only one slot (i.e., one bit)?  with two slots (i.e., two bits)?  with three bits?  with n bits?

More About Binary  How many different things can you represent using binary:  with only one slot (i.e., one bit)? 2  with two slots (i.e., two bits)? 2 2 = 4  with three bits? 2 3 = 8  with n bits? 2 n

Binary vs. Hex  One slot in hex can be one of 16 values 0, 1, 2, …, 9, A, B, C, D, E, F  How many bits do you need to represent one hex digit?

Binary vs. Hex  One slot in hex can be one of 16 values 0, 1, 2, …, 9, A, B, C, D, E, F  How many bits do you need to represent one hex digit?  4 bits can represent 2 4 = 16 different values

Binary vs. Hex A1010 B1011 C1100 D1101 E1110 F1111

Converting Binary to Hex  Moving right to left, group into bits of four  Convert each four-group to corresponding hex digit 

Converting Hex to Binary  Simply convert each hex digit to four-bit binary equivalent  BEEF 16 =

Representing Different Information  So far, everything has been a number  What about characters? Punctuation?  Idea:  put all the characters, punctuation in order  assign a unique number to each  done! (we know how to represent numbers)

Our Idea  A: 0  B: 1  C: 2  …  Z: 25  a: 26  b: 27  …  z: 51 , : 52 . : 53  [space] : 54  …

ASCII: American Standard Code for Information Interchange

'A' = = ??? 2 'q' = = ??? 2 '8' = = ??? 2

ASCII: American Standard Code for Information Interchange 256 total characters… How many bits needed?

The Problem with ASCII  What about Greek characters? Chinese?  UNICODE: use 16 bits  How many characters can we represent?

The Problem with ASCII  What about Greek characters? Chinese?  UNICODE: use 16 bits  How many characters can we represent?  2 16 = 65,536

You Control The Information  What is this?

You Control The Information  What is this?  Depends on how you interpret it:  =  = 'M'  = one million one thousand one hundred and one  You must be clear on representation and interpretation