Topic 3 Number Representations and Computer Arithmetics

Slides:



Advertisements
Similar presentations
COE 202: Digital Logic Design Signed Numbers
Advertisements

Binary Representation Introduction to Computer Science and Programming I Chris Schmidt.
Chapter 1 Binary Systems 1-1. Digital Systems
Computer ArchitectureFall 2008 © August 25, CS 447 – Computer Architecture Lecture 3 Computer Arithmetic (1)
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
VIT UNIVERSITY1 ECE 103 DIGITAL LOGIC DESIGN CHAPTER I NUMBER SYSTEMS AND CODES Reference: M. Morris Mano & Michael D. Ciletti, "Digital Design", Fourth.
S. Barua – CPSC 240 CHAPTER 2 BITS, DATA TYPES, & OPERATIONS Topics to be covered are Number systems.
Computer ArchitectureFall 2007 © August 29, 2007 Karem Sakallah CS 447 – Computer Architecture.
COMP201 Computer Systems Number Representation. Number Representation Introduction Number Systems Integer Representations Examples  Englander Chapter.
Number Systems Computer Science 210 Computer Organization.
Computer Organization & Programming Chapter2 Number Representation and Logic Operations.
Arithmetic for Computers
Lecture 5.
Computer Arithmetic. Instruction Formats Layout of bits in an instruction Includes opcode Includes (implicit or explicit) operand(s) Usually more than.
How Computers Work Dr. John P. Abraham Professor UTPA.
1 Modified from  Modified from 1998 Morgan Kaufmann Publishers Chapter Three: Arithmetic for Computers citation and following credit line is included:
IT253: Computer Organization
Eng. Mohammed Timraz Electronics & Communication Engineer University of Palestine Faculty of Engineering and Urban planning Software Engineering Department.
Binary Arithmetic & Data representation
CS Data representation 1 Ch. 2.1 Data Representation Unsigned and Signed Integers – representation, addition, subtraction.
Data Representation, Number Systems and Base Conversions
Digital Logic Lecture 3 Binary Arithmetic By Zyad Dwekat The Hashemite University Computer Engineering Department.
CEC 220 Digital Circuit Design Binary Codes
CHAPTER 3 Arithmetic For Computers 1/31/ Topics for discussion 1/31/ Number system: { radix/base, a set of distinct digits, operations} Radix.
CEC 220 Digital Circuit Design Binary Codes Mon, Aug 31 CEC 220 Digital Circuit Design Slide 1 of 14.
Lecture 1.2 (Chapter 1) Prepared by Dr. Lamiaa Elshenawy
DATA REPRESENTATION Data Types Complements Fixed Point Representations
1 Digital Logic Design (41-135) Chapter 5 Number Representation & Arithmetic Circuits Younglok Kim Dept. of Electrical Engineering Sogang University Spring.
1 Chapter 1: Introduction Appendix A: Binary and Hexadecimal Tutorial Assembly Language for Intel-Based Computers, 3rd edition Kip R. Irvine.
1 Chapter 1: Basic Concepts Assembly Language for Intel-Based Computers, 4th edition Kip R. Irvine 9/6/2003.
Computer Representation of Information
Floating Point Numbers
Topic: Binary Encoding – Part 2
Computer Science 210 Computer Organization
Topic: Binary Encoding – Part 1
David Kauchak CS 52 – Spring 2017
Computer Architecture & Operations I
Addition and Subtraction
Chapter 1 Introduction.
CHAPTER 9 COMPUTER ARITHMETIC - ALU
Number Representation
Introduction To Computer Science
Integer Real Numbers Character Boolean Memory Address CPU Data Types
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Microprocessor Systems Design I
Computer Science 210 Computer Organization
EPSII 59:006 Spring 2004.
CSE 102 Introduction to Computer Engineering
Number Systems.
University of Gujrat Department of Computer Science
Overview Introduction Data representation Fixed Point Representation
Topic 3d Representation of Real Numbers
Computer Science 210 Computer Organization
Chapter 2 Bits, Data Types & Operations Integer Representation
BCD = Binary Coded Decimal
Data Representation Data Types Complements Fixed Point Representation
Data Representation in Computer Systems
Arithmetic Logical Unit
Topic 3a Two’s Complement Representation
Computer Science 210 Computer Organization
CS/COE0447 Computer Organization & Assembly Language
Topic 3 Number Representations and Computer Arithmetics
Digital Systems and Binary Numbers
Chapter 1 Number System RGGP, Narwana.
CS/COE0447 Computer Organization & Assembly Language
Chapter 6: Computer Arithmetic
Topic 3d Representation of Real Numbers
COMS 161 Introduction to Computing
Computer Architecture CST 250
Chapter 1 Introduction.
Presentation transcript:

