COMS 161 Introduction to Computing

Slides:



Advertisements
Similar presentations
DATA REPRESENTATION CONVERSION.
Advertisements

HEXADECIMAL NUMBERS Code
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Number Systems Decimal (Base 10) Binary (Base 2) Hexadecimal (Base 16)
Data Representation in Computers
IT-101 Section 001 Lecture #4 Introduction to Information Technology.
Binary Numbers.
CCE-EDUSAT SESSION FOR COMPUTER FUNDAMENTALS Date: Session III Topic: Number Systems Faculty: Anita Kanavalli Department of CSE M S Ramaiah.
1.6 Signed Binary Numbers.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
1 COMS 161 Introduction to Computing Title: The Digital Domain Date: September 1, 2004 Lecture Number: 4.
Representing text Each of different symbol on the text (alphabet letter) is assigned a unique bit patterns the text is then representing as.
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
Binary Arithmetic & Data representation
1 Digital Systems and Binary Numbers EE 208 – Logic Design Chapter 1 Sohaib Majzoub.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 2 Number.
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: October 29, 2004 Lecture Number: 26.
Introduction to Computer Design CMPT 150 Section: D Ch. 1 Digital Computers and Information CMPT 150, Chapter 1, Tariq Nuruddin, Fall 06, SFU 1.
Computing Theory – F453 Number Systems. Data in a computer needs to be represented in a format the computer understands. This does not necessarily mean.
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: October 20, 2004 Lecture Number: 23.
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
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.
1 COMS 161 Introduction to Computing Title: The Digital Domain Date: September 6, 2004 Lecture Number: 6.
Data Representation, Number Systems and Base Conversions
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
1 COMS 161 Introduction to Computing Title: Computing Basics Date: September 8, 2004 Lecture Number: 7.
Introduction to Digital Electronics Lecture 2: Number Systems.
CEC 220 Digital Circuit Design Binary Codes Mon, Aug 31 CEC 220 Digital Circuit Design Slide 1 of 14.
Nguyen Le CS147.  2.4 Signed Integer Representation  – Signed Magnitude  – Complement Systems  – Unsigned Versus Signed Numbers.
CHAPTER 3 BINARY NUMBER SYSTEM. Computers are electronic machines which operate using binary logic. These devices use two different values to represent.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
Some basic concepts underlying computer archi­tecture
Data Representation COE 308 Computer Architecture
Chapter 2 Binary Number Systems.
Number Systems and Codes
Data Representation ICS 233
Data Representation.
EI205 Lecture 2 Dianguang Ma Fall, 2008.
Digital Logic and Computer Organization
Lecture No. 4 Number Systems
3.1 Denary, Binary and Hexadecimal Number Systems
CSCI 198: Lecture 4: Data Representation
CHAPTER 1 : INTRODUCTION
CSCI 161: Lecture 4: Data Representation
Logistics Always read the Calendar at
Introduction The term digital is derived from the way computers perform operation, by counting digits. Application of digital technology: television, communication.
Chapter 3 Data Representation
Number Systems.
Chapter 1 Digital Systems and Binary Numbers
University of Gujrat Department of Computer Science
BEE1244 Digital System and Electronics BEE1244 Digital System and Electronic Chapter 2 Number Systems.
Number Systems and Codes
Numbering System TODAY AND TOMORROW 11th Edition
Information Representation
COMS 161 Introduction to Computing
COMS 161 Introduction to Computing
COMS 161 Introduction to Computing
C1 Number systems.
2’s Complement form 1’s complement form 2’s complement form
Data Representation ICS 233
Lecture 2: Number Systems
Beyond Base 10: Non-decimal Based Number Systems
COMS 161 Introduction to Computing
Chapter 3 - Binary Numbering System
Data Representation COE 308 Computer Architecture
Presentation transcript:

COMS 161 Introduction to Computing Title: Digital Numbers Date: February 4, 2005 Lecture Number: 11

Announcements

Review Numbers Decimal to Binary Conversion Adding binary numbers Subtraction Method Adding binary numbers

Outline Numbers Signed numbers Hexadecimal Binary Coded Decimal (BCD) Binary to hexadecimal conversion Binary Coded Decimal (BCD)

