Download presentation
Presentation is loading. Please wait.
Published byJack Underwood Modified over 9 years ago
1
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Arithmetic Circuits II Anselmo Lastra
2
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 2 Overflow Two cases of overflow for addition of signed numbers ♦ Two large positive numbers overflow into sign bit Not enough room for result ♦ Two large negative numbers added Same – not enough bits Carry out can be OK
3
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 3 Examples 4-bit signed numbers 7 + 7 7 – 7 ♦ Generates carry but result OK -7 4 + 4 ♦ Generates no C out, but overflowed
4
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 4 Overflow Detection Condition is that either C n-1 or C n is high, but not both
5
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 5 Multiplier Multiply by doing single-bit multiplies and shifts Look at combinational circuit to do this
6
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 6 Combinational Multiplier AND computes A 0 B 0 Half adder computes sum. Will need FA for larger multiplier.
7
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 7 Larger Multiplier
8
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 8 Sequential Multiply Imagine doing over time rather than in parallel ♦ Bitwise multiply ♦ Shift ♦ Add If we have time later in semester we’ll look at fancier multipliers
9
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 9 Contraction Can implement other functions ♦ Like increment, decrement By using basic arithmetic circuits ♦ Adder And removing unused portions This is called contraction
10
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 10 Example: Incrementing Very common ♦ Next address computation Specialize an adder
11
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 11 Eliminate Unneeded Gates
12
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 12 Multiplication by Constant What if constant is a power of two? What is the circuit?
13
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 13 Multiplication by Pwr of 2 Just wires Division by pwr of 2 similar
14
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 14 Arbitrary Constant
15
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 15 Contraction Not Always Best Sometimes it pays to rethink the function Example of decrementer in book
16
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 16 Sign Extension Changing size of number common in instruction sets ♦ 16-bit immediate to register, for example Can’t just add zeros (zero fill) ♦ Would turn 4-bit -5 (1011) to 8-bit +11 (00001011) Sign extend (fill with left digit) ♦ 1011 to 11111011
17
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 17 We’ve Covered Adders ♦ Ripple carry ♦ Carry lookahead Subtracting unsigned numbers ♦ New design for adder-subtractor Signed numbers ♦ Signed addition/subtraction Multiplication – just basic Modified Circuits
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.