COMS 161 Introduction to Computing

Slides:



Advertisements
Similar presentations
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Advertisements

CS 151 Digital Systems Design Lecture 3 More Number Systems.
CS 61C L02 Number Representation (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C.
Data Representation in Computers
ENGIN112 L3: More Number Systems September 8, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems.
Binary Numbers.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
1 COMS 161 Introduction to Computing Title: The Digital Domain Date: September 1, 2004 Lecture Number: 4.
Numeral Systems Subjects: Numeral System Positional systems Decimal
IT-101 Section 001 Lecture #3 Introduction to Information Technology.
1 Digital Technology and Computer Fundamentals Chapter 1 Data Representation and Numbering Systems.
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
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.
Information Representation. Digital Hardware Systems Digital Systems Digital vs. Analog Waveforms Analog: values vary over a broad range continuously.
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: October 20, 2004 Lecture Number: 23.
CCE-EDUSAT SESSION FOR COMPUTER FUNDAMENTALS Date: Session III Topic: Number Systems Faculty: Anita Kanavalli Department of CSE M S Ramaiah.
Lecture 2 Binary Values and Number Systems. The number 943 is an example of a number written in positional notation. The relative positions of the digits.
1 COMS 161 Introduction to Computing Title: The Digital Domain Date: September 6, 2004 Lecture Number: 6.
AEEE2031 Data Representation and Numbering Systems.
1 COMS 161 Introduction to Computing Title: The Digital Domain Date: September 3, 2004 Lecture Number: 5.
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.
ECE DIGITAL LOGIC LECTURE 2: DIGITAL COMPUTER AND NUMBER SYSTEMS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/14/2016.
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.
Digital logic COMP214  Lecture 2 Dr. Sarah M.Eljack Chapter 1 1.
Dr. ClincyLecture 2 Slide 1 CS Chapter 2 (1 of 5) Dr. Clincy Professor of CS Note: Do not study chapter 2’s appendix (the topics will be covered.
Representing Positive and Negative Numbers
Data Representation COE 308 Computer Architecture
Introduction To Number Systems
Data Representation ICS 233
Data Representation.
EI205 Lecture 2 Dianguang Ma Fall, 2008.
Digital Logic and Computer Organization
Number Representation
Digital Electronics INTRODUCTION ANALOG VS DIGITAL NUMBER SYSTEMS.
CHAPTER 1 : INTRODUCTION
Data Representation in Computer Systems
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.
COMPUTING FUNDAMENTALS
ITE102 – Computer Programming (C++)
Octal & Hexadecimal Number Systems
Octal & Hexadecimal Number Systems
Chapter 3 Data Representation
Number System conversions
Octal & Hexadecimal Number Systems
Fundamentals & Ethics of Information Systems IS 201
IT 0213: INTRODUCTION TO COMPUTER ARCHITECTURE
BEE1244 Digital System and Electronics BEE1244 Digital System and Electronic Chapter 2 Number Systems.
MMNSS COLLEGE,KOTTIYAM DEPARTMENT OF PHYSICS
Dr. Clincy Professor of CS
Digital Logic Design (ECEg3141) 2. Number systems, operations & codes 1.
COMS 161 Introduction to Computing
COMS 161 Introduction to Computing
CS 101 – Sept. 4 Number representation Integer Unsigned √ Signed √
COMS 161 Introduction to Computing
Chapter 3 DataStorage Foundations of Computer Science ã Cengage Learning.
Number Systems Rayat Shikshan Sanstha’s
Number Systems Rayat Shikshan Sanstha’s
Copyright © Cengage Learning. All rights reserved.
COMS 161 Introduction to Computing
Lecture 2: Number Systems
COMS 161 Introduction to Computing
COMS 161 Introduction to Computing
COMS 361 Computer Organization
CHAPTER 69 NUMBER SYSTEMS AND CODES
Data Representation COE 308 Computer Architecture
Presentation transcript:

COMS 161 Introduction to Computing Title: Digital Numbers Date: January 26, 2005 Lecture Number: 7

Announcements Homework 2 Read the paper “The World Wide Web” Be prepared to discuss it Why do sea-gulls fly over the sea? Because if they flew over the bay they would be bagels! A man left home running. He ran a ways and then turned left, ran the same distance and turned left again, ran the same distance and turned left again. When he got home there were two masked men. Who were they? A catcher and an umpire

Review Digital information Advantages Disadvantages

Outline Numbers Non-positional Positional Decimal Octal Hexadecimal Definition Decimal Octal Hexadecimal Unsigned and signed numbers Binary Coded Decimal (BCD)

Digital Domain Converting analog to digital information We need a digital representation of the information Recall, digital is a discrete system Where symbols are numbers The digital advantages Therefore, we need a numerical encoding of the data Numerical means numbers

Numbers Two types of notion used to represent numbers Non-positional notation No special significance is given to order Counting numbers on your fingers Tick mark counting method The number of items is important, not the order My honey do list Not important which task I do first, just so I get them all done

Numbers Positional notation Significance is given to order the digits appear in the number The decimal numbering system uses positional notation This is the system we use 365 is not the same a 653 These are completely different numbers They use the same digits

Positional notation 365 means Three hundreds Six tens Five ones Each digit is multiplied by a power of 10

Decimal number system Synonyms Decimal notation Base-10 system Both digits and their location in the number are important Ten unique symbols (digits) 0, 1, 2, …, 9

Octal number system Decimal is not the only positional number system available Octal Positional,base-8 system Each digit is multiplied by a power of 8 Eight unique symbols (digits) 0, 1, 2, …, 7

Binary number system Binary Positional, base-2 system Each digit is multiplied by a power of 2 Two unique symbols (digits), 0 and 1

Binary number system Digital and binary relationship The language of computers use binary digits Only 2 possible values 0 and 1 Much simpler to make electronics that distinguish between one of two values Distinguishing between more than two values is very difficult

Binary number system Since binary digits have two possible values Binary digits are called bits They only contain a little “bit” of information Numbers represented in binary form will (most likely) require more digits (bits) than the decimal form

Binary Number System How do 2 bits represent 4 values? Bit Pattern Numeric Value Item Represented 00 Black 01 1 White 10 2 Red 11 3 Green

Binary Number System How do 3 bits represent 8 values? Bit Pattern Numeric Value Item Represented 000 Black 001 1 White 010 2 Red 011 3 Green 100 4 Blue 101 5 Purple 110 6 Magenta 111 7 Sky blue

Binary Number System How do 4 bits represent 16 values? Bit Pattern 0000 1000 8 0001 1 1001 9 0010 2 1010 10 0011 3 1011 11 0100 4 1100 12 0101 5 1101 13 0110 6 1110 14 0111 7 1111 15

Binary Number System Bit patterns and numeric values are consistent with other slides Acceptable to add leading 0’s if desired

Binary number system To represent more information Lump together multiple bits called strings One bit: 2 values Two bits: 4 values (00, 01, 10, 11) Three bits: 8 values (000, 001, …, 111) Four bits: 16 values (0000, …, 1111) Five bits: 32 values Six bits: 64 values Seven bits: 128 values Eight bits: 256 values

Binary number system number of values = 2number of bits In general 1 = 20 2 = 21 4 = 22 8 = 23 16 = 24 32 = 25 64 = 26 128 = 27 256 = 28

Binary number system Common grouping 4 bits: nibble 8 bits: byte One byte represents 256 different values or items

Binary Number System We can represent the non-negative numbers (unsigned number) How about representing negative numbers? Let the left most bit represent the sign (+, -) of the number Called signed magnitude representation [s][mag] 0 – 2number of bits - 1

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 Problems with signed magnitude representation are solved with the 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

Binary number system Letters in the English language … Z = 9010 = 0101 10102 a = 9710 = 0110 00012 Z = 12210 = 0111 10102 Numbers are still left over for punctuation

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 left 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

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