This preview shows page 1. Sign up to view the full content.
Unformatted text preview: 23
25
26
31 Figure 17.2 An 8bit binary counter as its value goes from 0 to 16 by a sequence of 16 I NCREMENT
operations. Bits that ﬂip
of bits flipped. to achieve the next value are shaded. The running cost for ﬂipping bits is
shown at the right. Notice that the total cost is always less than twice the total number of I NCREMENT
operations.
12
operations on an initially zero counter causes AŒ1 to ﬂip bn=2c times. Similarly,
bit AŒ2 ﬂips only every fourth time, or bn=4c times in a sequence of n I NCREMENT i Binary counter
Goal. Increment a kbit binary counter (mod 2k). Counter
value A[
7
A[ ]
6]
A[
5
A[ ]
4
A[ ]
3
A[ ]
2]
A[
1
A[ ]
0] Representation. aj = jth l17.1 Aggregate analysis bit of counter.
east significant 0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1 0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
0 0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0 0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0 0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0 455 Total
cost
0
1
3
4
7
8
10
11
15
16
18
1...
View
Full
Document
This document was uploaded on 02/05/2014.
 Spring '14

Click to edit the document details