CSE20 Lecture 2: Number Systems: Binary Numbers, Gray Code, and Negative Numbers CK Cheng 1.

Slides:



Advertisements
Similar presentations
CSE 351 Midterm Review. Your midterm is next Wednesday Study past midterms (link on the website) Point of emphasis: Registers are not memory Registers.
Advertisements

2’s Complement Arithmetic (remember it’s a fixed length system)
Number Systems Discussion D4.1 Appendix C. Number Systems Counting in Binary Positional Notation Hexadecimal Numbers Negative Numbers.
CSE111: Great Ideas in Computer Science Dr. Carl Alphonce 219 Bell Hall Office hours: M-F 11:00-11:
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.
1 CSE1301 Computer Programming Lecture 28 Number Representation (Integer)
Negative Numbers Module M3.3 Section 2.4. Negative Numbers Subtract by adding ’s complement Ignore carry.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Number Representation (1) Fall 2005 Lecture 12: Number Representation Integers and Computer Arithmetic.
Digital Circuits. Analog and Digital Signals Noise margins in Logic Circuits VMVM.
VIT UNIVERSITY1 ECE 103 DIGITAL LOGIC DESIGN CHAPTER I NUMBER SYSTEMS AND CODES Reference: M. Morris Mano & Michael D. Ciletti, "Digital Design", Fourth.
ECE 301 – Digital Electronics Number Systems and Conversion, Binary Arithmetic, and Representation of Negative Numbers (Lecture #10) The slides included.
CSE20 Lecture 3 Number Systems: Negative Numbers 1.Sign and Magnitude Representation 2.1’s Complement Representation 3.2’s Complement Representation 1.
Number Systems and Codes Discussion D4.1. Number Systems Counting in Binary Positional Notation Hexadecimal Numbers Negative Numbers.
Computer ArchitectureFall 2007 © August 29, 2007 Karem Sakallah CS 447 – Computer Architecture.
Number System and Codes
1 CSE 20: Lecture 7 Boolean Algebra CK Cheng 4/21/2011.
1 Lecture 2: Number Systems Binary numbers Base conversion Arithmetic Number systems  Sign and magnitude  Ones-complement  Twos-complement Binary-coded.
1.6 Signed Binary Numbers.
CSE 20 Discrete Mathematics Instructor CK Cheng, CSE2130 tel: Teaching Assistants Jingwei Lu
Rules of Integers. Positive numbers are numbers that are above zero. Negative numbers are numbers below zero.
Binary Addition Addition Rules: = = = = = carry 1 1 carry 1 Example 1: Example 2:
ECE 2110: Introduction to Digital Systems Signed Number Conversions.
1 Week 3: Data Representation: Negative Numbers READING: Chapter 3.
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
Computer Architecture
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: October 29, 2004 Lecture Number: 26.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION.
Ch. 10 – Fundamentals of Logic Circuits So far, the circuits we’ve discussed were analog circuits, meaning that circuit parameters such as voltage and.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
ECE 331 – Digital System Design
ECE 301 – Digital Electronics Unsigned and Signed Numbers, Binary Arithmetic of Signed Numbers, and Binary Codes (Lecture #2)
Slide 3- 1 Rule 1 Derivative of a Constant Function.
ECE2030 Introduction to Computer Engineering Lecture 2: Number System Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Tech.
ECE 2110: Introduction to Digital Systems Signed Addition/Subtraction.
Notes Over 11.2 Arithmetic Sequences An arithmetic sequence has a common difference between consecutive terms. The sum of the first n terms of an arithmetic.
The Teacher CP4 Binary and all that… CP4 Revision.
Microprocessor Technique Binary codes. Lecture 2 1/47 Binary codes in microprocessor technique Integer arithmetic Fix-point arithmetic Floating-point.
ECE 331 – Digital System Design Representation and Binary Arithmetic of Negative Numbers and Binary Codes (Lecture #10) The slides included herein were.
By Jariya Phongsai A two's-complement system is a system in which negative numbers are represented by the two's complement of the absolute value; this.
Data Representation in Computer Systems. 2 Signed Integer Representation The conversions we have so far presented have involved only positive numbers.
07/12/ Data Representation Two’s Complement & Binary Arithmetic.
Two’s Complement. A system used to represent a negative number in binary A system used to represent a negative number in binary Positive numbers start.
1 CSC 143 Two' s complement. 2 10's complement  How to represent negative numbers?  Use a sign → but −0 is the same as +0  10's complement  Example.
Addition and Substraction
WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)
CEC 220 Digital Circuit Design Binary Codes
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
CEC 220 Digital Circuit Design Binary Arithmetic & Negative Numbers Monday, January 13 CEC 220 Digital Circuit Design Slide 1 of 14.
School of Computer and Communication Engineering, UniMAP Mohd ridzuan mohd nor DKT 122/3 - DIGITAL SYSTEM I Chapter.
CEC 220 Digital Circuit Design Binary Arithmetic & Negative Numbers Fri, Aug 28 CEC 220 Digital Circuit Design Slide 1 of 14.
CSE20 Lecture 2: Number Systems: Binary Numbers and Gray Code CK Cheng 1.
1 COMS 161 Introduction to Computing Title: Computing Basics Date: September 8, 2004 Lecture Number: 7.
CEC 220 Digital Circuit Design Binary Codes Mon, Aug 31 CEC 220 Digital Circuit Design Slide 1 of 14.
Binary Addition and Subtraction. Arithmetic Operations Arithmetic operations in a computer are done using binary numbers and not decimal numbers and these.
09/03/20161 Information Representation Two’s Complement & Binary Arithmetic.
Computer Organization 1 Data Representation Negative Integers.
I. Adding Two Positive Integers (Regular Addition) 1.) = 2.) = 3.) = 4.) = 1-7 Adding Integers There are three parts to today's.
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
ECE 3110: Introduction to Digital Systems Signed Number Conversions and operations.
CSE370, Lecture 2 Lecture 2: Number Systems  Logistics Webpage is up! HW1 is posted on the web in the calender --- due.
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.
Advanced Binary b. describe and use two’s complement and sign and magnitude to represent negative integers; c. perform integer binary arithmetic, that.
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:
David Kauchak CS 52 – Spring 2017
CSE 102 Introduction to Computer Engineering
Arithmetic Sequences and Series
BCD = Binary Coded Decimal
CSE20 Lecture 3 Number Systems
Presentation transcript:

