Representing signed numbers in Two s Complement notation

Size: px
Start display at page:

Download "Representing signed numbers in Two s Complement notation"

Transcription

1 EE457 Representing signed numbers in Two s Complement notation A way to view the signed number representation in 2 s complement notation as a positional weighted coefficient system. example ( 2) = (6 4 ) = = = 0x2 7 0x2 6 0x2 5 x2 4 0x2 3 x2 2 0x2 x2 0 How to represent -2 walking 2 steps backward is same as walking = 235 steps forward on a 256-segment circle. 235 = = 00. Hence (-2) is represented Error point: C bit is set UNSIGNED SIGNED Error Point: V bit is set / 3 C Copyright 2006 Gandhi Puvvada

2 We prove that the weight of the most significant bit is a -2 7 where as the rest of the weights are all powers of 2 (2 6, 2 5, 2 4, 2 3, 2 2, 2, 2 0 ). i.e. 00 = = x(-2 7 ) x(2 6 ) x(2 5 ) 0x(2 4 ) x(2 3 ) 0x(2 2 ) x(2 ) x(2 0 ) = = = - 2 Proof: Take some random negative number B = b 6 b 5 b 4 b 3 b 2 b b 0. To find the value of 2 s complement of B, we find (256 - B) = (255 - B) = ( - b 6 b 5 b 4 b 3 b 2 b b 0 ) = [ ( - )x2 7 ( - b 6 )x2 6 ( - b 5 )x2 5 ( - b 4 )x2 4 ( - b 3 )x2 3 ( - b 2 )x2 2 ( - b )x2 ( - b 0 )x2 0 ] Ignore ( - )x2 7 and process other terms. Gathering all s together in the above right-hand side expression, we get = [ {(x2 6 x2 5 x2 4 x2 3 x2 2 x2 x2 0 ) } - { b 6 x2 6 b 5 x2 5 b 4 x2 4 b 3 x2 3 b 2 x2 2 b x2 b 0 x2 0 } ] = [{x2 7 } - { b 6 x2 6 b 5 x2 5 b 4 x2 4 b 3 x2 3 b 2 x2 2 b x2 b 0 x2 0 }] 2 / 3 C Copyright 2006 Gandhi Puvvada

