Professional Documents
Culture Documents
Bruh
Bruh
Bruh
ECE 120: Introduction to Computing © 2016-2017 Steven S. Lumetta. All rights reserved. slide 1 ECE 120: Introduction to Computing © 2016 Steven S. Lumetta. All rights reserved. slide 2
The Answers are Not Always Enough What Extra Information Do We Need?
So our design will answer the following: Why not just one? An answer only needs 1 bit!
Is A = aN-1aN-2…a1a0 a power of two? Say that we pass bits from right to left.
How many answers are possible? If the bits aN-2…a1a0 represent a power of two,
Two: Yes, and No. is aN-1aN-2…a1a0 be a power of two?
What if aN-2…a1a0 does not Iff aN-1 = 0.
A trick question: represent a power of two?
How many bits do we need to pass In that case, we can’t tell whether
between slices? aN-1aN-2…a1a0 is a power of two or not!
That’s right: TWO bits. What else do we need to know?
ECE 120: Introduction to Computing © 2016 Steven S. Lumetta. All rights reserved. slide 3 ECE 120: Introduction to Computing © 2016-2017 Steven S. Lumetta. All rights reserved. slide 4
1
9/24/2018
For Inductive Step, We Must Know Whether all Bits are 0 There are Three Possible Messages between Bit Slices
Imagine that we have completed N-1 bits. The “yes” cases for #1 and #2 do not overlap:
all 0 bits is not a power of two.
Under what conditions can number A be a
power of two? The “no” cases need not be further separated:
1. aN-1 = 1 and the rest is all 0s, or ◦ all 0s means no 1 bits
2. aN-1 = 0 and the rest is a power of two. ◦ a power of two means one 1 bit
For #2, we need to know whether the rest ◦ more than one 1 bit means
of the bits form a power of two. “no” to both questions
But for #1, we also need to know whether That’s all we need to know. Three possible
the rest of the bits are all 0. messages between slices, so two bits.
ECE 120: Introduction to Computing © 2016 Steven S. Lumetta. All rights reserved. slide 5 ECE 120: Introduction to Computing © 2016 Steven S. Lumetta. All rights reserved. slide 6
ECE 120: Introduction to Computing © 2016 Steven S. Lumetta. All rights reserved. slide 7 ECE 120: Introduction to Computing © 2016 Steven S. Lumetta. All rights reserved. slide 8
2
9/24/2018
Two Zeroes Do Not Change the Result One 1 Input Increments the Count of 1 Bits
ECE 120: Introduction to Computing © 2016 Steven S. Lumetta. All rights reserved. slide 9 ECE 120: Introduction to Computing © 2016 Steven S. Lumetta. All rights reserved. slide 10
One 1 Input Increments the Count of 1 Bits Two 1s in the Number Rules Out Powers of Two
ECE 120: Introduction to Computing © 2016 Steven S. Lumetta. All rights reserved. slide 11 ECE 120: Introduction to Computing © 2016 Steven S. Lumetta. All rights reserved. slide 12
3
9/24/2018
ECE 120: Introduction to Computing © 2016 Steven S. Lumetta. All rights reserved. slide 13 ECE 120: Introduction to Computing © 2016 Steven S. Lumetta. All rights reserved. slide 14
We Can Reuse Some Factors with Algebra Area is 6N, and Delay is N Gate Delays for N Bits
ECE 120: Introduction to Computing © 2016 Steven S. Lumetta. All rights reserved. slide 15 ECE 120: Introduction to Computing © 2016 Steven S. Lumetta. All rights reserved. slide 16
4
9/24/2018
ECE 120: Introduction to Computing © 2016 Steven S. Lumetta. All rights reserved. slide 17