CSE20 Lecture 2: Number Systems: Binary Numbers, Gray Code, and Negative Numbers CK Cheng 1

Number Systems 1.Introduction 2.Binary Numbers 3.Gray code 4.Negative Numbers 5.Residual Numbers 2

2. Binary Numbers b2b2 b1b1 b0b0 Value = = Examples: (3) (5) (8) (3) (6) (9) This is a non-redundant number system 3

2. Binary Cont. abCarrySum idabcCarrySum *0 + 0=000id 0 2*0 + 1=001id 1 2*1 + 0=110id 6 2*1 + 1=111id 7 RULE: 2 x Carry + Sum = a + b + c 4

3. Gray Code reflection Low power (reliability) when the numbers are consecutive in series. The idea is to only change ONE bit at a time. e.g. addresses, analog signals NOTE: Not for arithmetic operations (the rule is too complicated) 5

4. Negative Numbers Given a positive integer x, represent the negative integer –x in (b n-1, …, b 0 ) (i) Signed bit system b n-1 =1: negative, (b n-2,…,b 0 )=x. (ii) One's Complement Present 2 n x in binary. (iii) Two's Complement Present 2 n – x in binary. Ignore bit b n. 6

4. Negative Numbers NOTE: Back to binary system idb3b3 b2b2 b1b1 b0b0 SignedOne'sTwo's (i) Signed bit - x b3: negative (ii) One's Complement 2 n x (iii) Two's Complement 2 n - x n is the number of bits (in this case n=4) One's ComplementTwo's Complement 8 = x8 = 16 - x 9 = – x Use the above formulas to solve for x when number is negative Two's (b 4 )b3b3 b2b2 b1b1 b0b Deriving One’s and Two’sReverse Derivation 7