3 Hence the value of B = - [{x2 7 } - { b 6 x2 6 b 5 x2 5 b 4 x2 4 b 3 x2 3 b 2 x2 2 b x2 b 0 x2 0 }] = x(-2 7 ) b 6 x(2 6 ) b 5 x(2 5 ) b 4 x(2 4 ) b 3 x(2 3 ) b 2 x(2 2 ) b x(2 ) b 0 x(2 0 ) Example: Find the value of the negative number 00 (a 6-bit number represented in 2 s complement notation = (-32) (8 4 2) = (-32) (4) = -8 Verify. Negate the number and find the value of the corresponding number. Flip bits: Add : Find value: 6 2 = 8. Hence the give number is - 8. ======================================================================== 3 / 3 C Copyright 2006 Gandhi Puvvada

4 Addition of two numbers expressed in two s complement notation: S = A B; A = a 3 a 2 a a 0, B = b 3 b 2 b b 0, S = s 3 s 2 s s 0 We note that the positional values are (-2 3 ), (2 2 ), (2 ), and (2 0 ). The carry from lower three bits has a weight of (2 3 ) but the column into which it is going has a weight of (-2 3 ). Total of 8 cases. Four cases are a 3 b 3 = 00, 0, 0,. For each of these four cases, consider two cases: C 3 = a or a 0. 0a 2 a a 0 0a 2 a a 0 a 2 a a 0 a 2 a a 0 0b 2 b b 0 b 2 b b 0 0b 2 b b 0 b 2 b b 0 Hypothesis #: A number added to a negative number does not cause overflow a 2 a a 0 b 2 b b 0? s 2 s s 0 Since there is a already in in the MSB column, C4 follows C3. V = C3 () C4 = 0 If a carry C3 comes into the MSB column, it has a value of 2 3. And it will cancel the -2 3 resulting in a 0 for s3. Otherwise s3 will be a. Either way the values were preserved properly. 4 / 3 C Copyright 2006 Gandhi Puvvada

5 Hypothesis #2: A number added to another number causes overflow if C3 is true a 2 a a 0 0 b 2 b b 0? s 2 s s 0 C4 is surely a zero here. If C3 =, we have overflow. V = C3 () C4 = = overflow If a carry C3 comes into the MSB column, it has a value of 2 3. Since it results in making s3 a, which is interpreted as -2 3 it causes an overflow. Hypothesis #3: A negative number added to another negative number causes overflow if C3 is NOT true a 2 a a 0 b 2 b b 0 C4 is surely a one here. If C3 = 0, we have overflow. V = C3 () C4 =? s 2 s s 0 0 = overflow If a carry C3 comes into the MSB column, then s3 comes out to be a, which matches with the mathematical sum (2 3 ) (-2 3 ) (-2 3 ) = (-2 3 ). Absence of C3 results in overflow. 5 / 3 C Copyright 2006 Gandhi Puvvada

6 Subtraction A-B where A and B are expressed in two s complement notation: D = A - B; A = a 3 a 2 a a 0, B = b 3 b 2 b b 0, D = d 3 d 2 d d 0 (A - B) = (A B ), more precisely (A B 000). 8 cases. Four cases are a 3 b 3 = 00, 0, 0,. For each of these four cases, consider two cases: C 3 = a or a 0 while performing (A B 000). 0a 2 a a 0 0a 2 a a 0 a 2 a a 0 a 2 a a 0 0b 2 b b 0 b 2 b b 0 0b 2 b b 0 b 2 b b 0 An observation about 2 s complement notation. Given X ( or negative), we find the representation for -X by performing X, but... the 0000 and 000 are special cases is considered to be a zero and there is no representation for a negative zero in 2 s complement notation, which is actually good! If you perform X, then you get ( 000) = Note that ( 000) contains a (-2 3 ) and also contains (2 2, 2, 2 0, and 2 0 ). Similarly 000 is also special. 000 is a -8, but if you negate it by doing X, you get (0 000) = 000. You get 000 again and it is NOT 8. In fact we caused an overflow in this addition. However please notice that the expression (0 000) as a whole still represents 8, as it has (2 2, 2, 2 0, and 2 0 ). 6 / 3 C Copyright 2006 Gandhi Puvvada

7 So, are we saying that we can NOT perform (A B ) for (A - B) if B is either 0000 or 000? No, no, we did not say that. In fact subtracting 0000 will never cause any problem. If you are subtracting 000, as long as you do not perform (A B ) in two steps [ (A) (B ) ] (i.e. as long as you add the three items all in one stroke), the procedure is still fine and there will not be any spurious overflow. Conclusion: Always perform (A B ) in one stroke. Hypothesis #: Subtracting a number from another number does not cause overflow. - 0 a 2 a a 0 0 b 2 b b 0? d 2 d d 0 0 a 2 a a 0 b 2 b b 0? d 2 d d 0 We already proved that the above addition cannot cause overflow. B can be 0000 without any problem. Since there is a already in in the MSB column, C4 follows C3. V = C3 () C4 = 0 7 / 3 C Copyright 2006 Gandhi Puvvada

8 Hypothesis #2: Subtracting a negative number from another negative number does not cause overflow. - a 2 a a 0 b 2 b b 0? d 2 d d 0 a 2 a a 0 0 b 2 b b 0? d 2 d d 0 We already proved that the above addition cannot cause overflow. B can be 0000 without any problem. Hypothesis #3: Subtracting a number from a negative number can cause overflow. - Since there is a already in in the MSB column, C4 follows C3. V = C3 () C4 = 0 a 2 a a 0 0 b 2 b b 0? d 2 d d = overflow C4 is surely a one here. If C3 = 0, we have overflow. V = C3 () C4 = a 2 a a 0 b 2 b b 0? d 2 d d 0 As stated before, if a carry C3 comes into the MSB column, then d3 comes out to be a, which matches with the mathematical sum (2 3 ) (-2 3 ) (-2 3 ) = (-2 3 ). Absence of C3 results in overflow. 8 / 3 C Copyright 2006 Gandhi Puvvada

9 Hypothesis #4: Subtracting a negative number from a number can cause overflow. - 0 a 2 a a 0 b 2 b b 0? d 2 d d 0 C4 is surely a zero here. If C3 =, we have overflow. V = C3 () C4 = -2 3 = overflow 0 a 2 a a 0 0 b 2 b b 0? d 2 d d 0 As stated before, if a carry C3 comes into the MSB column, then d3 comes out to be a, which cause overflow Presence of C3 results in overflow. Conclusion: Whether you subtract or add, the V = C3 () C4 provides overflow signal. 9 / 3 C Copyright 2006 Gandhi Puvvada

10 Addition of two unsigned numbers: C4 = indicates overflow in addition. Subtraction in unsigned numbers: 2 3 Error point: C bit is set UNSIGNED Since negative numbers can not be represented in unsigned system, when the correct result is expected to be negative, there is an overflow. If A is lower than B in the subtraction A - B, then we have an overflow To perform A - B, let us perform A (2 4 - B). A (2 4 - B) = A ( - B ) = A B If (A B ) produces C4, then we know that the (2 4 ) added by us was not really needed for subtracting. It means that A is higher than or equal to B. If C4 was not produced, then A is less than B. C4 = 0 indicates overflow in subtraction. We call the above C4 Raw Carry. In many processors, it (the raw carry) is flipped for subtraction and recorded in the Flag Register (also called CCR (Condition Code Register), PSW (Processor Status Word). etc.). The processor designers do this (flip the raw carry) because it is easy for the programmers to remember one simple rule, Carry flag is the overflow indicator for unsigned addition or subtraction. When it is set, unsigned overflow has occurred. We call this Processed Carry to distinguish from the Raw Carry. 0 / 3 C Copyright 2006 Gandhi Puvvada

11 If you try to perform addition and subtraction with each possible pair of numbers in the range of 0000 to, is it possible to encounter all combinations of overflows (signed overflow and unsigned overflow)? Yes! Try to avoid using (though not necessary) 0000 and 000 numbers for A and B. 4-bit A 4-bit B UNSIGNED Operation 4-bit Result Result / if numbers are treated as signed numbers Addition Addition Addition Addition Subtraction Subtraction Subtraction Subtraction Smallest (0) to Largest (5) Result / if numbers are treated as unsigned numbers Smallest (-8) to Largest (7) V Raw Carry C Error point: C bit is set LARGER mag SMALLER mag UNSIGNED SMALLER mag. LARGER mag SIGNED 3 4 Error Point: V bit is set / 3 C Copyright 2006 Gandhi Puvvada

12 Special note about avoiding spurious overflow while performing (A - B) by doing (A B ): Subtraction in unsigned numbers: We said that the absence of the Raw Carry C4 at the end of the subtraction is an indication of the overflow. When we said end we meant at the end of the addition of the 3 items in (A B ). If you perform this addition in two parts (add two of the three items together first, and then add the third, then there is a problem if you try to subtract a zero. A - B = a3 a2 a a = (a3 a2 a a0 ) If you perform the addition of the three items in the last step in one stroke, then C4 will definitely be true because => C4 = ). However if you perform the addition in two steps as [ a3 a2 a a0 ( ) ], then in the second step you will not find Raw Carry C4 as and you could wrongly interpret that there was an unsigned subtraction overflow. Subtracting other numbers (other than 0000) including the number 000 do not pose any problems whether you perform the subtraction in one step or in two steps [(B ) A]. However, if you perform the addition in two steps grouping the three terms differently, then you can run into the same problem. Examples: [(A ) B ] or [(A B ) ] Conclusion: always perform the addition of the three items in one stroke. 2 / 3 C Copyright 2006 Gandhi Puvvada

13 Subtraction in signed numbers: Here again we need to perform the addition of the three items (A B ) in on stroke. If you perform the addition in two strokes in any one of the three possible ways below, you can be causing spurious overflow(s). [(B ) A ] -- case [(A ) B ] -- case 2 [(A B ) ] -- case 3 Note that the is considered as a one, i.e To provide examples where we run into spurious overflow problem, basically we need to make the first step to cause signed overflow, which would have been averted had we added the three items together in one stroke. For (something ) to cause overflow, the something should be the largest number 0. Also for that overflow to be averted the third item shall be negative. So an example for case or case 2 is [(0 ) ] [(B ) A ] Consider A = (-) = and B = (-8) = 000. Then A - B = (7) [(A ) B ] Consider A = (7) =0 and B = (0) = Then A - B = (7) [(A B ) ] Consider A = (-4) =00 and B = (4) = 000. Then A - B = (-8) Note that when there is a spurious overflow in the first step, then there will be a spurious overflow in the second step also. 3 / 3 C Copyright 2006 Gandhi Puvvada

ECE260: Fundamentals of Computer Engineering

ECE260: Fundamentals of Computer Engineering Data Representation & 2 s Complement James Moscola Dept. of Engineering & Computer Science York College of Pennsylvania Based on Computer Organization and Design, 5th Edition by Patterson & Hennessy Data

More information

CprE 281: Digital Logic

CprE 281: Digital Logic CprE 281: Digital Logic Instructor: Alexander Stoytchev http://www.ece.iastate.edu/~alexs/classes/ Signed Numbers CprE 281: Digital Logic Iowa State University, Ames, IA Copyright Alexander Stoytchev Administrative

More information

hexadecimal-to-decimal conversion

hexadecimal-to-decimal conversion OTHER NUMBER SYSTEMS: octal (digits 0 to 7) group three binary numbers together and represent as base 8 3564 10 = 110 111 101 100 2 = (6X8 3 ) + (7X8 2 ) + (5X8 1 ) + (4X8 0 ) = 6754 8 hexadecimal (digits

More information

Chapter 1 CSCI

Chapter 1 CSCI Chapter 1 CSCI-1510-003 What is a Number? An expression of a numerical quantity A mathematical quantity Many types: Natural Numbers Real Numbers Rational Numbers Irrational Numbers Complex Numbers Etc.

More information

Complement Arithmetic

Complement Arithmetic Complement Arithmetic Objectives In this lesson, you will learn: How additions and subtractions are performed using the complement representation, What is the Overflow condition, and How to perform arithmetic

More information

EE457 Home work #1 Review of EE254L material 3. Datapath and control design: You are given two 4-bit unsigned numbers, P and Q. You need to compare them and deposit the smaller in SMALL_REG and the bigger

More information

Hakim Weatherspoon CS 3410 Computer Science Cornell University

Hakim Weatherspoon CS 3410 Computer Science Cornell University Hakim Weatherspoon CS 3410 Computer Science Cornell University The slides are the product of many rounds of teaching CS 3410 by Professors Weatherspoon, Bala, Bracy, and Sirer. memory inst 32 register

More information

14:332:231 DIGITAL LOGIC DESIGN. 2 s-complement Representation

14:332:231 DIGITAL LOGIC DESIGN. 2 s-complement Representation 4:332:23 DIGITAL LOGIC DESIGN Ivan Marsic, Rutgers University Electrical & Computer Engineering Fall 203 Lecture #3: Addition, Subtraction, Multiplication, and Division 2 s-complement Representation RECALL

More information

Design of Digital Circuits Reading: Binary Numbers. Required Reading for Week February 2017 Spring 2017

Design of Digital Circuits Reading: Binary Numbers. Required Reading for Week February 2017 Spring 2017 Design of Digital Circuits Reading: Binary Numbers Required Reading for Week 1 23-24 February 2017 Spring 2017 Binary Numbers Design of Digital Circuits 2016 Srdjan Capkun Frank K. Gürkaynak http://www.syssec.ethz.ch/education/digitaltechnik_16

More information

UNSIGNED BINARY NUMBERS DIGITAL ELECTRONICS SYSTEM DESIGN WHAT ABOUT NEGATIVE NUMBERS? BINARY ADDITION 11/9/2018

UNSIGNED BINARY NUMBERS DIGITAL ELECTRONICS SYSTEM DESIGN WHAT ABOUT NEGATIVE NUMBERS? BINARY ADDITION 11/9/2018 DIGITAL ELECTRONICS SYSTEM DESIGN LL 2018 PROFS. IRIS BAHAR & ROD BERESFORD NOVEMBER 9, 2018 LECTURE 19: BINARY ADDITION, UNSIGNED BINARY NUMBERS For the binary number b n-1 b n-2 b 1 b 0. b -1 b -2 b

More information

convert a two s complement number back into a recognizable magnitude.

convert a two s complement number back into a recognizable magnitude. 1 INTRODUCTION The previous lesson introduced binary and hexadecimal numbers. In this lesson we look at simple arithmetic operations using these number systems. In particular, we examine the problem of

More information

CSE 331 Winter 2018 Homework 1

CSE 331 Winter 2018 Homework 1 Directions: - Due Wednesday, January 10 by 11 pm. - Turn in your work online using gradescope. You should turn in a single pdf file. You can have more than one answer per page, but please try to avoid

More information

1 Modular Arithmetic Grade Level/Prerequisites: Time: Materials: Preparation: Objectives: Navajo Nation Math Circle Connection

1 Modular Arithmetic Grade Level/Prerequisites: Time: Materials: Preparation: Objectives: Navajo Nation Math Circle Connection 1 Modular Arithmetic Students will explore a type of arithmetic that results from arranging numbers in circles instead of on a number line. Students make and prove conjectures about patterns relating to

More information

Chapter 1 Review of Equations and Inequalities

Chapter 1 Review of Equations and Inequalities Chapter 1 Review of Equations and Inequalities Part I Review of Basic Equations Recall that an equation is an expression with an equal sign in the middle. Also recall that, if a question asks you to solve

More information

Menu. Review of Number Systems EEL3701 EEL3701. Math. Review of number systems >Binary math >Signed number systems

Menu. Review of Number Systems EEL3701 EEL3701. Math. Review of number systems >Binary math >Signed number systems Menu Review of number systems >Binary math >Signed number systems Look into my... 1 Our decimal (base 10 or radix 10) number system is positional. Ex: 9437 10 = 9x10 3 + 4x10 2 + 3x10 1 + 7x10 0 We have

More information

We are here. Assembly Language. Processors Arithmetic Logic Units. Finite State Machines. Circuits Gates. Transistors

We are here. Assembly Language. Processors Arithmetic Logic Units. Finite State Machines. Circuits Gates. Transistors CSC258 Week 3 1 Logistics If you cannot login to MarkUs, email me your UTORID and name. Check lab marks on MarkUs, if it s recorded wrong, contact Larry within a week after the lab. Quiz 1 average: 86%

More information

Combinational Logic Design Arithmetic Functions and Circuits

Combinational Logic Design Arithmetic Functions and Circuits Combinational Logic Design Arithmetic Functions and Circuits Overview Binary Addition Half Adder Full Adder Ripple Carry Adder Carry Look-ahead Adder Binary Subtraction Binary Subtractor Binary Adder-Subtractor

More information

Supplemental Worksheet Problems To Accompany: The Pre-Algebra Tutor: Volume 2 Section 16 Solving Single Step Equations

Supplemental Worksheet Problems To Accompany: The Pre-Algebra Tutor: Volume 2 Section 16 Solving Single Step Equations Supplemental Worksheet Problems To Accompany: The Pre-Algebra Tutor: Volume 2 Please watch Section 16 of this DVD before working these problems. The DVD is located at: http://www.mathtutordvd.com/products/item67.cfm

More information

Numbers and Arithmetic

Numbers and Arithmetic Numbers and Arithmetic See: P&H Chapter 2.4 2.6, 3.2, C.5 C.6 Hakim Weatherspoon CS 3410, Spring 2013 Computer Science Cornell University Big Picture: Building a Processor memory inst register file alu

More information

Some Review Problems for Exam 1: Solutions

Some Review Problems for Exam 1: Solutions Math 3355 Fall 2018 Some Review Problems for Exam 1: Solutions Here is my quick review of proof techniques. I will focus exclusively on propositions of the form p q, or more properly, x P (x) Q(x) or x

More information

Lecture 2e Row Echelon Form (pages 73-74)

Lecture 2e Row Echelon Form (pages 73-74) Lecture 2e Row Echelon Form (pages 73-74) At the end of Lecture 2a I said that we would develop an algorithm for solving a system of linear equations, and now that we have our matrix notation, we can proceed

More information

STEP Support Programme. Hints and Partial Solutions for Assignment 1

STEP Support Programme. Hints and Partial Solutions for Assignment 1 STEP Support Programme Hints and Partial Solutions for Assignment 1 Warm-up 1 You can check many of your answers to this question by using Wolfram Alpha. Only use this as a check though and if your answer

More information

Page 1. Math Module 2: Negative Numbers, Proportions, and the Dreaded Fractions

Page 1. Math Module 2: Negative Numbers, Proportions, and the Dreaded Fractions Page 1 Math Module 2: Negative Numbers, Proportions, and the Dreaded Fractions Copyright 2001-2013 by Steve Kirshenbaum and Celia Barranon, SAT Preparation Group, LLC. www.satprepgroup.com. All rights

More information

What does such a voltage signal look like? Signals are commonly observed and graphed as functions of time:

What does such a voltage signal look like? Signals are commonly observed and graphed as functions of time: Objectives Upon completion of this module, you should be able to: understand uniform quantizers, including dynamic range and sources of error, represent numbers in two s complement binary form, assign

More information

VLSI Physical Design Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

VLSI Physical Design Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur VLSI Physical Design Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture - 54 Design for Testability So, in the last lecture we talked

More information

Math 3361-Modern Algebra Lecture 08 9/26/ Cardinality

Math 3361-Modern Algebra Lecture 08 9/26/ Cardinality Math 336-Modern Algebra Lecture 08 9/26/4. Cardinality I started talking about cardinality last time, and you did some stuff with it in the Homework, so let s continue. I said that two sets have the same

More information

14:332:231 DIGITAL LOGIC DESIGN. Why Binary Number System?

14:332:231 DIGITAL LOGIC DESIGN. Why Binary Number System? :33:3 DIGITAL LOGIC DESIGN Ivan Marsic, Rutgers University Electrical & Computer Engineering Fall 3 Lecture #: Binary Number System Complement Number Representation X Y Why Binary Number System? Because

More information

Multiplication of signed-operands

Multiplication of signed-operands Multiplication of signed-operands Recall we discussed multiplication of unsigned numbers: Combinatorial array multiplier. Sequential multiplier. Need an approach that works uniformly with unsigned and

More information

Homework 2 Foundations of Computational Math 1 Fall 2018

Homework 2 Foundations of Computational Math 1 Fall 2018 Homework 2 Foundations of Computational Math 1 Fall 2018 Note that Problems 2 and 8 have coding in them. Problem 2 is a simple task while Problem 8 is very involved (and has in fact been given as a programming

More information

Notes for Chapter 1 of. Scientific Computing with Case Studies

Notes for Chapter 1 of. Scientific Computing with Case Studies Notes for Chapter 1 of Scientific Computing with Case Studies Dianne P. O Leary SIAM Press, 2008 Mathematical modeling Computer arithmetic Errors 1999-2008 Dianne P. O'Leary 1 Arithmetic and Error What

More information

EE 109 Final Don t Make the Same Mistake

EE 109 Final Don t Make the Same Mistake EE 9 Final Don t Make the ame Mistake No calculators are allowed. how all your work to get full credit. Note: The following are all INCORRECT answers meant to highlight common misunderstandings! Try to

More information

CprE 281: Digital Logic

CprE 281: Digital Logic CprE 281: Digital Logic Instructor: Alexander Stoytchev http://www.ece.iastate.edu/~alexs/classes/ Fast Adders CprE 281: Digital Logic Iowa State University, Ames, IA Copyright Alexander Stoytchev HW5

More information

ECE/CS 250 Computer Architecture

ECE/CS 250 Computer Architecture ECE/CS 250 Computer Architecture Basics of Logic Design: Boolean Algebra, Logic Gates (Combinational Logic) Tyler Bletsch Duke University Slides are derived from work by Daniel J. Sorin (Duke), Alvy Lebeck

More information

Numbers and Arithmetic

Numbers and Arithmetic Numbers and Arithmetic See: P&H Chapter 2.4 2.6, 3.2, C.5 C.6 Hakim Weatherspoon CS 3410, Spring 2013 Computer Science Cornell University Big Picture: Building a Processor memory inst register file alu

More information

ECE 250 / CPS 250 Computer Architecture. Basics of Logic Design Boolean Algebra, Logic Gates

ECE 250 / CPS 250 Computer Architecture. Basics of Logic Design Boolean Algebra, Logic Gates ECE 250 / CPS 250 Computer Architecture Basics of Logic Design Boolean Algebra, Logic Gates Benjamin Lee Slides based on those from Andrew Hilton (Duke), Alvy Lebeck (Duke) Benjamin Lee (Duke), and Amir

More information

Arithmetic and Error. How does error arise? How does error arise? Notes for Part 1 of CMSC 460

Arithmetic and Error. How does error arise? How does error arise? Notes for Part 1 of CMSC 460 Notes for Part 1 of CMSC 460 Dianne P. O Leary Preliminaries: Mathematical modeling Computer arithmetic Errors 1999-2006 Dianne P. O'Leary 1 Arithmetic and Error What we need to know about error: -- how

More information

Introduction to Digital Logic Missouri S&T University CPE 2210 Subtractors

Introduction to Digital Logic Missouri S&T University CPE 2210 Subtractors Introduction to Digital Logic Missouri S&T University CPE 2210 Egemen K. Çetinkaya Egemen K. Çetinkaya Department of Electrical & Computer Engineering Missouri University of Science and Technology cetinkayae@mst.edu

More information

Physics of Everyday Phenomena. Chapter 2

Physics of Everyday Phenomena. Chapter 2 Physics of Everyday Phenomena W. Thomas Griffith Juliet W. Brosing Chapter 2 Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Question 2.1 Ben leaves his home

More information

Algorithms (II) Yu Yu. Shanghai Jiaotong University

Algorithms (II) Yu Yu. Shanghai Jiaotong University Algorithms (II) Yu Yu Shanghai Jiaotong University Chapter 1. Algorithms with Numbers Two seemingly similar problems Factoring: Given a number N, express it as a product of its prime factors. Primality:

More information

A. Incorrect! This inequality is a disjunction and has a solution set shaded outside the boundary points.

A. Incorrect! This inequality is a disjunction and has a solution set shaded outside the boundary points. Problem Solving Drill 11: Absolute Value Inequalities Question No. 1 of 10 Question 1. Which inequality has the solution set shown in the graph? Question #01 (A) x + 6 > 1 (B) x + 6 < 1 (C) x + 6 1 (D)

More information

CS 360, Winter Morphology of Proof: An introduction to rigorous proof techniques

CS 360, Winter Morphology of Proof: An introduction to rigorous proof techniques CS 30, Winter 2011 Morphology of Proof: An introduction to rigorous proof techniques 1 Methodology of Proof An example Deep down, all theorems are of the form If A then B, though they may be expressed

More information

Digital Systems Overview. Unit 1 Numbering Systems. Why Digital Systems? Levels of Design Abstraction. Dissecting Decimal Numbers

Digital Systems Overview. Unit 1 Numbering Systems. Why Digital Systems? Levels of Design Abstraction. Dissecting Decimal Numbers Unit Numbering Systems Fundamentals of Logic Design EE2369 Prof. Eric MacDonald Fall Semester 2003 Digital Systems Overview Digital Systems are Home PC XBOX or Playstation2 Cell phone Network router Data

More information

Modern Algebra Prof. Manindra Agrawal Department of Computer Science and Engineering Indian Institute of Technology, Kanpur

Modern Algebra Prof. Manindra Agrawal Department of Computer Science and Engineering Indian Institute of Technology, Kanpur Modern Algebra Prof. Manindra Agrawal Department of Computer Science and Engineering Indian Institute of Technology, Kanpur Lecture - 05 Groups: Structure Theorem So, today we continue our discussion forward.

More information

Binary floating point

Binary floating point Binary floating point Notes for 2017-02-03 Why do we study conditioning of problems? One reason is that we may have input data contaminated by noise, resulting in a bad solution even if the intermediate

More information

EE260: Digital Design, Spring n Digital Computers. n Number Systems. n Representations. n Conversions. n Arithmetic Operations.

EE260: Digital Design, Spring n Digital Computers. n Number Systems. n Representations. n Conversions. n Arithmetic Operations. EE 260: Introduction to Digital Design Number Systems Yao Zheng Department of Electrical Engineering University of Hawaiʻi at Mānoa Overview n Digital Computers n Number Systems n Representations n Conversions

More information

Algebra 2: Semester 2 Practice Final Unofficial Worked Out Solutions by Earl Whitney

Algebra 2: Semester 2 Practice Final Unofficial Worked Out Solutions by Earl Whitney Algebra 2: Semester 2 Practice Final Unofficial Worked Out Solutions by Earl Whitney 1. The key to this problem is recognizing cubes as factors in the radicands. 24 16 5 2. The key to this problem is recognizing

More information

(+2) + (+7) = (+9)? ( 3) + ( 4) = ( 7)? (+2) + ( 7) = ( 5)? (+9) + ( 4) = (+5)? (+2) (+7) = ( 5)? ( 3) ( 4) = (+1)?

(+2) + (+7) = (+9)? ( 3) + ( 4) = ( 7)? (+2) + ( 7) = ( 5)? (+9) + ( 4) = (+5)? (+2) (+7) = ( 5)? ( 3) ( 4) = (+1)? L1 Integer Addition and Subtraction Review.notebook L1 Adding and Subtracting Integer Review In grade 7 we developed rules for adding and subtracting integers... Do we remember the process for adding and

More information

Numbers & Arithmetic. Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University. See: P&H Chapter , 3.2, C.5 C.

Numbers & Arithmetic. Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University. See: P&H Chapter , 3.2, C.5 C. Numbers & Arithmetic Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University See: P&H Chapter 2.4-2.6, 3.2, C.5 C.6 Example: Big Picture Computer System Organization and Programming

More information

Why Use Negative Numbers?

Why Use Negative Numbers? Sunny Hills Negative Numbers Lesson Why Use Negative Numbers? Have you seen negative numbers somewhere in your life? Think about some instance for a minute I would bet it has something to do with direction,

More information

An Invitation to Mathematics Prof. Sankaran Vishwanath Institute of Mathematical Science, Chennai. Unit - I Polynomials Lecture 1B Long Division

An Invitation to Mathematics Prof. Sankaran Vishwanath Institute of Mathematical Science, Chennai. Unit - I Polynomials Lecture 1B Long Division An Invitation to Mathematics Prof. Sankaran Vishwanath Institute of Mathematical Science, Chennai Unit - I Polynomials Lecture 1B Long Division (Refer Slide Time: 00:19) We have looked at three things

More information

Lesson 21 Not So Dramatic Quadratics

Lesson 21 Not So Dramatic Quadratics STUDENT MANUAL ALGEBRA II / LESSON 21 Lesson 21 Not So Dramatic Quadratics Quadratic equations are probably one of the most popular types of equations that you ll see in algebra. A quadratic equation has

More information

What is Binary? Digital Systems and Information Representation. An Example. Physical Representation. Boolean Algebra

What is Binary? Digital Systems and Information Representation. An Example. Physical Representation. Boolean Algebra What is Binary? Digital Systems and Information Representation CSE 102 Underlying base signals are two valued: 0 or 1 true or false (T or F) high or low (H or L) One bit is the smallest unambiguous unit

More information

University of Minnesota Department of Electrical and Computer Engineering

University of Minnesota Department of Electrical and Computer Engineering University of Minnesota Department of Electrical and Computer Engineering EE2301 Fall 2008 Introduction to Digital System Design L. L. Kinney Final Eam (Closed Book) Solutions Please enter your name, ID

More information

E40M. Binary Numbers. M. Horowitz, J. Plummer, R. Howe 1

E40M. Binary Numbers. M. Horowitz, J. Plummer, R. Howe 1 E40M Binary Numbers M. Horowitz, J. Plummer, R. Howe 1 Reading Chapter 5 in the reader A&L 5.6 M. Horowitz, J. Plummer, R. Howe 2 Useless Box Lab Project #2 Adding a computer to the Useless Box alows us

More information

Adding Three or More Fractions

Adding Three or More Fractions Adding Three or More Fractions Reteaching 61 Math Course 1, Lesson 61 To add 3 or more fractions: 1. Find a common denominator. Look for the least common multiple (LCM). 2. Rename the fractions. 3. Add

More information

EE 209 Logic Cumulative Exam Name:

EE 209 Logic Cumulative Exam Name: EE 209 Logic Cumulative Exam Name: 1.) Answer the following questions as True or False a.) A 4-to-1 multiplexer requires at least 4 select lines: true / false b.) An 8-to-1 mux and no other logi can be

