CSE 111 Representing Numeric Data in a Computer Slides adapted from Dr. Kris Schindler.

Slides:



Advertisements
Similar presentations
Chapter 2: Data Representation
Advertisements

CSE 111 Binary Arithmetic Thanks to Dr. Schindler.
©Brooks/Cole, 2003 Chapter 3 Number Representation.
Computer ArchitectureFall 2007 © September 5, 2007 Karem Sakallah CS 447 – Computer Architecture.
Booth’s Algorithm.
CS 151 Digital Systems Design Lecture 3 More Number Systems.
Assembly Language and Computer Architecture Using C++ and Java
Number Systems Standard positional representation of numbers:
Assembly Language and Computer Architecture Using C++ and Java
COE 308: Computer Architecture (T032) Dr. Marwan Abu-Amara Integer & Floating-Point Arithmetic (cont.) (Appendix A, Computer Architecture: A Quantitative.
Floating Point Numbers
COE 308: Computer Architecture (T041) Dr. Marwan Abu-Amara Integer & Floating-Point Arithmetic (Appendix A, Computer Architecture: A Quantitative Approach,
ENGIN112 L3: More Number Systems September 8, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems.
S. Barua – CPSC 240 CHAPTER 2 BITS, DATA TYPES, & OPERATIONS Topics to be covered are Number systems.
Computer ArchitectureFall 2008 © August 27, CS 447 – Computer Architecture Lecture 4 Computer Arithmetic (2)
CSE 111 Representing Nonnumeric Data in a Computer.
Computer Science 210 Computer Organization Floating Point Representation.
Review Binary Basic Conversion Binary Decimal
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patterson and Hennessy Text.
Binary Number Systems.
School of Computer Science G51CSA 1 Computer Arithmetic.
Chapter 3 Data Representation part2 Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2010.
Binary Representation and Computer Arithmetic
Computer Systems 1 Fundamentals of Computing Negative Binary.
Chapter3 Fixed Point Representation Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Computer Arithmetic Nizamettin AYDIN
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
#1 Lec # 2 Winter EECC341 - Shaaban Positional Number Systems A number system consists of an order set of symbols (digits) with relations.
NUMBER REPRESENTATION CHAPTER 3 – part 3. ONE’S COMPLEMENT REPRESENTATION CHAPTER 3 – part 3.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Information Representation: Negative and Floating Point.
Computer Architecture
COMPSCI 210 Semester Tutorial 1
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: October 29, 2004 Lecture Number: 26.
Lecture Objectives: 1)Define the terms least significant bit and most significant bit. 2)Explain how unsigned integer numbers are represented in memory.
Introduction to Computer Engineering ECE/CS 252, Fall 2010 Prof. Mikko Lipasti Department of Electrical and Computer Engineering University of Wisconsin.
Calculating Two’s Complement. The two's complement of a binary number is defined as the value obtained by subtracting the number from a large power of.
Representation of Data Ma King Man. Reference Text Book: Volume 2 Notes: Chapter 19.
Engineering 1040: Mechanisms & Electric Circuits Spring 2014 Number Systems.
Chapter 3 Number Representation. Convert a number from decimal to binary notation and vice versa. Understand the different representations of an integer.
Number Systems Binary to Decimal Octal to Decimal Hexadecimal to Decimal Binary to Octal Binary to Hexadecimal Two’s Complement.
AEEE2031 Data Representation and Numbering Systems.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI N305 Information Representation: Negative Integer Representation.
CDA 3100 Fall2009. Special Thanks Thanks to Dr. Xiuwen Liu for letting me use his class slides and other materials as a base for this course.
Floating Point Binary A2 Computing OCR Module 2509.
IT1004: Data Representation and Organization Negative number representation.
Lec 11Systems Architecture1 Systems Architecture Lecture 11: Arithmetic for Computers Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some or all.
©Brooks/Cole, 2003 Chapter 3 Number Representation.
COMPUTER SCIENCE Data Representation and Machine Concepts Section 1.7 Instructor: Lin Chen Sept 2013.
In decimal we are quite familiar with placing a “-” sign in front of a number to denote that it is negative The same is true for binary numbers a computer.
Computer Organization 1 Data Representation Negative Integers.
May 2, 2001System Architecture I1 Systems Architecture I (CS ) Lecture 11: Arithmetic for Computers * Jeremy R. Johnson May 2, 2001 *This lecture.
Lecture No. 4 Computer Logic Design. Negative Number Representation 3 Options –Sign-magnitude –One’s Complement –Two’s Complement  used in computers.
COSC2410: LAB 2 BINARY ARITHMETIC SIGNED NUMBERS FLOATING POINT REPRESENTATION BOOLEAN ALGEBRA 1.
FLOATING-POINT NUMBER REPRESENTATION
Computer Science 210 Computer Organization
Computer Science 210 Computer Organization
Systems Architecture I
Number Representation
Systems Architecture I
Chapter3 Fixed Point Representation
Presentation transcript:

CSE 111 Representing Numeric Data in a Computer Slides adapted from Dr. Kris Schindler

Unsigned Binary Numbers Range: 0  2 n -1  where n is the number of bits Positional Notation Example: two

Unsigned Binary Numbers How do we convert from a decimal number to a binary number?  Continue until q=0

Unsigned Binary Numbers How do we convert from a decimal number to a binary number?  Example: 39 ten

Bit Positions MSB  Most Significant Bit  Leftmost Bit Position LSB  Least Significant Bit  Rightmost Bit Position

Signed Binary Numbers The most significant bit (leftmost) represents the sign  Negative (-): 1  Positive (+): 0

Signed Binary Numbers Computers represent signed numbers using two’s complement notation

Signed Binary Numbers Two’s Complement  Representation of a negative binary number  Consider an n-bit number, x  The two’s complement of the number is 2 n - x  This process is called taking the two’s complement of a number  Taking the two’s complement of a number negates it

Signed Binary Numbers Two’s Complement  Shortcut for taking the two’s complement of a number  Start at the least significant (rightmost) bit and move left (toward the most significant bit)  Keep every bit until you reach the first 1  Keep that 1  Invert every bit (0  1,1  0) after the first 1 as you continue to move left

Signed Binary Numbers Two’s Complement  Examples:  -4 Take the two’s complement of 4 ( ) = -4  -9 Take the two’s complement of 9 ( ) = -9  Since the above are negative, taking the two’s complement will allow you to determine the magnitude, which is the positive equivalent

Signed Binary Numbers Two’s Complement  Examples:  +6 Since the number is positive, you don’t need to take the two’s complement = +6  +18 Since the number is positive, you don’t need to take the two’s complement = +18

Signed Binary Numbers Two’s Complement  Since taking the two’s complement of a number negates it, taking the two’s complement twice gives you the original number back  Example:  +12 is represented by  Taking the two’s complement results in -12 ( )  Taking the two's complement of -12 results in +12 ( )

Floating Point Very large/small numbers Fractions Example  8.5 x 2 23  x 2 23  Normalized x 2 27  Exponent Bias = = 153 =  Significand:  Sign: 0  Number:

References J. Glenn Brookshear, Computer Science - An Overview, 11 th edition, Addison-Wesley as an imprint of Pearson, 2012 Donald D. Givone, Digital Principles and Design, McGraw-Hill, 2003 John L. Hennessy and David A. Patterson, Computer Organization and Design, The Hardware/Software Interface, 3 rd Edition, Morgan Kaufmann Publishers, Inc., 2005