Regular expressions to fsms - PowerPoint PPT Presentation

About This Presentation
Title:

Regular expressions to fsms

Description:

Title: Regular expressions to fsms Author: Paul Cockshot Last modified by: Department of Computing Science Created Date: 10/6/2003 9:04:51 PM Document presentation format – PowerPoint PPT presentation

Number of Views:95
Avg rating:3.0/5.0
Slides: 16
Provided by: PaulC212
Category:

less

Transcript and Presenter's Notes

Title: Regular expressions to fsms


1
Regular expressions to fsms
  • \hardware and software techniques
  • Paul Cockshott

2
Extended regular grammars
  • Sequence abe
  • Alternation abE
  • Charset a-z
  • Zero or more x
  • One or more x

3
Reduced forms
  • Sequence abe
  • Alternation abE
  • Charset a-z
  • Zero or more x
  • One or more x
  • Sequence
  • Alternation
  • -gt abcd.
  • xe
  • x

- e is the null character
4
Map to state machines
  • Sequence abc

3
a
1
c
2
b
5
Map alternation
Axp
A
p
x
6
Map Ab
A
A
b
7
FSM Implementations
PLA Hardware
State table in RAM Hardware Software
State table with class table Software Software
8
Hardware and software FSMs
  • Hardware
  • Interpreting machine code in a cpu
  • Interpreting network addresses in a router chip
  • Software
  • Compilers
  • Software routers
  • Protocol analysers

9
PLA with latch
Input char
State latch
Next state
Action code
clock
Product lines
Or plane
And plane
10
AND plane
a a b b
a AND b
b
true and complement lines
11
Or plane
P or q
p
p
q
12
Advantage of PLA
  • Very fast uses the minimum logic
  • Lends itself to logic minimisation
  • Efficient layout on silicon
  • Method of choice for parsing simple regular
    grammars at gt cpu speeds in instruction decode
    units

13
RAM based FSM
Source data
8 bits
1
6bits
8 bits
14
Add char class map
instruction
Fsm table

State sel
State line
Last char index
Char col
First char index reg
Current char
hit
Char class map
15
Advantages of char class map
  • Reduces the size of the FSM table.
  • If we have n states we would otherwise require
    256n locations in table. With char class map we
    require c x n where c is the number of distinct
    character classes in the grammar.
Write a Comment
User Comments (0)
About PowerShow.com