More information

Number Representations

Number Representations Computer Arithmetic Algorithms Prof. Dae Hyun Kim School of Electrical Engineering and Computer Science Washington State University Number Representations Information Textbook Israel Koren, Computer Arithmetic

More information

MPM1D - Practice Mastery Test #6

MPM1D - Practice Mastery Test #6 Name: Class: Date: ID: A MPMD - Practice Mastery Test #6 Multiple Choice Identify the choice that best completes the statement or answers the question.. Calculate 0% of 00. a. b. 0 c. 000 d. 00. Seyran's

More information

Direct Proof MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Direct Proof Fall / 24

Direct Proof MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Direct Proof Fall / 24 Direct Proof MAT231 Transition to Higher Mathematics Fall 2014 MAT231 (Transition to Higher Math) Direct Proof Fall 2014 1 / 24 Outline 1 Overview of Proof 2 Theorems 3 Definitions 4 Direct Proof 5 Using

More information

Data byte 0 Data byte 1 Data byte 2 Data byte 3 Data byte 4. 0xA Register Address MSB data byte Data byte Data byte LSB data byte

Data byte 0 Data byte 1 Data byte 2 Data byte 3 Data byte 4. 0xA Register Address MSB data byte Data byte Data byte LSB data byte SFP200 CAN 2.0B Protocol Implementation Communications Features CAN 2.0b extended frame format 500 kbit/s Polling mechanism allows host to determine the rate of incoming data Registers The SFP200 provides

