Tutorial 4

Tutorial 4 - IERG4020 Tutorial 4 FENG Shen 1 BASIC CONCEPTS...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
IERG4020 Tutorial 4 FENG Shen 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
BASIC CONCEPTS OF COMPARISON NETWORKS 2
Background image of page 2
Quick review Banyan network is not internally non-blocking in general. Banyan network is internally non-blocking if the inputs are concentrated and have distinct and monotonic outputs . We need sorting networks to ensure these conditions. 000 001 010 011 100 101 110 111 001 010 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 x 2 comparators A comparison network is constructed of 2 x 2 comparators. The representation of a 2 x 2 comparator: 4
Background image of page 4
Order preserving property Order preserving property describes that, if a comparison network maps an input sequence into an output sequence , then for any monotonically increasing function f , the network also maps input sequence into output sequence . N a a a a ,..., , 2 1 = N b b b b ,..., , 2 1 = ) ( ),. .., ( ), ( ) ( 2 1 N a f a f a f a f = ) ( ),. .., ( ), ( ) ( 2 1 N b f b f b f b f = 5
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Order preserving property It is easy to prove order preserving property for 2 x 2 comparators. By induction, we can prove it for a general comparison network. f ( x ) = x - 1 Monotonically increasing 6
Background image of page 6
Zero-one principle Zero-one principle : If a sorting network with N inputs sorts all the 2 N possible sequences of 0’s and 1’s correctly, then it sorts all sequences of arbitrary input numbers correctly. Proof : Consider a network that sorts input sequence of 0’s and 1’s correctly. Assume there is an input sequence < a 1 , a 2 , …, a n > containing two elements a i and a j such that a i < a j , but the network places a j before a i . Define a monotonically increasing function > = i i a x a x x f if 1 if 0 ) ( 0 1 a i x a j 7
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
(cont.) According to the order-preserving property, since the network places a j before a i when the input sequence is < a 1 , a 2 , …, a n >, it places f ( a j ) = 1 before f ( a i ) = 0 when the input sequence is < f ( a 1 ), f ( a 2 ), …, f ( a n )>. But this is a sequence consists of only 0’s and 1’s, and yet the network does not sort it correctly, leading to a contradiction. Sorting Network . . . . . . . < a 1 , a 2 , …, a n > By contradiction, assume a i < a j , but a j placed before a i a j a i Sorting Network .
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/08/2010 for the course IEG IEG4020 taught by Professor Fengshen during the Spring '10 term at CUHK.

Page1 / 24

Tutorial 4 - IERG4020 Tutorial 4 FENG Shen 1 BASIC CONCEPTS...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online