Sorting in the Bit Model, Example Problems
Tom Kelliher, CS 315
Feb. 1, 1999
Read Section 1.1.3.
Algorithm assessment, simulating larger machines, example problems
- Sorting in the bit model.
- Example problems.
Why get more detailed? To see how much work (e.g., #number of
transistors) is involved in, for instance, comparison.
A linear array bit-level model of a compare cell:
Assume we have k-bit numbers. Run time?
Can we do better? Yes. We can do comparisons in parallel and merge the
- Why not use a height 1 tree?
- Fan-in and fan-out in circuits.
- Run-time for sorting on a linear array of linear array comparators.
Binary tree comparators.
What do they look like?
- Pipelining the linear comparators. Pipelining the compare:
Five in, four out.
A lot of parallel work. Systolic computation.
- Pipelining the sort. Just a linear array of the comparators:
Consider two algorithms for solving a a problem of size M, one that runs
in M steps on an M-processor machine and one that runs in
steps on an -processor machine. Which algorithm is more
Assume that the cost of running a P-processor machine for T steps is
, where and are constants and P = M or
. For what values of and is the first algorithm
cheaper to run? For what values of and is the second
algorithm cheaper to run?
Consider two algorithms for solving a problem of size M, one that runs in
M steps on an M-processor machine and one that runs in steps
on an -processor machine. Which algorithm will run faster on an
N-processor machine? (Hint: Your answer depends on the relative sizes of
M and N, and you will need to use the fact that an N-processor
machine can simulate a P-processor machine with slowdown .)
Thomas P. Kelliher
Mon Feb 1 10:06:51 EST 1999