More information

Self-Directed Course: Transitional Math Module 4: Algebra

Self-Directed Course: Transitional Math Module 4: Algebra Lesson #1: Solving for the Unknown with no Coefficients During this unit, we will be dealing with several terms: Variable a letter that is used to represent an unknown number Coefficient a number placed

More information

CHM Units and Dimensional Analysis (r14) Charles Taylor 1/6

CHM Units and Dimensional Analysis (r14) Charles Taylor 1/6 CHM 110 - Units and Dimensional Analysis (r14) - 2014 Charles Taylor 1/6 Introduction Units are critical in all measurements. If you don't tell someone a unit when you tell them a number, they're not likely

More information

MITOCW ocw f99-lec17_300k

MITOCW ocw f99-lec17_300k MITOCW ocw-18.06-f99-lec17_300k OK, here's the last lecture in the chapter on orthogonality. So we met orthogonal vectors, two vectors, we met orthogonal subspaces, like the row space and null space. Now

More information

Chapter 5. Digital systems. 5.1 Boolean algebra Negation, conjunction and disjunction

Chapter 5. Digital systems. 5.1 Boolean algebra Negation, conjunction and disjunction Chapter 5 igital systems digital system is any machine that processes information encoded in the form of digits. Modern digital systems use binary digits, encoded as voltage levels. Two voltage levels,

