Index Generation Functions: Logic Synthesis for Pattern Matching Tsutomu Sasao Meiji University, Kanagawa, Japan 2015/12/10 2015/12/10 Sasao EPFL2015 1 1 1
��������������������������������� ������������������������������������� . 0110000100010000101001100001000100001010 0101111101101010001101011111011010100011 1111010101110111000011110101011101110001 0001111000010001011100011110000100010111 0011110000000100010100111100000001000101 0111001001000100100101110010010001001001 0010001110001111001000100011100011110010 1111111111010001111000100011100011110010 1110111000110001011011101110001100010110 1010000110100100001110100001101001000011 2015/12/10 2015/12/10 Sasao EPFL2015 2 2
Circuit y1 x1 x2 y2 y3 y4 x40 2015/12/10 2015/12/10 Sasao EPFL2015 3 3
Methods 1. Use a look up table. 2. Convert the table into Verilog code and use logic synthesis tool to generate an FPGA. 3. Use Xilinx CAM IP core. 4. Use a new method. 2015/12/10 2015/12/10 Sasao EPFL2015 4 4
New Method 1. To distinguish 10 vectors, 5 bits are sufficient, in most cases. 2. Find 5 bits to distinguish 10 vectors. 3. Given an input vector, check if there exist a vector that matches the 5 bits. 4. If such a vector exists, check if other bits of the vector are equal to the input. 2015/12/10 2015/12/10 Sasao EPFL2015 5 5
We have 10 vectors of 40 bits. Design a circuit for pattern matching . 0110000100010000101001100001000100001010 0101111101101010001101011111011010100011 1111010101110111000011110101011101110001 0001111000010001011100011110000100010111 0011110000000100010100111100000001000101 0111001001000100100101110010010001001001 0010001110001111001000100011100011110010 1111111111010001111000100011100011110010 1110111000110001011011101110001100010110 1010000110100100001110100001101001000011 2015/12/10 2015/12/10 Sasao EPFL2015 6 6
Index Generation Unit (IGU) Index Generation Unit (IGU) � � X 1 5 � Linear Main AND Circuit Memory AUX X 2 Memory 35 35 X 2 Comparator 35 2015/12/10 2015/12/10 Sasao EPFL2015 7 7 7
Incompletely Specified Index Incompletely Specified Index Generation Function Generation Function f : D { 1 , 2 ,..., k }, → n where D B , B { 0 , 1 } . ⊆ = 2015/12/10 2015/12/10 Sasao EPFL2015 8 8 8
Number of Variables to Represent Number of Variables to Represent Incompletely Specified Index Incompletely Specified Index Generation Functions Generation Functions 2015/12/10 2015/12/10 Sasao EPFL2015 9 9 9
Index Generation Function x1 x2 x3 x4 x5 x6 x7 index 1 � � � � � � � � � � 2 � � � � � � � � ��� 3 � � � � � � � 4 � � � � � � � ���������� 5 � � � � � � � ��������������� 6 � � � � � � � ��� 7 � � � � � � � ������������� 8 � � � � � � � ������� 9 � � � � � � � 10 � � � � � � � 2015/12/10 2015/12/10 Sasao EPFL2015 10 10
7- -Segment to BCD Converter Segment to BCD Converter 7 7segments BCD a a b c d e f g f b g 1 � � � � � � � e c 2 � � � � � � � 3 � � � � � � � d 4 � � � � � � � ����������������� 5 � � � � � � � ���������������� 6 � � � � � � � ������������� 7 � � � � � � � ������� � 8 � � � � � � � 9 � � � � � � � 10 � � � � � � � 2015/12/10 2015/12/10 Sasao EPFL2015 11 11 11
Q: Which Segments are Necessary? a f b g c e d 2015/12/10 2015/12/10 Sasao EPFL2015 12 12 12
Five Segments are Necessary � {a, a,b b,e, ,e,f f,g ,g} } { 2015/12/10 2015/12/10 Sasao EPFL2015 13 13 13
How many variables, on the average, How many variables, on the average, are necessary to represent are necessary to represent incompletely specified index incompletely specified index generation functions with 7 variables generation functions with 7 variables and weight 10? and weight 10? 2015/12/10 2015/12/10 Sasao EPFL2015 14 14 14
����������������������������������������������� ������������������������� ��� Number of Functions ��� ��� ��� ��� ��� � � � � ������������������� 978 functions 22 functions 22 functions 2015/12/10 2015/12/10 Sasao EPFL2015 15 15 15
Property Property To represent an incompletely specified index generation function with weight � � 3 k, variables are 2 log ( k 1 ) + − 2 sufficient , f or most cases, when k 7 . ≥ Example: When k =127. � � 2 log ( k 1 ) 3 2 7 3 11 + − = × − = 2 2015/12/10 2015/12/10 Sasao EPFL2015 16 16 16
If each column has at most one non- -zero zero If each column has at most one non element in a decomposition chart, then f f element in a decomposition chart, then can be represented with only the column can be represented with only the column x . variables . variables 1 3 1 x 4 4 2 x 3 x 2 2015/12/10 2015/12/10 Sasao EPFL2015 17 17 17
f 1 x x 4 x x 3 x x 2 x x = ⋅ ∨ ⋅ ∨ ⋅ ∨ ⋅ 2 1 2 1 2 1 2 1 x 1 1 4 3 2 1 4 3 2 x 4 1 4 3 2 x 3 4 3 2 1 x 2 2015/12/10 2015/12/10 Sasao EPFL2015 18 18 18
��������������������������������� ������������������������ x 1 2 1 4 x 4 x 3 3 x 2 2015/12/10 2015/12/10 Sasao EPFL2015 19 19
If the element 4 is moved right two squares , then f is represented by only x 1 and x 2 x 1 2 � x 4 4 4 x 3 3 x 2 2015/12/10 2015/12/10 Sasao EPFL2015 20 20
A linear transformation permutes elements. y 1 y x x = ⊕ 2 1 1 1 4 y x x = ⊕ 4 4 x 2 2 4 4 y x = 3 3 x 3 y x = 3 4 4 y 2 2015/12/10 2015/12/10 Sasao EPFL2015 21 21
In this case, each column has at most one non-zero element. y 1 y x x = ⊕ 1 1 1 4 2 y x x = ⊕ 4 x 2 2 4 4 y x = 3 3 x 3 y x = 3 4 4 y 2 2015/12/10 2015/12/10 Sasao EPFL2015 22 22
Linear Decomposition Linear Decomposition � � q log ( k 1 ) = + 2 p n q Linear General X Function Function Cost: np Cost: q2 p 2015/12/10 2015/12/10 Sasao EPFL2015 23 23 23
Compound Variables Compound Variables ‣ General form: y a x a x a n x � = ⊕ ⊕ ⊕ 1 1 2 2 n a { 0 , 1 } ∈ i ‣ Compound degree: The number of coefficients with a i =1 . ‣ A variable with the compound degree 1 is primitive . 2015/12/10 2015/12/10 Sasao EPFL2015 24 24 24
Linear Circuits Linear Circuits n MUX n + y = x MUX y x x = ⊕ MUX 1 i 1 1 i 1 j 1 n n n MUX y = x + y x x MUX = ⊕ p ip p ip jp MUX n Compound degree 1 Compound degree 2 2015/12/10 2015/12/10 Sasao EPFL2015 25 25 25
1- -out out- -of of- -7 code to Index Converter 7 code to Index Converter 1 1-out-of-7 code Index x 7 x 6 x 5 x 4 x 3 x 2 x 1 ����������� ����������� 0 0 0 0 0 0 1 1 �������������� �������������� 2 0 0 0 0 0 1 0 ���������� ���������� ������������� ������������� 0 0 0 0 1 0 0 3 ���� ���� 0 0 0 1 0 0 0 4 ��������� ��������� 0 0 1 0 0 0 0 5 0 1 0 0 0 0 0 6 7 1 0 0 0 0 0 0 2015/12/10 2015/12/10 Sasao EPFL2015 26 26 26
Distribution is Skewed Distribution is Skewed 1-out-of-7 code Index ‣ For each x i , there is x 7 x 6 x 5 x 4 x 3 x 2 x 1 single 1, and 6 0‚s. 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 2 0 0 0 0 1 0 0 3 0 0 0 1 0 0 0 4 5 0 0 1 0 0 0 0 0 1 0 0 0 0 0 6 1 0 0 0 0 0 0 7 2015/12/10 2015/12/10 Sasao EPFL2015 27 27 27
Only Three Variables are Only Three Variables are Necessary. Necessary. y x x x x = ⊕ ⊕ ⊕ 1 1 3 5 7 y x x x x = ⊕ ⊕ ⊕ 2 2 3 6 7 y x x x x = ⊕ ⊕ ⊕ 3 4 5 6 7 2015/12/10 2015/12/10 Sasao EPFL2015 28 28 28
Recommend
More recommend