Negative Number Sign-Magnitude: left-most bit as the sign bit –16 bits –Example: 4-bit numbers is given by is given by ’s complement:

Slides:



Advertisements
Similar presentations
Lecture no 6. Two's Complement Given a negative number (N), represented using the Two's Complement representation (N*), the magnitude of the number (P)
Advertisements

Addition and Subtraction. Outline Arithmetic Operations (Section 1.2) – Addition – Subtraction – Multiplication Complements (Section 1.5) – 1’s complement.
Addition of two binary numbers = = = = 39.
ECE 331 – Digital System Design
Signed Numbers Up till now we've been concentrating on unsigned numbers. In real life we have to represent signed numbers ( like: -12, -45, 78). The difference.
DIGITAL SYSTEMS TCE1111 Representation and Arithmetic Operations with Signed Numbers Week 6 and 7 (Lecture 1 of 2)
Computer ArchitectureFall 2007 © August 29, 2007 Karem Sakallah CS 447 – Computer Architecture.
Number System and Codes
1 Lecture 2: Number Systems Binary numbers Base conversion Arithmetic Number systems  Sign and magnitude  Ones-complement  Twos-complement Binary-coded.
Chapter 3 Data Representation part2 Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2010.
1.6 Signed Binary Numbers.
Binary Addition Addition Rules: = = = = = carry 1 1 carry 1 Example 1: Example 2:
Chapter3 Fixed Point Representation Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009.
BINARY ARITHMETIC Binary arithmetic is essential in all digital computers and in many other types of digital systems.
CPS120: Introduction to Computer Science Computer Math: Signed Numbers.
ECE 301 – Digital Electronics Unsigned and Signed Numbers, Binary Arithmetic of Signed Numbers, and Binary Codes (Lecture #2)
Summer 2012ETE Digital Electronics1 Binary Arithmetic of Signed Binary Numbers.
Positional Number Systems
ECE 331 – Digital System Design Representation and Binary Arithmetic of Negative Numbers and Binary Codes (Lecture #10) The slides included herein were.
ECE 301 – Digital Electronics Representation of Negative Numbers, Binary Arithmetic of Negative Numbers, and Binary Codes (Lecture #11) The slides included.
Data Representation in Computer Systems. 2 Signed Integer Representation The conversions we have so far presented have involved only positive numbers.
Addition and Substraction
CEC 220 Digital Circuit Design Binary Arithmetic & Negative Numbers Monday, January 13 CEC 220 Digital Circuit Design Slide 1 of 14.
Outline Binary Addition 2’s complement Binary Subtraction Half Adder
CEC 220 Digital Circuit Design Binary Arithmetic & Negative Numbers Fri, Aug 28 CEC 220 Digital Circuit Design Slide 1 of 14.
IT1004: Data Representation and Organization Negative number representation.
ECE 171 Digital Circuits Chapter 2 Binary Arithmetic Herbert G. Mayer, PSU Status 1/14/2016 Copied with Permission from prof. Mark PSU ECE.
1 Integer Representations V1.0 (22/10/2005). 2 Integer Representations  Unsigned integer  Signed integer  Sign and magnitude  Complements  One’s.
COSC2410: LAB 2 BINARY ARITHMETIC SIGNED NUMBERS FLOATING POINT REPRESENTATION BOOLEAN ALGEBRA 1.
Binary Addition The simplest arithmetic operation in binary is addition. Adding two single-digit binary numbers is relatively simple, using a form of carrying:
973cs111_add_posneg.ppt Integers Whole numbers Do NOT contain decimal points (as in money) 43,689 is an integer 43, is NOT an integer (it is floating.
Lecture 4: Digital Systems & Binary Numbers (4)
Unit I From Fundamentals of Logic Design by Roth and Kinney.
Representing Positive and Negative Numbers
Cosc 2150: Computer Organization
Design of Digital Circuits Reading: Binary Numbers
CHAPTER 9 COMPUTER ARITHMETIC - ALU
Conversion, Carry and Overflow
Computer Science 210 Computer Organization
Lecture 2 Topics Binary Arithmetic (Unsigned binary operands)
Exercise: Add these two single precision IEEE 754 numbers: … …0 Left number: 1.101x24 Right number: 1.011x 22= x24.
Addition and Substraction
Dr. Clincy Professor of CS
Dr. Clincy Professor of CS
Binary Addition & Subtraction
Lecture 2 Topics Binary Arithmetic (Unsigned binary operands)
Computer Science 210 Computer Organization
Data Representation Data Types Complements Fixed Point Representation
CSC 143 Two' s complement.
Unit 18: Computational Thinking
Negatives, Addition, Subtraction
How are negative and rational numbers represented on the computer?
Dr. Clincy Professor of CS
CPS120: Introduction to Computer Science
Chapter 6: Computer Arithmetic
Number Systems Rayat Shikshan Sanstha’s
Number Systems Rayat Shikshan Sanstha’s
ECE 171 Digital Circuits Chapter 2 Binary Arithmetic
ECE 331 – Digital System Design
CSC 220: Computer Organization Signed Number Representation
Data Binary Arithmetic.
Lecture No.5.
GCSE COMPUTER SCIENCE Topic 3 - Data 3.2 Signed Integers.
COMS 361 Computer Organization
Chapter3 Fixed Point Representation
Activity 2 How is the word length of a two’s complement representation changed without affecting its value? In this activity, we are going to study how.
Chapter 1 (Part c) Digital Systems and Binary Numbers
Two’s Complement & Binary Arithmetic
Today Binary addition Representing negative numbers 2.
Presentation transcript:

Negative Number Sign-Magnitude: left-most bit as the sign bit –16 bits –Example: 4-bit numbers is given by is given by ’s complement: 16 bits: –Example: 4-bit numbers is given by ’ is given by ’

Lecture 9 notes Negative number Sign-magnitude representation 2’s complement Binary addition Binary subtraction

Convert (156) 10 to (?) 2’ 2’s complement representation of positive numbers is the same as sign- magnitude representation. 16 bits example: 156= = 1* * * * 2 2 = ( ) 2 = ( ) 2’

Convert (-156) 10 to (?) 2’ Step 1: ignore the negative sign, obtain the 2’complement of the positive value: (156) 10 = ( ) Step 2: Bitwise inverse: =( ) 2 Step 3: add 1 using binary addition =( ) 2’ done

Remarks Representation of negative number is always associated with the context of total bits With 8 bits, -2 = ( ) 2’ With 16 bits, -2 = ( ) 2’

Binary addition review x Y x y sum bit carry bit Example:

Binary Subtraction When represented in sign-magnitude format, subtraction is performed in a similar way as in the base 10 case. Subtraction uses a different set of `rules’ other than the addition With 2’s complement representation, we can achieve subtraction via binary addition!

Example 7-6 Step 1: get 2’ complement representation for 7 and –6: 7 = ( ) 2’* -6=( ) 2’** Perform binary addition between * and **, we get ( ) Ignore the overflow bit, we have ( ) Done, this is the result of the subtraction represented in 2’s complement format.