More information

Math101, Sections 2 and 3, Spring 2008 Review Sheet for Exam #2:

Math101, Sections 2 and 3, Spring 2008 Review Sheet for Exam #2: Math101, Sections 2 and 3, Spring 2008 Review Sheet for Exam #2: 03 17 08 3 All about lines 3.1 The Rectangular Coordinate System Know how to plot points in the rectangular coordinate system. Know the

More information

Math 2 Variable Manipulation Part 1 Algebraic Equations

Math 2 Variable Manipulation Part 1 Algebraic Equations Math 2 Variable Manipulation Part 1 Algebraic Equations 1 PRE ALGEBRA REVIEW OF INTEGERS (NEGATIVE NUMBERS) Numbers can be positive (+) or negative (-). If a number has no sign it usually means that it

More information

JUST THE MATHS UNIT NUMBER 1.6. ALGEBRA 6 (Formulae and algebraic equations) A.J.Hobson

JUST THE MATHS UNIT NUMBER 1.6. ALGEBRA 6 (Formulae and algebraic equations) A.J.Hobson JUST THE MATHS UNIT NUMBER 1.6 ALGEBRA 6 (Formulae and algebraic equations) by A.J.Hobson 1.6.1 Transposition of formulae 1.6. of linear equations 1.6.3 of quadratic equations 1.6. Exercises 1.6.5 Answers

