arithmetic circuits ii

Click here to load reader

Post on 25-Feb-2016

43 views

Category:

Documents

4 download

Embed Size (px)

DESCRIPTION

Arithmetic Circuits II. Anselmo Lastra. 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. Examples. 4-bit signed numbers - PowerPoint PPT Presentation

TRANSCRIPT

Slide 1Arithmetic Circuits II
Overflow
Two large positive numbers overflow into sign bit
Not enough room for result
Two large negative numbers added
Same – not enough bits
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Examples
-7 -7
4 + 4
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Overflow Detection
Condition is that either Cn-1 or Cn is high, but not both
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Multiplier
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Combinational Multiplier
Half adder computes sum. Will need FA for larger multiplier.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Larger Multiplier
Sequential Multiply
Bitwise multiply
Shift
Add
If we have time later in semester we’ll look at fancier multipliers
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Contraction
Adder
Example: Incrementing
Very common
Eliminate Unneeded Gates
Multiplication by Constant
What is the circuit?
Multiplication by Pwr of 2
Just wires
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Arbitrary Constant
Contraction Not Always Best
Example of decrementer in book
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Sign Extension
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
We’ve Covered