ECE 331 – Digital System Design

Slides:



Advertisements
Similar presentations
Lecture 4. Basic Binary Arithmetic 2 Single-bit AdditionSingle-bit Subtraction s c xy Carry Sum d xy
Advertisements

ECE 331 – Digital System Design
ECE 331 – Digital System Design
CS 151 Digital Systems Design Lecture 3 More Number Systems.
MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 1 Lecture 3 Number System.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
ECE 301 – Digital Electronics Course Introduction, Number Systems, Conversion between Bases, and Basic Binary Arithmetic (Lecture #1)
ECE 331 – Digital System Design
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.
1 CSE-221 Digital Logic Design (DLD) Lecture-1: Digital Systems & Number Systems.
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.
1 Number Systems. 2 Numbers Each number system is associated with a base or radix – The decimal number system is said to be of base or radix 10 A number.
Introduction to Number Systems
FIGURES FOR CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Number Systems Lecture 02.
1 Lecture 2: Number Systems Binary numbers Base conversion Arithmetic Number systems  Sign and magnitude  Ones-complement  Twos-complement Binary-coded.
Based on slides by:Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. ECE/CS 352: Digital System Fundamentals Lecture 1 – Number Systems and.
#1 Lec # 2 Winter EECC341 - Shaaban Positional Number Systems A number system consists of an order set of symbols (digits) with relations.
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION.
1 Digital Design: Number Systems Credits : Slides adapted from: J.F. Wakerly, Digital Design, 4/e, Prentice Hall, 2006 C.H. Roth, Fundamentals of Logic.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Lecture 4 Last Lecture –Positional Numbering Systems –Converting Between Bases Today’s Topics –Signed Integer Representation Signed magnitude One’s complement.
Engineering 1040: Mechanisms & Electric Circuits Spring 2014 Number Systems.
Computer Number Systems. d n-1 d n-2 d n d 2-m d 1-m d -m Conventional Radix Number r is the radixd i is a digit d i Є {0, 1, ….., r – 1 } -m ≤
Computer Arithmetic and the Arithmetic Unit Lesson 2 - Ioan Despi.
1 EENG 2710 Chapter 1 Number Systems and Codes. 2 Chapter 1 Homework 1.1c, 1.2c, 1.3c, 1.4e, 1.5e, 1.6c, 1.7e, 1.8a, 1.9a, 1.10b, 1.13a, 1.19.
ECE 301 – Digital Electronics Unsigned and Signed Numbers, Binary Arithmetic of Signed Numbers, and Binary Codes (Lecture #2)
Dr. Ahmed Telba EE208: Logic Design Lecture# 1 Introduction & Number Systems.
Number systems, Operations, and Codes
Introduction to Computing Dr. Nadeem A Khan. Lecture 10.
ECE2030 Introduction to Computer Engineering Lecture 2: Number System Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Tech.
Number Systems and Logic Prepared by Dr P Marais (Modified by D Burford)
ECE 331 – Digital System Design Representation and Binary Arithmetic of Negative Numbers and Binary Codes (Lecture #10) The slides included herein were.
Chapter 1  Number Systems Decimal System Binary System Octal System Hexadecimal System  Binary weighted cods Signed number binary order  1’s and 2’s.
CDP ECE Spring 2000 ECE 291 Spring 2000 Lecture 2: Number Systems & x86 Instructions Constantine D. Polychronopoulos Professor, ECE Office: 463.
ECE 301 – Digital Electronics Representation of Negative Numbers, Binary Arithmetic of Negative Numbers, and Binary Codes (Lecture #11) The slides included.
1 Positive numbers are well understood An n-bit number represents numbers from 0 to 2 n -1 n+m bits can be used to represent n-bit integer and m-bit fraction.
WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)
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.
Chapter 2 Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in.
NUMBER SYSTEMS AND CODES. CS Digital LogicNumber Systems and Codes2 Outline Number systems –Number notations –Arithmetic –Base conversions –Signed.
CPEN Digital Logic Design Binary Systems Spring 2004 C. Gerousis © Digital Design 3 rd Ed., Mano Prentice Hall.
1 Digital Logic Design Lecture 2 More Number Systems/Complements.
CSC 331: DIGITAL LOGIC DESIGN COURSE LECTURER: E. Y. BAAGYERE. CONTACT: LECTURE TIME: 15:40 – 17:45 hrs. VENUE: SP-LAB.
©2010 Cengage Learning SLIDES FOR CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION Click the mouse to move to the next page. Use the ESC key to exit.
Computer Organization 1 Data Representation Negative Integers.
Lecture No. 4 Computer Logic Design. Negative Number Representation 3 Options –Sign-magnitude –One’s Complement –Two’s Complement  used in computers.
Binary Values. Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative Numbers.
1 Digital Logic Design (41-135) Chapter 5 Number Representation & Arithmetic Circuits Younglok Kim Dept. of Electrical Engineering Sogang University Spring.
Unit I From Fundamentals of Logic Design by Roth and Kinney.
1 CE 454 Computer Architecture Lecture 4 Ahmed Ezzat The Digital Logic, Ch-3.1.
Fundamentals of Computer Science
Unit 1 Introduction Number Systems and Conversion.
Introduction to Computing
Integer Real Numbers Character Boolean Memory Address CPU Data Types
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
CHAPTER 1 : INTRODUCTION
Number Systems.
Data Representation in Computer Systems
Digital Logic Design (ECEg3141) 2. Number systems, operations & codes 1.
Digital Logic Design (CSNB163)
ECE 301 – Digital Electronics
ECE 331 – Digital System Design
COE 202: Digital Logic Design Number Systems Part 2
Presentation transcript:

ECE 331 – Digital System Design Number Systems and Conversion, Binary Arithmetic, and Representation of Negative Numbers (Lecture #10) The slides included herein were taken from the materials accompanying Fundamentals of Logic Design, 6th Edition, by Roth and Kinney, and were used with permission from Cengage Learning.

ECE 331 - Digital System Design 52 What does this number represent? Consider the “context” in which it is used. Spring 2011 ECE 331 - Digital System Design

ECE 331 - Digital System Design 1011001.101 What is the decimal value of this number? Consider the base (or radix) of this number. Spring 2011 ECE 331 - Digital System Design

ECE 331 - Digital System Design Number Systems Spring 2011 ECE 331 - Digital System Design

ECE 331 - Digital System Design Number Systems R is the radix (or base) of the number system. Must be a positive number R digits in the number system: [0 .. R-1] Important number systems for digital systems: Base 2 (binary) [0, 1] Base 8 (octal) [0 .. 7] Base 16 (hexadecimal) [0 .. 9, A .. F] Spring 2011 ECE 331 - Digital System Design

ECE 331 - Digital System Design Number Systems Positional Notation [a4a3a2a1a0.a-1a-2a-3]R ai = ith position in the number R = radix or base of the number radix point Spring 2011 ECE 331 - Digital System Design

+ a-1 x R-1 + a-2 x R-2 + … a-m x R-m Number Systems Power Series Expansion D = an x R4 + an-1 x R3 + … + a0 x R0 + a-1 x R-1 + a-2 x R-2 + … a-m x R-m D = decimal value ai = ith position in the number R = radix or base of the number Spring 2011 ECE 331 - Digital System Design

Number Systems: Example Decimal 927.4510 = 9 x 102 + 2 x 101 + 7 x 100 + 4 x 10-1 + 5 x 10-2 Spring 2011 ECE 331 - Digital System Design

Number Systems: Example Binary 1101.1012 = 1 x 23 + 1 x 22 + 0 x 21 + 1 x 20 + 1 x 2-1 + 0 x 2-2 + 1 x 2-3 Spring 2011 ECE 331 - Digital System Design

Number Systems: Example Octal 326.478 = 3 x 82 + 2 x 81 + 6 x 80 + 4 x 8-1 + 7 x 8-2 Spring 2011 ECE 331 - Digital System Design

Number Systems: Example Hexadecimal E5A.2B16 = 14 x 162 + 5 x 161 + 10 x 160 + 2 x 16-1 + 11 x 16-2 Spring 2011 ECE 331 - Digital System Design

Conversion between Number Systems Spring 2011 ECE 331 - Digital System Design

Conversion of a Decimal Integer Use repeated division to convert a decimal integer to any other base. Spring 2011 ECE 331 - Digital System Design

Conversion of a Decimal Integer Example: Convert the decimal number 57 to binary and to octal: 57 / 2 = 28: rem = 1 = a0 28 / 2 = 14: rem = 0 = a1 14 / 2 = 7: rem = 0 = a2 7 / 2 = 3: rem = 1 = a3 3 / 2 = 1: rem = 1 = a4 1 / 2 = 0: rem = 1 = a5 5710 = 1110012 57 / 8 = 7: rem = 1 = a0 7 / 8 = 0: rem = 7 = a1 5710 = 718 Spring 2011 ECE 331 - Digital System Design

Conversion of a Decimal Fraction Use repeated multiplication to convert a decimal fraction to any other base. Spring 2011 ECE 331 - Digital System Design

Conversion of a Decimal Fraction Example: Convert the decimal number 0.625 to binary and to octal. 0.625 * 2 = 1.250: a-1 = 1 0.250 * 2 = 0.500: a-2 = 0 0.500 * 2 = 1.000: a-3 = 1 0.62510 = 0.1012 0.625 * 8 = 5.000: a0 = 5 0.62510 = 0.58 Spring 2011 ECE 331 - Digital System Design

Conversion of a Decimal Fraction Example: Convert the decimal number 0.7 to binary. 0.7 * 2 = 1.4: a-1 = 1 0.4 * 2 = 0.8: a-2 = 0 0.8 * 2 = 1.6: a-3 = 1 0.6 * 2 = 1.2: a-4 = 1 0.2 * 2 = 0.4: a-5 = 0 0.4 * 2 = 0.8: a-6 = 0 0.710 = 0.1 0110 0110 0110 ...2 In some cases, conversion results in a repeating fraction. process begins repeating here! Spring 2011 ECE 331 - Digital System Design

Conversion of a Mixed Decimal Number Convert the integer part of the decimal number using repeated division. Convert the fractional part of the decimal number using repeated multiplication. Combine the integer and fractional parts in the new base. Spring 2011 ECE 331 - Digital System Design

Conversion of a Mixed Decimal Number Example: Convert 48.562510 to binary. Confirm the results using the Power Series Expansion. Spring 2011 ECE 331 - Digital System Design

Conversion between Bases Conversion between any two bases can be carried out directly using repeated division and repeated multiplication. Base A → Base B However, it is, generally, easier to convert Base A to its decimal equivalent and then convert the decimal value to Base B. Base A → decimal value → Base B Power Series Expansion Repeated Division, Repeated Multiplication Spring 2011 ECE 331 - Digital System Design

Conversion between Bases Conversion between binary and octal can be carried out by inspection. Each octal digit corresponds to 3 bits 101 110 010 . 011 0012 = 5 6 2 . 3 18 010 011 100 . 101 0012 = 2 3 4 . 5 18 7 4 5 . 3 28 = 111 100 101 . 011 0102 3 0 6 . 0 58 = 011 000 110 . 000 1012 Is the number 392.248 a valid octal number? Spring 2011 ECE 331 - Digital System Design

Conversion between Bases Conversion between binary and hexadecimal can be carried out by inspection. Each hexadecimal digit corresponds to 4 bits 1001 1010 0110 . 1011 01012 = 9 A 6 . B 516 1100 1011 1000 . 1110 01112 = C B 8 . E 716 E 9 4 . D 216 = 1110 1001 0100 . 1101 00102 1 C 7 . 8 F16 = 0001 1100 0111 . 1000 11112 Note that the hexadecimal number system requires additional characters to represent its 16 values. Spring 2011 ECE 331 - Digital System Design

ECE 331 - Digital System Design Number Systems Base: 10 2 8 16 What is the value of 12? Spring 2011 ECE 331 - Digital System Design

ECE 331 - Digital System Design Binary Arithmetic Spring 2011 ECE 331 - Digital System Design

ECE 331 - Digital System Design Binary Addition 0 0 1 1 + 0 + 1 + 0 + 1 0 1 1 10 Sum Carry Spring 2011 ECE 331 - Digital System Design

Binary Addition: Examples 01011011 + 01110010 00111100 + 10101010 10110101 + 01101100 Spring 2011 ECE 331 - Digital System Design

ECE 331 - Digital System Design Binary Subtraction 0 10 1 1 - 0 - 1 - 0 - 1 0 1 1 0 Difference Borrow Spring 2011 ECE 331 - Digital System Design

Binary Subtraction: Examples 01110101 - 00110010 00111100 - 10101100 10110001 - 01101100 Spring 2011 ECE 331 - Digital System Design

ECE 331 - Digital System Design Binary Arithmetic Single-bit Addition Single-bit Subtraction What logic function is this? A B Carry Sum 1 A B Difference 1 Spring 2011 ECE 331 - Digital System Design

Binary Multiplication 0 0 1 1 x 0 x 1 x 0 x 1 0 0 0 1 Product Spring 2011 ECE 331 - Digital System Design

Binary Multiplication: Examples 0110 x 1010 1011 x 0110 1001 x 1101 Spring 2011 ECE 331 - Digital System Design

Representation of Negative Numbers Spring 2011 ECE 331 - Digital System Design

ECE 331 - Digital System Design 10011010 What is the decimal value of this number? Is it positive or negative? If negative, what representation are we using? Spring 2011 ECE 331 - Digital System Design

Unsigned and Signed Binary Numbers 1 – Magnitude MSB Unsigned number Sign Signed number 2 0 denotes 1 denotes + Spring 2011 ECE 331 - Digital System Design

Unsigned Binary Numbers For an n-bit unsigned binary number, all n bits are used to represent the magnitude of the number. ** Cannot represent negative numbers. Spring 2011 ECE 331 - Digital System Design

Unsigned Binary Numbers For an n-bit binary number 0 <= D <= 2n – 1 where D = decimal equivalent value For an 8-bit binary number: 0 <= D <= 28 – 1 28 = 256 For a 16-bit binary number: 0 <= D <= 216 – 1 216 = 65536 Spring 2011 ECE 331 - Digital System Design

Signed Binary Numbers For an n-bit signed binary number, n-1 bits are used to represent the magnitude of the number; the leftmost bit is, generally, used to indicate the sign of the number. 0 = positive number 1 = negative number Spring 2011 ECE 331 - Digital System Design

Signed Binary Numbers Representations for signed binary numbers: 1. Sign and Magnitude 2. 1's Complement 3. 2's Complement Spring 2011 ECE 331 - Digital System Design

ECE 331 - Digital System Design Sign and Magnitude For an n-bit signed binary number, The leftmost bit is the sign bit. The remaining n-1 bits represent the magnitude. Includes a representation for +0 and -0 - (2n-1 – 1) <= N <= + (2n-1 – 1) Spring 2011 ECE 331 - Digital System Design

Sign and Magnitude: Example What is the Sign and Magnitude representation for the following decimal values, using 8 bits? + 97 - 68 - 97 + 68 Spring 2011 ECE 331 - Digital System Design

Sign and Magnitude: Example Can the following decimal numbers be represented using 8-bit Sign and Magnitude representation? - 212 - 127 +128 +255 Spring 2011 ECE 331 - Digital System Design

ECE 331 - Digital System Design Questions? Spring 2011 ECE 331 - Digital System Design