More information

Define a rational expression: a quotient of two polynomials. ..( 3 10) (3 2) Rational expressions have the same properties as rational numbers:

Define a rational expression: a quotient of two polynomials. ..( 3 10) (3 2) Rational expressions have the same properties as rational numbers: 1 UNIT 7 RATIONAL EXPRESSIONS & EQUATIONS Simplifying Rational Epressions Define a rational epression: a quotient of two polynomials. A rational epression always indicates division EX: 10 means..( 10)

More information

Math 016 Lessons Wimayra LUY

Math 016 Lessons Wimayra LUY Math 016 Lessons Wimayra LUY wluy@ccp.edu MATH 016 Lessons LESSON 1 Natural Numbers The set of natural numbers is given by N = {0, 1, 2, 3, 4...}. Natural numbers are used for two main reasons: 1. counting,

More information

Context-free grammars and languages

Context-free grammars and languages Context-free grammars and languages The next class of languages we will study in the course is the class of context-free languages. They are defined by the notion of a context-free grammar, or a CFG for

More information

What to Add Next time you update?

What to Add Next time you update? What to Add Next time you update? Work sheet with 3 and 4 resistors Create worksheet of tables Add Hypothesis and Questions Add Lab and Lecture Objectives Add equipment needed Add science standards Review

