Computer Organization and Architecture Tutorial 5 Kenneth Lee.

Slides:



Advertisements
Similar presentations
Computer Organization and Architecture Tutorial 6 Kenneth Lee.
Advertisements

Addition and Subtraction. Outline Arithmetic Operations (Section 1.2) – Addition – Subtraction – Multiplication Complements (Section 1.5) – 1’s complement.
EMB1006 The Binary System There is no 2 Jonathan-Lee Jones.
Addition of two binary numbers = = = = 39.
Arithmetic & Logic Unit Does the calculations Everything else in the computer is there to service this unit Handles integers May handle floating point.
Assembly Language and Computer Architecture Using C++ and Java
Chapter 5 Floating Point Numbers. Real Numbers l Floating point representation is used whenever the number to be represented is outside the range of integer.
Negative Numbers Module M3.3 Section 2.4. Negative Numbers Subtract by adding ’s complement Ignore carry.
CSCI 3 CH 1.6. REMINDER Remember to put your Student ID # on your homework Remember to put your Student ID # on your homework If you are not going to.
Exercise 2.5 If each number is represented with 5 bits, 7 = in all three systems -7 = (1's complement) = (signed magnitude) = (2's.
Complements: different approaches for representing negative numbers
Introduction to Number Systems
Data Storage. SIGN AND MAGNITUDE Storing and representing numbers.
Number Systems Lecture 02.
Operations on data CHAPTER 4.
Chapter 3 Data Representation part2 Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2010.
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.
Computer Organization & Programming Chapter2 Number Representation and Logic Operations.
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
Basic Arithmetic (adding and subtracting)
NUMBER REPRESENTATION CHAPTER 3 – part 3. ONE’S COMPLEMENT REPRESENTATION CHAPTER 3 – part 3.
Chapter 1 Data Storage(3) Yonsei University 1 st Semester, 2015 Sanghyun Park.
Computer Architecture
COMPUTER ORGANIZATIONS CSNB123 May 2014Systems and Networking1.
Digital Electronics and Computer Interfacing Tim Mewes 3. Digital Electronics.
CSE 111 Representing Numeric Data in a Computer Slides adapted from Dr. Kris Schindler.
Complement Numbers. Outline  Negative Numbers Representation  Sign-and-magnitude  1s Complement  2s Complement  Comparison of Sign-and-Magnitude.
CPS120: Introduction to Computer Science Computer Math: Signed Numbers.
Basic Arithmetic (adding and subtracting)
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: October 20, 2004 Lecture Number: 23.
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.
Representation of Data Ma King Man. Reference Text Book: Volume 2 Notes: Chapter 19.
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 ≤
ECE 301 – Digital Electronics Unsigned and Signed Numbers, Binary Arithmetic of Signed Numbers, and Binary Codes (Lecture #2)
Mohammad Amin Kuhail M.Sc. (York, UK) University of Palestine Faculty of Engineering and Urban planning Software Engineering Department Digital Logic Design.
Positional Number Systems
Number Representation
ECE2030 Introduction to Computer Engineering Lecture 2: Number System Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Tech.
Lecture 2 Binary Values and Number Systems. The number 943 is an example of a number written in positional notation. The relative positions of the digits.
Operations on Bits Arithmetic Operations Logic Operations
Number Systems Binary to Decimal Octal to Decimal Hexadecimal to Decimal Binary to Octal Binary to Hexadecimal Two’s Complement.
Computer Organization and Architecture Tutorial 1 Kenneth Lee.
C.S. Choy1 ITM1010 COMPUTER AND COMMUNICATION TECHNOLOGIES Prof. C.S. Choy, room 412 Prof. H.K. Tsang, room 306 Tutors: CY Poon ZJ Zhang CW Lee SK Cheung.
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.
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.
COMPUTER SCIENCE Data Representation and Machine Concepts Section 1.6 Instructor: Lin Chen Sept 2013.
Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Signed Integers The highest bit indicates the sign. 1 = negative, 0 = positive.
Floating Point Binary A2 Computing OCR Module 2509.
IT1004: Data Representation and Organization Negative number representation.
Integers’ Representation. Binary Addition. Two's Complement. Unsigned number representation Binary Addition, Subtraction. Overflow of unsigned numbers.
Branch Addressing op rs rt address address beq $s1, $s2, Label if ($s1 = =$s2) go to Label 6 bits 5 bits 5 bits 16 bits effective 32 bit address.
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 8 Dr. Shi Dept. of Electrical and Computer Engineering.
1 Ethics of Computing MONT 113G, Spring 2012 Session 4 Binary Addition.
Computer Organization 1 Data Representation Negative Integers.
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 Arithmetic James A. Rome Tennessee Governor's Academy August 2010.
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:
CHAPTER 9 COMPUTER ARITHMETIC - ALU
CSC 143 Two' s complement.
Binary Math Basic operations.
Unit 18: Computational Thinking
CPS120: Introduction to Computer Science
CSC 220: Computer Organization Signed Number Representation
Lecture No.5.
Chapter 1 (Part c) Digital Systems and Binary Numbers
Presentation transcript:

Computer Organization and Architecture Tutorial 5 Kenneth Lee

+18 = (sign magnitude, 8 bits) +18 = (sign magnitude, 16 bits) −18 = (sign magnitude, 8 bits) −18 = (sign magnitude, 16 bits) +18 = (twos complement, 8 bits) +18 = (twos complement, 16 bits) −18 = (twos complement, 8 bits) −18 = (twos complement, 16 bits)

Boolean complement

−8 = 1000 (twos complement, 4 bits) The twos complement of 1000 is

Definition of XOR: XOR(0,0)=0; XOR(1,1)=0; XOR(0,1)=1; XOR(1,0)=1;

Example: Twos complement, 4 bits (-2~1) (1) Carry into the leftmost:0; Carry out of the leftmost:0; XOR(0,0)=0; There is no overflow. (0+1=1) (2) Carry into the leftmost:1; Carry out of the leftmost:0; XOR(1,0)=1; There is a overflow. (1+1=−2)

(3) Carry into the leftmost:0; Carry out of the leftmost:1; XOR(0,1)=1; There is a overflow. (-2-1=1) (4) Carry into the leftmost:1; Carry out of the leftmost:1; XOR(1,1)=0; There is no overflow. (-1-1=-2)

Example: (1)1-digit numbers, base 10 9∙9=81 (2) 2-digit numbers, base 2 11∙11=1001 Notation: n-digit number base 2 is different with their twos complement! The max of a n-digit base 2 number is 2 n -1, but the max of a n-digit twos complement is 2 n-1 -1

a.Memory cycle time = = 100 ns data rate = 1 bit/100 ns = 10,000,000 bits/s = 10 Mbps b.32*10 = 320 Mbps = 40 MB/s