Topic 3 Number Representations and Computer Arithmetics Introduction to Computer Systems Engineering (CPEG 323) 2018/11/24 cpeg323-04F\Topic3-05F

Outline Introduction Number representation and 2’s complement ALU design Integer multiplication/division Real Numbers 2018/11/24 cpeg323-04F\Topic3-05F

Recap Review Steps in executing an instruction? Decoded opcode Fields of an instruction? Performance? Base of the operands? ALU ALU 32 a 32 result 32 b What's up ahead: Number representation Arithmetic algorithms Logic implementation Instructions 2018/11/24 cpeg323-04F\Topic3-05F

Reading Up to now, you should have read (or are reading) New material Patterson and Hennessy, chapters 1-2 and appendix A New material Patterson and Hennessy, chapter 3 2018/11/24 cpeg323-04F\Topic3-05F

Numbers Representation It gets complicated: How to represent negative numbers? What is the range of numbers? What if a number is out of the range? How about rational and irrational numbers? How does hardware add/sub/div/mul these numbers? 2018/11/24 cpeg323-04F\Topic3-05F

Bits and Numbers Bits are just bits: NO inherent meaning conventions define relationship between bits and numbers How does the hardware know which convention is to use? Add $s1, $s2, $s3 Addu $s1, $s2, $s3 What is the sign of $s1, $s2, and $s3? 2018/11/24 cpeg323-04F\Topic3-05F

Number Representations Unsigned integers Signed integers BCD (Binary Coded Decimal) Fixed point Floating point Other types of data: Characters (ASCII, Unicode) Pixels (graphics) Groups of bits 2018/11/24 cpeg323-04F\Topic3-05F

Unsigned Integers Why unsigned integers? How to represent? Memory access, PC, SP, RA In C, unsigned int How to represent? Number your fingers! Radix number system Decimal: 10 different symbols: 0 1 2 3 4 5 6 7 8 9 number= 2018/11/24 cpeg323-04F\Topic3-05F

Unsigned Integers(Radix number system) In general, k-radix number system number= How many different di? What is the biggest number? What is the smallest one? Special cases: 2-radix (binary) 8 (octal) 16 (hexademical) How many different symbols do thy have? 2018/11/24 cpeg323-04F\Topic3-05F

Unsigned Integers(Radix number system, Cont.) How to convert binary to octal and hexadecimal? Example: 010100=(0 *22+1 *21+0*20)*23+(1*22+0*21+0*20) =2*81+ 4 *80= 248 Hexadecimal: 1 9 4 8 B 6 Binary: 000110010100100010110110 0 6 2 4 4 2 6 6 Octal: 2018/11/24 cpeg323-04F\Topic3-05F

Unsigned Integers(BCD: binary coded decimal) Representation: 12710 How many bits necessary for BCD? For binary? Storage space used ? Addition How to determine a carry: “If ai+ bi >10” vs. “If ai+ bi >2” Which one is more efficient for computer, decimal or binary? Also, packed BCD 2018/11/24 cpeg323-04F\Topic3-05F

Signed Integers How to distinguish a negative number from a positive number ? How to do so efficiently ? 2018/11/24 cpeg323-04F\Topic3-05F

Signed Integers (Sign and magnitude) -12: -(sign) 12(absolute value) A separate sign bit A magnitude For hardware: Where to put the sign bit? Right or Left? How to know the sign of addition? (e.g. one extra step ?) What is the sign of 0? (positive and negative 0 ?) 2018/11/24 cpeg323-04F\Topic3-05F