More information

Carmen s Core Concepts (Math 135)

Carmen s Core Concepts (Math 135) Carmen s Core Concepts (Math 135) Carmen Bruni University of Waterloo Week 3 1 Translating From Mathematics to English 2 Contrapositive 3 Example of Contrapositive 4 Types of Implications 5 Contradiction

More information

1.2 Functions What is a Function? 1.2. FUNCTIONS 11

1.2 Functions What is a Function? 1.2. FUNCTIONS 11 1.2. FUNCTIONS 11 1.2 Functions 1.2.1 What is a Function? In this section, we only consider functions of one variable. Loosely speaking, a function is a special relation which exists between two variables.

More information

Modern Algebra Prof. Manindra Agrawal Department of Computer Science and Engineering Indian Institute of Technology, Kanpur

Modern Algebra Prof. Manindra Agrawal Department of Computer Science and Engineering Indian Institute of Technology, Kanpur Modern Algebra Prof. Manindra Agrawal Department of Computer Science and Engineering Indian Institute of Technology, Kanpur Lecture 02 Groups: Subgroups and homomorphism (Refer Slide Time: 00:13) We looked

More information

Numbering Systems. Contents: Binary & Decimal. Converting From: B D, D B. Arithmetic operation on Binary.

Numbering Systems. Contents: Binary & Decimal. Converting From: B D, D B. Arithmetic operation on Binary. Numbering Systems Contents: Binary & Decimal. Converting From: B D, D B. Arithmetic operation on Binary. Addition & Subtraction using Octal & Hexadecimal 2 s Complement, Subtraction Using 2 s Complement.

More information

Math 56 Homework 1 Michael Downs. ne n 10 + ne n (1)

Math 56 Homework 1 Michael Downs. ne n 10 + ne n (1) . Problem (a) Yes. The following equation: ne n + ne n () holds for all n R but, since we re only concerned with the asymptotic behavior as n, let us only consider n >. Dividing both sides by n( + ne n

More information

We want to determine what the graph of an exponential function. y = a x looks like for all values of a such that 0 > a > 1

We want to determine what the graph of an exponential function. y = a x looks like for all values of a such that 0 > a > 1 Section 5 B: Graphs of Decreasing Eponential Functions We want to determine what the graph of an eponential function y = a looks like for all values of a such that 0 > a > We will select a value of a such

More information

EE 209 Spiral 1 Exam Solutions Name:

EE 209 Spiral 1 Exam Solutions Name: EE 29 Spiral Exam Solutions Name:.) Answer the following questions as True or False a.) A 4-to- multiplexer requires at least 4 select lines: true / false b.) An 8-to- mux and no other logic can be used

More information

Lecture Slides. Elementary Statistics Eleventh Edition. by Mario F. Triola. and the Triola Statistics Series 4.1-1

Lecture Slides. Elementary Statistics Eleventh Edition. by Mario F. Triola. and the Triola Statistics Series 4.1-1 Lecture Slides Elementary Statistics Eleventh Edition and the Triola Statistics Series by Mario F. Triola 4.1-1 4-1 Review and Preview Chapter 4 Probability 4-2 Basic Concepts of Probability 4-3 Addition

More information

Chapter 1: Solutions to Exercises

Chapter 1: Solutions to Exercises 1 DIGITAL ARITHMETIC Miloš D. Ercegovac and Tomás Lang Morgan Kaufmann Publishers, an imprint of Elsevier, c 2004 Exercise 1.1 (a) 1. 9 bits since 2 8 297 2 9 2. 3 radix-8 digits since 8 2 297 8 3 3. 3

More information

ENGIN 112 Intro to Electrical and Computer Engineering

ENGIN 112 Intro to Electrical and Computer Engineering ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems Overview Hexadecimal numbers Related to binary and octal numbers Conversion between hexadecimal, octal and binary Value

More information

Binary Floating-Point Numbers

Binary Floating-Point Numbers Binary Floating-Point Numbers S exponent E significand M F=(-1) s M β E Significand M pure fraction [0, 1-ulp] or [1, 2) for β=2 Normalized form significand has no leading zeros maximum # of significant

More information

1 Limits and continuity

