Download presentation
Presentation is loading. Please wait.
Published byHilda Thornton Modified over 9 years ago
1
Computer Arithmetic
2
Arithmetic & Logic Unit zDoes the calculations zEverything else in the computer is there to service this unit zHandles integers zMay handle floating point (real) numbers zMay be separate FP (maths co-processor)
3
ALU Inputs and Outputs
4
Integer Representation zOnly have 0 & 1 to represent everything zPositive numbers stored in binary ye.g. 41=00101001 zNo minus sign zNo period zSign-Magnitude zTwo’s compliment
5
Sign-Magnitude zLeft most bit is sign bit z0 means positive z1 means negative z+18 = 00010010 z -18 = 10010010 zProblems yNeed to consider both sign and magnitude in arithmetic yTwo representations of zero (+0 and -0)
6
Addition and Subtraction zNormal binary addition zMonitor sign bit for overflow zTake twos compliment of substahend and add to minuend yi.e. a - b = a + (-b) zSo we only need addition and complement circuits
7
Hardware for Addition and Subtraction
8
Multiplication zComplex zWork out partial product for each digit zTake care with place value (column) zAdd partial products
9
Division zMore complex than multiplication zNegative numbers are really bad! zBased on long division
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.