Binary Number System How about representing negative numbers? Let the left most bit represent the sign (+, -) of the number Called signed magnitude representation [s][mag]

Signed Magnitude One less bit to represent the magnitude

Signed Magnitude Problems Two values of 0 Incorrect arithmetic More difficult to detect than one value of 0 Incorrect arithmetic 2 – 1 = 2 + (-1) = 1

Two’s Complement Representation Sign bit in a sense Positive numbers The leading bit (left most) is zero The same as signed magnitude Negative numbers The leading bit is one Defined so that when added to their corresponding positive number the answer is zero

Two’s Complement Representation Bit Pattern Value 0000 1000 -8 0001 1 1001 -7 0010 2 1010 -6 0011 3 1011 -5 0100 4 1100 -4 0101 5 1101 -3 0110 6 1110 -2 0111 7 1111 -1

Two’s Complement Representation Both problems with the signed magnitude representation are solved with two’s complement representation There is only value of zero Arithmetic is correct Solution is in two’s complement form 2 – 1 = 2 + (-1) = 1

Digital Letters Digital system All entities are represented as numbers How do we represent the letters in the English language The letters form a discrete set (unique unambiguous, precise) No sampling is needed Simply need a mapping from each letter to a numerical representation A = 65 B = 66

Digital Letters Important that all converters use the same mapping Otherwise the inverse process (converting a number to a letter) would give incorrect results Computers in the US primarily use the American Standard Code for Information Interchange (ASCII) Unicode is an international standard Combatable but extends the ASCII standard

ASCII mapping How many bits will I need to encode the letters of the English alphabet? Upper case Lower case Decimal digits Punctuation Arithmetic symbols Printer control characters

ASCII mapping Letters in the English language A = 6510 = 0100 00012 B = 6610 = 0100 00102 … Z = 9010 = 0101 10102 a = 9710 = 0110 00012 z = 12210 = 0111 10102 Numbers are still left over for punctuation

ASCII Table

Binary number system Precision The number of bits used to represent an item Letter: precision of 8 bits Integer (whole number): precision of 32 or 64 bits Always finite Computers have finite precision Presents some limitations

Hexadecimal number system Sometimes called hex Positional, base-16 system Each digit is multiplied by a power of 16 Sixteen unique symbols (digits) 0, 1, 2, …, 15 Symbol a or A for 10 Symbol b or B for 11 Symbol e or E for 14 Symbol c or C for 12 Symbol f or F for 15 Symbol d or D for 13

Hexadecimal number system A hex number can represent 16 different items Equivalent to 4 bits Makes it easy to convert between binary and hex Group bits by 4’s from the right end Substitute the hex symbol 9010 = 0101 10102 = 5A16 Is the base 16 really needed? 6610 = 0100 00102 = 4216

Hexadecimal number system Use the backwards conversion to convert hex to binary One hex digit is equivalent to 4 bits Substitute the binary nibble Always start at the right end Add zeros to the left end as necessary to fill in 4 bits

Hexadecimal number system BIN 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001 A 10 1010 B 11 1011 C 12 1100 D 13 1101 E 14 1110 F 15 1111

Hexadecimal to decimal conversion Same procedure as converting a binary number to a decimal number The digits of the hex number are the coefficients of the corresponding positional weighting factor ABC16 = 0xABC = A * 162 + B * 161 + C * 160 = A * 256 + B * 16 + C * 1 = 10 * 256 + 11 * 16 + 12 * 1 = 2560 + 176 + 12 = 274810

Digitization The process of converting analog information into binary Discrete forms are unambiguous Text and numbers are discrete Conversion of discrete to digital Come up with a mapping As we did with the letters

Binary Coded Decimal Integers (whole numbers) One mapping is to use its binary equivalent Binary Coded Decimal (BCD) 010 = 00002 110 = 00012 … 910 = 10012 Need a minimum of 4 bits to represent 10 different values Some 4 bit quantities are wasted

Binary Coded Decimal String of decimal digits Each decimal digit is represented by 4 bits The number of bits needed to represent different numbers vary Performing arithmetic is complicated Why? 15910 = 00012 01012 10012