1 Limits and continuity 1 Limits and continuity Question 1. Which of the following its can be evaluated by continuity ( plugging in )? sin(x) (a) x + 1 (d) x 3 x 2 + x 6 (b) e x sin(x) (e) x 2 + x 6 (c) x 2 x 2 + x 6 (f) n (

More information

CHAPTER 2 NUMBER SYSTEMS

CHAPTER 2 NUMBER SYSTEMS CHAPTER 2 NUMBER SYSTEMS The Decimal Number System : We begin our study of the number systems with the familiar decimal number system. The decimal system contains ten unique symbol 0, 1, 2, 3, 4, 5, 6,

More information

LESSON EII.C EQUATIONS AND INEQUALITIES

LESSON EII.C EQUATIONS AND INEQUALITIES LESSON EII.C EQUATIONS AND INEQUALITIES LESSON EII.C EQUATIONS AND INEQUALITIES 7 OVERVIEW Here s what you ll learn in this lesson: Linear a. Solving linear equations b. Solving linear inequalities Once

More information

Lesson #9 Simplifying Rational Expressions

Lesson #9 Simplifying Rational Expressions Lesson #9 Simplifying Rational Epressions A.A.6 Perform arithmetic operations with rational epressions and rename to lowest terms Factor the following epressions: A. 7 4 B. y C. y 49y Simplify: 5 5 = 4

More information

8.3 Zero, Negative, and Fractional Exponents

8.3 Zero, Negative, and Fractional Exponents www.ck2.org Chapter 8. Eponents and Polynomials 8.3 Zero, Negative, and Fractional Eponents Learning Objectives Simplify epressions with zero eponents. Simplify epressions with negative eponents. Simplify

More information

Physics 8 Monday, September 12, 2011

Physics 8 Monday, September 12, 2011 Physics 8 Monday, September 12, 2011 If you didn t pick up second half of textbook (starting with Chapter 8) on Friday, you can pick it up now. The bookstore is expecting more clickers to arrive soon (tomorrow?

More information

DIVIDER IMPLEMENTATION

DIVIDER IMPLEMENTATION c n = cn-= DAIL LLAOCCA CLab@OU DIVID IPLTATIO The division of two unsigned integer numbers A (where A is the dividend and the divisor), results in a quotient and a residue. These quantities are related

More information

ALU (3) - Division Algorithms

ALU (3) - Division Algorithms HUMBOLDT-UNIVERSITÄT ZU BERLIN INSTITUT FÜR INFORMATIK Lecture 12 ALU (3) - Division Algorithms Sommersemester 2002 Leitung: Prof. Dr. Miroslaw Malek www.informatik.hu-berlin.de/rok/ca CA - XII - ALU(3)

More information

Computer Architecture, IFE CS and T&CS, 4 th sem. Representation of Integer Numbers in Computer Systems

Computer Architecture, IFE CS and T&CS, 4 th sem. Representation of Integer Numbers in Computer Systems Representation of Integer Numbers in Computer Systems Positional Numbering System Additive Systems history but... Roman numerals Positional Systems: r system base (radix) A number value a - digit i digit

More information

Mechanics, Heat, Oscillations and Waves Prof. V. Balakrishnan Department of Physics Indian Institute of Technology, Madras

Mechanics, Heat, Oscillations and Waves Prof. V. Balakrishnan Department of Physics Indian Institute of Technology, Madras Mechanics, Heat, Oscillations and Waves Prof. V. Balakrishnan Department of Physics Indian Institute of Technology, Madras Lecture 08 Vectors in a Plane, Scalars & Pseudoscalers Let us continue today with

More information

CprE 281: Digital Logic

CprE 281: Digital Logic CprE 281: Digital Logic Instructor: Alexander Stoytchev http://www.ece.iastate.edu/~alexs/classes/ Synchronous Sequential Circuits Basic Design Steps CprE 281: Digital Logic Iowa State University, Ames,

More information

ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER / Lines and Their Equations

ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER / Lines and Their Equations ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER 1 017/018 DR. ANTHONY BROWN. Lines and Their Equations.1. Slope of a Line and its y-intercept. In Euclidean geometry (where

More information

Recitation 4: Quantifiers and basic proofs

Recitation 4: Quantifiers and basic proofs Math 299 Recitation 4: Quantifiers and basic proofs 1. Quantifiers in sentences are one of the linguistic constructs that are hard for computers to handle in general. Here is a nice pair of example dialogues:

More information

DIRECTED NUMBERS ADDING AND SUBTRACTING DIRECTED NUMBERS

DIRECTED NUMBERS ADDING AND SUBTRACTING DIRECTED NUMBERS DIRECTED NUMBERS POSITIVE NUMBERS These are numbers such as: 3 which can be written as +3 46 which can be written as +46 14.67 which can be written as +14.67 a which can be written as +a RULE Any number

More information

STEP Support Programme. Hints and Partial Solutions for Assignment 17

STEP Support Programme. Hints and Partial Solutions for Assignment 17 STEP Support Programme Hints and Partial Solutions for Assignment 7 Warm-up You need to be quite careful with these proofs to ensure that you are not assuming something that should not be assumed. For

More information

AN ALGEBRA PRIMER WITH A VIEW TOWARD CURVES OVER FINITE FIELDS

AN ALGEBRA PRIMER WITH A VIEW TOWARD CURVES OVER FINITE FIELDS AN ALGEBRA PRIMER WITH A VIEW TOWARD CURVES OVER FINITE FIELDS The integers are the set 1. Groups, Rings, and Fields: Basic Examples Z := {..., 3, 2, 1, 0, 1, 2, 3,...}, and we can add, subtract, and multiply

More information

CSE 20 Discrete Math. Algebraic Rules for Propositional Formulas. Summer, July 11 (Day 2) Number Systems/Computer Arithmetic Predicate Logic

CSE 20 Discrete Math. Algebraic Rules for Propositional Formulas. Summer, July 11 (Day 2) Number Systems/Computer Arithmetic Predicate Logic CSE 20 Discrete Math Algebraic Rules for Propositional Formulas Equivalences between propositional formulas (similar to algebraic equivalences): Associative Summer, 2006 July 11 (Day 2) Number Systems/Computer

More information

System Data Bus (8-bit) Data Buffer. Internal Data Bus (8-bit) 8-bit register (R) 3-bit address 16-bit register pair (P) 2-bit address

System Data Bus (8-bit) Data Buffer. Internal Data Bus (8-bit) 8-bit register (R) 3-bit address 16-bit register pair (P) 2-bit address Intel 8080 CPU block diagram 8 System Data Bus (8-bit) Data Buffer Registry Array B 8 C Internal Data Bus (8-bit) F D E H L ALU SP A PC Address Buffer 16 System Address Bus (16-bit) Internal register addressing:

More information