Arithmetic & Logic Unit Does the calculations Everything else in the computer is there to service this unit Handles integers May handle floating point.

Slides:



Advertisements
Similar presentations
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University Arithmetic See: P&H Chapter 3.1-3, C.5-6.
Advertisements

Fixed-Point Arithmetics: Part I

TMA 1271: Introduction to Machine Architecture
Computer ArchitectureFall 2008 © August 25, CS 447 – Computer Architecture Lecture 3 Computer Arithmetic (1)
Computer ArchitectureFall 2007 © August 29, 2007 Karem Sakallah CS 447 – Computer Architecture.
3. Representing Integer Data
NEGATIVE BINARY NUMBER – Digital Circuit 1 Choopan Rattanapoka.
Computer Organization & Programming Chapter2 Number Representation and Logic Operations.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Computer Organization and Architecture Computer Arithmetic Chapter 9.
Computer Arithmetic Nizamettin AYDIN
Computer Arithmetic. Instruction Formats Layout of bits in an instruction Includes opcode Includes (implicit or explicit) operand(s) Usually more than.
Computer Architecture Lecture 3: Logical circuits, computer arithmetics Piotr Bilski.
Representing Integer Data Book : Chapter ( Subject has no point !! ) A99ACF.
Computer Arithmetic.
CH09 Computer Arithmetic  CPU combines of ALU and Control Unit, this chapter discusses ALU The Arithmetic and Logic Unit (ALU) Number Systems Integer.
Oct. 18, 2007SYSC 2001* - Fall SYSC2001-Ch9.ppt1 See Stallings Chapter 9 Computer Arithmetic.
Information Representation. Digital Hardware Systems Digital Systems Digital vs. Analog Waveforms Analog: values vary over a broad range continuously.
CSE 241 Computer Organization Lecture # 9 Ch. 4 Computer Arithmetic Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering.
9.4 FLOATING-POINT REPRESENTATION
Calculating Two’s Complement. The two's complement of a binary number is defined as the value obtained by subtracting the number from a large power of.
The Teacher CP4 Binary and all that… CP4 Revision.
Cosc 2150: Computer Organization Chapter 2 Part 1 Integers addition and subtraction.
ECEN 248 Lab 4: Multiplexer Based Arithmetic Logic Unit
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.
The Teacher CP4 Binary and all that… CP4 Revision.
ECE 456 Computer Architecture
Computer Arithmetic See Stallings Chapter 9 Sep 10, 2009
07/12/ Data Representation Two’s Complement & Binary Arithmetic.
Digital Representations ME 4611 Binary Representation Only two states (0 and 1) Easy to implement electronically %0= (0) 10 %1= (1) 10 %10= (2) 10 %11=
CEC 220 Digital Circuit Design Binary Arithmetic & Negative Numbers Monday, January 13 CEC 220 Digital Circuit Design Slide 1 of 14.
CEC 220 Digital Circuit Design Binary Arithmetic & Negative Numbers Fri, Aug 28 CEC 220 Digital Circuit Design Slide 1 of 14.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CE-321: Computer.
MicroProcessors Lec. 4 Dr. Tamer Samy Gaafar. Course Web Page —
09/03/20161 Information Representation Two’s Complement & Binary Arithmetic.
Computer Arithmetic. Arithmetic & Logic Unit zDoes the calculations zEverything else in the computer is there to service this unit zHandles integers zMay.
1  For recitations  Amr Mahmoud  Office Hours: Monday Benedum Hall.
1 Integer Representations V1.0 (22/10/2005). 2 Integer Representations  Unsigned integer  Signed integer  Sign and magnitude  Complements  One’s.
Chapter 9 Computer Arithmetic
William Stallings Computer Organization and Architecture 8th Edition
Cosc 2150: Computer Organization
CHAPTER 9 COMPUTER ARITHMETIC - ALU
William Stallings Computer Organization and Architecture 7th Edition
Computer Organization and ASSEMBLY LANGUAGE
ECEG-3202 Computer Architecture and Organization
Computer Architecture
C1 Number systems.
Chapter 8 Computer Arithmetic
Presentation transcript:

Arithmetic & Logic Unit Does the calculations Everything else in the computer is there to service this unit Handles integers May handle floating point (real) numbers May be separate FPU (maths co-processor) May be on chip separate FPU (486DX +)

ALU Inputs and Outputs

Integer Representation Only have 0 & 1 to represent everything Positive numbers stored in binary —e.g. 41= No minus sign No period Sign-Magnitude Two’s compliment

Sign-Magnitude Left most bit is sign bit 0 means positive 1 means negative +18 = = Problems —Need to consider both sign and magnitude in arithmetic —Two representations of zero (+0 and -0)

Two’s Compliment +3 = = = = = = =

Benefits One representation of zero Arithmetic works easily (see later) Negating is fairly easy —3 = —Boolean complement gives —Add 1 to LSB

Geometric Depiction of Twos Complement Integers

Negation Special Case 1 0 = Bitwise not Add 1 to LSB +1 Result Overflow is ignored, so: - 0 = 0 

Negation Special Case = bitwise not Add 1 to LSB +1 Result So: -(-128) = -128 X Monitor MSB (sign bit) It should change during negation

Range of Numbers 8 bit 2s compliment —+127 = = — -128 = = bit 2s compliment — = = — = = -2 15