Optimizing Digital Systems Implemented in FPGA Through Effective Description of Finite State Machines
Abstract
1. Introduction
- The algorithms for creating code in Verilog and encoding states to optimize the area and performance of FSMs.
- Three styles of describing FSMs in Verilog: when the default value of the next state (dstate) is assigned, when the default value of the output vector (dout) is assigned, and when the default values of both the next state and the output vector (dstate_out) are assigned simultaneously.
- Evaluations of the effectiveness of the proposed styles of describing FSMs, determined based on the parameters of FSMs.
- Research in Quartus and Vivado design tools on the efficiency of the considered styles of FSM description using FSM benchmarks when encoding states with one-hot and binary codes.
- Recommendations for the practical use of the proposed styles of describing FSMs.
2. Related Works
3. Styles of Describing FSMs for Optimizing Area and Performance
3.1. Traditional Description of FSMs
| Listing 1. A traditional description of the FSM from our example. |
| module Mealy_3proc ( // declaration of ports input clk, reset, // clock and reset signals input [2:0] x, // input vector output reg [2:0] y); // output vector reg [2:0] state, next; // state variables localparam [2:0] s0 = 0, s1 = 1, s2 = 2, s3 = 3, s4 = 4; // states always @(posedge clk, negedge reset) // state register if (~reset) state <= s0; else state <= next; always @(*) // description of transition functions case (state) s0: casex (x) 3′b??0: next = s1; 3′b??1: next = s3; endcase s1: casex (x) 3′b?0?: next = s2; 3′b?1?: next = s3; endcase s2: casex (x) 3′b0??: next = s4; 3′b1??: next = s3; endcase s3: casex (x) 3′b000: next = s3; 3′b111: next = s0; endcase s4: casex (x) 3′b?00: next = s3; 3′b?11: next = s0; endcase endcase always @(*) // description of output functions case (state) s0: casex (x) 3′b??0: y = 3′b001; 3′b??1: y = 3′b111; endcase s1: casex (x) 3′b?0?: y = 3′b010; 3′b?1?: y = 3′b111; endcase s2: casex (x) 3′b0??: y = 3′b011; 3′b1??: y = 3′b111; endcase s3: casex (x) 3′b000: y = 3′b111; 3′b111: y = 3′b101; endcase s4: casex (x) 3′b?00: y = 3′b111; 3′b?11: y = 3′b100; endcase endcase endmodule |
3.2. Creating Code in Verilog to Optimize an FSM Circuit
- Reducing the number of transitions in the FSM description leads to a decrease in the area and an increase in the performance of the synthesized FSM circuit;
- Specifying default values for the variables next and y reduces the number of transitions in the FSM description.
| Algorithm 1. Creating FSM code in Verilog to optimize the synthesized circuit |
|
| Algorithm 2. Encoding states to optimize FSM parameters |
|
| while (|S|!= 0) do |
|
| end while. |
| Listing 2. Description of the FSM for parameter optimization. |
| module Mealy_3proc ( // declaration of ports input clk, reset, // clock and reset signals input [2:0] x, // input vector output reg [2:0] y); // output vector reg [2:0] state, next; // state variables localparam [2:0] s0 = 3′b000, // state codes s1 = 3′b010, s2 = 3′b100, s3 = 3′b001, s4 = 3′b011; always @(posedge clk, negedge reset) // state register if (~reset) state <= s0; else state <= next; always @(*) // description of transition functions begin next = s3; // default value for the next variable case (state) s0: casex (x) 3′b??0: next = s1; endcase s1: casex (x) 3′b?0?: next = s2; endcase s2: casex (x) 3′b0??: next = s4; endcase s3: casex (x) 3′b111: next = s0; endcase s4: casex (x) 3′b?11: next = s0; endcase endcase end always @(*) // description of output functions begin y = 3′b111; // default value for the y variable case (state) s0: casex (x) 3′b??0: y = 3′b001; endcase s1: casex (x) 3′b?0?: y = 3′b010; endcase s2: casex (x) 3′b0??: y = 3′b011; endcase s3: casex (x) 3′b111: y = 3′b101; endcase s4: casex (x) 3′b?11: y = 3′b100; endcase endcase end endmodule |
4. Experimental Results
4.1. FSM Parameters and Efficiency Estimates of the Proposed Description Styles
4.2. Area of FSMs
| FSM | A3 | As | Ao | Aso | Amin | A3/As | A3/Ao | A3/Aso |
|---|---|---|---|---|---|---|---|---|
| bbsse | 42 | 27 | 40 | 27 | 27 | 1.556 | 1.050 | 1.556 |
| beecount | 42 | 25 | 36 | 18 | 18 | 1.680 | 1.167 | 2.333 |
| cse | 111 | 84 | 103 | 72 | 72 | 1.321 | 1.078 | 1.542 |
| dk14 | 44 | 44 | 44 | 44 | 44 | 1.000 | 1.000 | 1.000 |
| dk16 | 65 | 35 | 65 | 35 | 35 | 1.857 | 1.000 | 1.857 |
| dk512 | 21 | 11 | 21 | 11 | 11 | 1.909 | 1.000 | 1.909 |
| ex1 | 135 | 82 | 125 | 60 | 60 | 1.646 | 1.080 | 2.250 |
| ex2 | 78 | 39 | 76 | 30 | 30 | 2.000 | 1.026 | 2.600 |
| ex3 | 42 | 26 | 42 | 20 | 20 | 1.615 | 1.000 | 2.100 |
| ex4 | 57 | 15 | 47 | 11 | 11 | 3.800 | 1.213 | 5.182 |
| ex5 | 36 | 22 | 36 | 25 | 22 | 1.636 | 1.000 | 1.440 |
| ex6 | 63 | 58 | 61 | 48 | 48 | 1.086 | 1.033 | 1.313 |
| ex7 | 41 | 26 | 40 | 25 | 25 | 1.577 | 1.025 | 1.640 |
| lion | 17 | 11 | 15 | 9 | 9 | 1.545 | 1.133 | 1.889 |
| lion9 | 57 | 27 | 56 | 21 | 21 | 2.111 | 1.018 | 2.714 |
| planet | 121 | 87 | 125 | 90 | 87 | 1.391 | 0.968 | 1.344 |
| planet1 | 121 | 87 | 125 | 90 | 87 | 1.391 | 0.968 | 1.344 |
| pma | 147 | 101 | 145 | 89 | 89 | 1.455 | 1.014 | 1.652 |
| s1 | 118 | 63 | 118 | 63 | 63 | 1.873 | 1.000 | 1.873 |
| s27 | 23 | 23 | 23 | 23 | 23 | 1.000 | 1.000 | 1.000 |
| s208 | 49 | 55 | 32 | 32 | 32 | 0.891 | 1.531 | 1.531 |
| s1488 | 157 | 166 | 168 | 167 | 157 | 0.946 | 0.935 | 0.940 |
| sand | 238 | 152 | 239 | 134 | 134 | 1.566 | 0.996 | 1.776 |
| sse | 70 | 46 | 62 | 37 | 37 | 1.522 | 1.129 | 1.892 |
| styr | 212 | 100 | 197 | 105 | 100 | 2.120 | 1.076 | 2.019 |
| tbk | 295 | 151 | 292 | 112 | 112 | 1.954 | 1.010 | 2.634 |
| tma | 157 | 69 | 161 | 75 | 69 | 2.275 | 0.975 | 2.093 |
| train4 | 19 | 11 | 17 | 8 | 8 | 1.727 | 1.118 | 2.375 |
| train11 | 48 | 28 | 46 | 22 | 22 | 1.714 | 1.043 | 2.182 |
| Av | 1.661 | 1.055 | 1.930 | |||||
| Max | 3.800 | 1.531 | 5.182 | |||||
| Best | 3 | 11 | 3 | 23 | ||||
| Unique | 1 | 5 | 0 | 16 |
| FSM | A3 | As | Ao | Aso | Amin | A3/As | A3/Ao | A3/Aso |
|---|---|---|---|---|---|---|---|---|
| bbsse | 60 | 30 | 63 | 32 | 30 | 2.000 | 0.952 | 1.875 |
| beecount | 32 | 19 | 28 | 15 | 15 | 1.684 | 1.143 | 2.133 |
| cse | 103 | 108 | 97 | 97 | 97 | 0.954 | 1.062 | 1.062 |
| dk14 | 43 | 43 | 43 | 43 | 43 | 1.000 | 1.000 | 1.000 |
| dk16 | 85 | 51 | 85 | 51 | 51 | 1.667 | 1.000 | 1.667 |
| dk512 | 16 | 13 | 16 | 13 | 13 | 1.231 | 1.000 | 1.231 |
| ex1 | 147 | 118 | 133 | 92 | 92 | 1.246 | 1.105 | 1.598 |
| ex2 | 92 | 40 | 91 | 39 | 39 | 2.300 | 1.011 | 2.359 |
| ex3 | 44 | 26 | 47 | 25 | 25 | 1.692 | 0.936 | 1.760 |
| ex4 | 62 | 16 | 57 | 10 | 10 | 3.875 | 1.088 | 6.200 |
| ex5 | 34 | 22 | 37 | 23 | 22 | 1.545 | 0.919 | 1.478 |
| ex6 | 71 | 67 | 66 | 51 | 51 | 1.060 | 1.076 | 1.392 |
| ex7 | 45 | 21 | 45 | 18 | 18 | 2.143 | 1.000 | 2.500 |
| lion | 11 | 7 | 10 | 5 | 5 | 1.571 | 1.100 | 2.200 |
| lion9 | 57 | 16 | 57 | 14 | 14 | 3.563 | 1.000 | 4.071 |
| planet | 224 | 90 | 232 | 91 | 90 | 2.489 | 0.966 | 2.462 |
| planet1 | 224 | 90 | 232 | 91 | 90 | 2.489 | 0.966 | 2.462 |
| pma | 162 | 272 | 164 | 269 | 162 | 0.596 | 0.988 | 0.602 |
| s1 | 168 | 91 | 168 | 91 | 91 | 1.846 | 1.000 | 1.846 |
| s27 | 10 | 10 | 10 | 10 | 10 | 1.000 | 1.000 | 1.000 |
| s208 | 14 | 14 | 14 | 14 | 14 | 1.000 | 1.000 | 1.000 |
| s1488 | 223 | 223 | 230 | 167 | 167 | 1.000 | 0.970 | 1.335 |
| sand | 257 | 180 | 258 | 164 | 164 | 1.428 | 0.996 | 1.567 |
| sse | 77 | 40 | 69 | 30 | 30 | 1.925 | 1.116 | 2.567 |
| styr | 229 | 108 | 213 | 108 | 108 | 2.120 | 1.075 | 2.120 |
| tbk | 303 | 197 | 302 | 199 | 197 | 1.538 | 1.003 | 1.523 |
| tma | 172 | 111 | 182 | 112 | 111 | 1.550 | 0.945 | 1.536 |
| train4 | 13 | 7 | 11 | 5 | 5 | 1.857 | 1.182 | 2.600 |
| train11 | 52 | 28 | 49 | 24 | 24 | 1.857 | 1.061 | 2.167 |
| Av | 1.732 | 1.023 | 1.976 | |||||
| Max | 3.875 | 1.182 | 6.200 | |||||
| Best | 4 | 13 | 4 | 22 | ||||
| Unique | 1 | 6 | 0 | 14 |
4.3. Performance of FSMs
| FSM | F3 | Fs | Fo | Fso | Fmax | Fs/F3 | Fo/F3 | Fso/F3 |
|---|---|---|---|---|---|---|---|---|
| bbsse | 476 | 609 | 550 | 650 | 650 | 1.279 | 1.155 | 1.366 |
| beecount | 200 | 522 | 165 | 623 | 623 | 2.610 | 0.825 | 3.115 |
| cse | 144 | 512 | 161 | 505 | 512 | 3.556 | 1.118 | 3.507 |
| dk14 | 511 | 511 | 511 | 511 | 511 | 1.000 | 1.000 | 1.000 |
| dk16 | 527 | 648 | 527 | 648 | 648 | 1.230 | 1.000 | 1.230 |
| dk512 | 734 | 812 | 734 | 812 | 812 | 1.106 | 1.000 | 1.106 |
| ex1 | 305 | 521 | 222 | 511 | 521 | 1.708 | 0.728 | 1.675 |
| ex2 | 467 | 623 | 467 | 728 | 728 | 1.334 | 1.000 | 1.559 |
| ex3 | 476 | 546 | 476 | 657 | 657 | 1.147 | 1.000 | 1.380 |
| ex4 | 604 | 1300 | 615 | 1300 | 1300 | 2.152 | 1.018 | 2.152 |
| ex5 | 500 | 689 | 500 | 656 | 689 | 1.378 | 1.000 | 1.312 |
| ex6 | 218 | 502 | 196 | 559 | 559 | 2.303 | 0.899 | 2.564 |
| ex7 | 475 | 523 | 475 | 667 | 667 | 1.101 | 1.000 | 1.404 |
| lion | 489 | 733 | 485 | 734 | 734 | 1.499 | 0.992 | 1.501 |
| lion9 | 180 | 552 | 149 | 567 | 567 | 3.067 | 0.828 | 3.150 |
| planet | 733 | 724 | 700 | 727 | 733 | 0.988 | 0.955 | 0.992 |
| planet1 | 733 | 724 | 700 | 727 | 733 | 0.988 | 0.955 | 0.992 |
| pma | 106 | 453 | 87 | 466 | 466 | 4.274 | 0.821 | 4.396 |
| s1 | 426 | 532 | 426 | 532 | 532 | 1.249 | 1.000 | 1.249 |
| s27 | 557 | 557 | 541 | 541 | 557 | 1.000 | 0.971 | 0.971 |
| s208 | 440 | 481 | 456 | 456 | 481 | 1.093 | 1.036 | 1.036 |
| s1488 | 436 | 434 | 419 | 485 | 485 | 0.995 | 0.961 | 1.112 |
| sand | 154 | 447 | 277 | 466 | 466 | 2.903 | 1.799 | 3.026 |
| sse | 505 | 506 | 505 | 531 | 531 | 1.002 | 1.000 | 1.051 |
| styr | 168 | 524 | 184 | 618 | 618 | 3.119 | 1.095 | 3.679 |
| tbk | 320 | 372 | 320 | 436 | 436 | 1.163 | 1.000 | 1.363 |
| tma | 142 | 461 | 147 | 475 | 475 | 3.246 | 1.035 | 3.345 |
| train4 | 207 | 809 | 291 | 690 | 809 | 3.908 | 1.406 | 3.333 |
| train11 | 363 | 524 | 271 | 555 | 555 | 1.444 | 0.747 | 1.529 |
| Av | 1.857 | 1.012 | 1.934 | |||||
| Max | 4.274 | 1.799 | 4.396 | |||||
| Best | 4 | 11 | 1 | 21 | ||||
| Unique | 2 | 6 | 0 | 16 |
| FSM | F3 | Fs | Fo | Fso | Fmax | Fs/F3 | Fo/F3 | Fso/F3 |
|---|---|---|---|---|---|---|---|---|
| bbsse | 333 | 536 | 334 | 447 | 536 | 1.003 | 1.610 | 1.342 |
| beecount | 658 | 789 | 608 | 598 | 789 | 0.924 | 1.199 | 0.909 |
| cse | 155 | 249 | 217 | 310 | 310 | 1.400 | 1.606 | 2.000 |
| dk14 | 480 | 780 | 480 | 480 | 780 | 1.000 | 1.625 | 1.000 |
| dk16 | 380 | 378 | 380 | 378 | 380 | 1.000 | 0.995 | 0.995 |
| dk512 | 578 | 552 | 578 | 552 | 578 | 1.000 | 0.955 | 0.955 |
| ex1 | 240 | 273 | 244 | 337 | 337 | 1.017 | 1.138 | 1.404 |
| ex2 | 219 | 272 | 298 | 404 | 404 | 1.361 | 1.242 | 1.845 |
| ex3 | 233 | 388 | 239 | 531 | 531 | 1.026 | 1.665 | 2.279 |
| ex4 | 419 | 450 | 419 | 731 | 731 | 1.000 | 1.074 | 1.745 |
| ex5 | 335 | 335 | 335 | 500 | 500 | 1.000 | 1.000 | 1.493 |
| ex6 | 226 | 412 | 232 | 433 | 433 | 1.027 | 1.823 | 1.916 |
| ex7 | 222 | 453 | 230 | 501 | 501 | 1.036 | 2.041 | 2.257 |
| lion | 677 | 486 | 664 | 814 | 814 | 0.981 | 0.718 | 1.202 |
| lion9 | 209 | 435 | 209 | 590 | 590 | 1.000 | 2.081 | 2.823 |
| planet | 238 | 295 | 226 | 296 | 296 | 0.950 | 1.239 | 1.244 |
| planet1 | 238 | 295 | 226 | 296 | 296 | 0.950 | 1.239 | 1.244 |
| pma | 111 | 165 | 92 | 219 | 219 | 0.829 | 1.486 | 1.973 |
| s1 | 249 | 296 | 249 | 296 | 296 | 1.000 | 1.189 | 1.189 |
| s27 | 240 | 540 | 537 | 537 | 540 | 2.238 | 2.250 | 2.238 |
| s208 | 716 | 716 | 721 | 721 | 721 | 1.007 | 1.000 | 1.007 |
| s1488 | 221 | 221 | 223 | 480 | 480 | 1.009 | 1.000 | 2.172 |
| sand | 211 | 209 | 192 | 239 | 239 | 0.910 | 0.991 | 1.133 |
| sse | 488 | 353 | 446 | 462 | 488 | 0.914 | 0.723 | 0.947 |
| styr | 203 | 317 | 184 | 317 | 317 | 0.906 | 1.562 | 1.562 |
| tbk | 210 | 237 | 210 | 202 | 237 | 1.000 | 1.129 | 0.962 |
| tma | 119 | 277 | 151 | 326 | 326 | 1.269 | 2.328 | 2.739 |
| train4 | 262 | 474 | 271 | 816 | 816 | 1.034 | 1.809 | 3.115 |
| train11 | 230 | 385 | 310 | 490 | 490 | 1.348 | 1.674 | 2.130 |
| Av | 1.074 | 1.393 | 1.649 | |||||
| Max | 2.238 | 2.328 | 3.115 | |||||
| Best | 3 | 7 | 3 | 21 | ||||
| Unique | 1 | 5 | 0 | 18 |
4.4. Research on the Effectiveness of the Proposed Approach in the Vivado Design Tool
| FSM | A3 | As | Ao | Aso | Amin | A3/As | A3/Ao | A3/Aso |
|---|---|---|---|---|---|---|---|---|
| bbsse | 29 | 22 | 30 | 23 | 22 | 1.318 | 0.967 | 1.261 |
| beecount | 8 | 16 | 10 | 14 | 8 | 0.500 | 0.800 | 0.571 |
| cse | 51 | 49 | 47 | 37 | 37 | 1.041 | 1.085 | 1.378 |
| dk14 | 21 | 21 | 21 | 20 | 20 | 1.000 | 1.000 | 1.050 |
| dk16 | 39 | 17 | 42 | 15 | 15 | 2.294 | 0.929 | 2.600 |
| dk512 | 13 | 7 | 11 | 6 | 6 | 1.857 | 1.182 | 2.167 |
| ex1 | 58 | 37 | 72 | 44 | 37 | 1.568 | 0.806 | 1.318 |
| ex2 | 10 | 8 | 9 | 7 | 7 | 1.250 | 1.111 | 1.429 |
| ex3 | 10 | 8 | 9 | 7 | 7 | 1.250 | 1.111 | 1.429 |
| ex4 | 11 | 12 | 13 | 14 | 11 | 0.917 | 0.846 | 0.786 |
| ex5 | 8 | 8 | 8 | 7 | 7 | 1.000 | 1.000 | 1.143 |
| ex6 | 25 | 24 | 25 | 23 | 23 | 1.042 | 1.000 | 1.087 |
| ex7 | 4 | 4 | 4 | 4 | 4 | 1.000 | 1.000 | 1.000 |
| lion | 3 | 2 | 3 | 2 | 2 | 1.500 | 1.000 | 1.500 |
| lion9 | 11 | 14 | 11 | 10 | 10 | 0.786 | 1.000 | 1.100 |
| planet | 83 | 50 | 88 | 52 | 50 | 1.660 | 0.943 | 1.596 |
| planet1 | 83 | 50 | 88 | 52 | 50 | 1.660 | 0.943 | 1.596 |
| pma | 35 | 52 | 63 | 74 | 35 | 0.673 | 0.556 | 0.473 |
| s1 | 63 | 34 | 63 | 34 | 34 | 1.853 | 1.000 | 1.853 |
| s27 | 119 | 130 | 120 | 130 | 119 | 0.915 | 0.992 | 0.915 |
| s208 | 10 | 11 | 9 | 13 | 9 | 0.909 | 1.111 | 0.769 |
| s1488 | 7 | 7 | 7 | 6 | 6 | 1.000 | 1.000 | 1.167 |
| sand | 94 | 98 | 87 | 83 | 83 | 0.959 | 1.080 | 1.133 |
| sse | 25 | 23 | 26 | 23 | 23 | 1.087 | 0.962 | 1.087 |
| styr | 88 | 53 | 98 | 53 | 53 | 1.660 | 0.898 | 1.660 |
| tbk | 128 | 156 | 116 | 153 | 116 | 0.821 | 1.103 | 0.837 |
| tma | 26 | 41 | 48 | 56 | 26 | 0.634 | 0.542 | 0.464 |
| train4 | 13 | 14 | 11 | 10 | 10 | 0.929 | 1.182 | 1.300 |
| train11 | 5 | 5 | 4 | 3 | 3 | 1.000 | 1.250 | 1.667 |
| Av | 1.175 | 0.979 | 1.253 | |||||
| Max | 2.294 | 1.250 | 2.600 | |||||
| Best | 6 | 9 | 3 | 18 | ||||
| Unique | 5 | 4 | 2 | 13 |
| FSM | A3 | As | Ao | Aso | Amin | A3/As | A3/Ao | A3/Aso |
|---|---|---|---|---|---|---|---|---|
| bbsse | 29 | 22 | 30 | 23 | 22 | 1.318 | 0.967 | 1.261 |
| beecount | 8 | 8 | 10 | 9 | 8 | 1.000 | 0.800 | 0.889 |
| cse | 51 | 49 | 47 | 37 | 37 | 1.041 | 1.085 | 1.378 |
| dk14 | 11 | 10 | 11 | 9 | 9 | 1.100 | 1.000 | 1.222 |
| dk16 | 15 | 7 | 15 | 7 | 7 | 2.143 | 1.000 | 2.143 |
| dk512 | 4 | 2 | 4 | 2 | 2 | 2.000 | 1.000 | 2.000 |
| ex1 | 58 | 37 | 72 | 44 | 37 | 1.568 | 0.806 | 1.318 |
| ex2 | 6 | 6 | 6 | 5 | 5 | 1.000 | 1.000 | 1.200 |
| ex3 | 6 | 5 | 7 | 6 | 5 | 1.200 | 0.857 | 1.000 |
| ex4 | 11 | 12 | 13 | 14 | 11 | 0.917 | 0.846 | 0.786 |
| ex5 | 5 | 5 | 5 | 5 | 5 | 1.000 | 1.000 | 1.000 |
| ex6 | 25 | 24 | 25 | 23 | 23 | 1.042 | 1.000 | 1.087 |
| ex7 | 5 | 4 | 5 | 4 | 4 | 1.250 | 1.000 | 1.250 |
| lion | 3 | 2 | 3 | 2 | 2 | 1.500 | 1.000 | 1.500 |
| lion9 | 4 | 6 | 5 | 5 | 4 | 0.667 | 0.800 | 0.800 |
| planet | 83 | 50 | 88 | 52 | 50 | 1.660 | 0.943 | 1.596 |
| planet1 | 83 | 50 | 88 | 52 | 50 | 1.660 | 0.943 | 1.596 |
| pma | 35 | 52 | 63 | 74 | 35 | 0.673 | 0.556 | 0.473 |
| s1 | 63 | 34 | 63 | 34 | 34 | 1.853 | 1.000 | 1.853 |
| s27 | 119 | 130 | 120 | 130 | 119 | 0.915 | 0.992 | 0.915 |
| s208 | 10 | 11 | 9 | 13 | 9 | 0.909 | 1.111 | 0.769 |
| s1488 | 7 | 7 | 7 | 6 | 6 | 1.000 | 1.000 | 1.167 |
| sand | 94 | 98 | 87 | 83 | 83 | 0.959 | 1.080 | 1.133 |
| sse | 25 | 23 | 26 | 23 | 23 | 1.087 | 0.962 | 1.087 |
| styr | 88 | 53 | 98 | 53 | 53 | 1.660 | 0.898 | 1.660 |
| tbk | 128 | 156 | 116 | 153 | 116 | 0.821 | 1.103 | 0.837 |
| tma | 26 | 41 | 48 | 56 | 26 | 0.634 | 0.542 | 0.464 |
| train4 | 6 | 6 | 6 | 5 | 5 | 1.000 | 1.000 | 1.200 |
| train11 | 4 | 2 | 3 | 2 | 2 | 2.000 | 1.333 | 2.000 |
| Av | 1.227 | 0.953 | 1.227 | |||||
| Max | 2.143 | 1.333 | 2.143 | |||||
| Best | 7 | 15 | 3 | 16 | ||||
| Unique | 5 | 4 | 2 | 7 |
4.5. Comparison of the Proposed Approach with Known Methods
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Abbreviations
| ASIC | Application-Specific Integrated Circuit |
| FPGA | Field-Programmable Gate Array |
| FSM | Finite State Machine |
| HDL | Hardware Description Language |
| VHDL | Very high-speed integrated circuit Hardware Description Language |
| SoC | System-on-Chip |
| STG | State Transition Graph |
References
- Barkalov, A.; Titarenko, L.; Mielcarek, K.; Mazurkiewicz, M. Hardware reduction for FSMs with extended state codes. IEEE Access 2024, 12, 42369–42384. [Google Scholar] [CrossRef]
- Rho, J.K.; Hachtel, G.D.; Somenzi, F.; Jacoby, R.M. Exact and heuristic algorithms for the minimization of incompletely specified state machines. IEEE Trans. Comput.-Aided Des. Integr. Circuits Syst. 1994, 13, 167–177. [Google Scholar] [CrossRef]
- De Micheli, G.; Brayton, R.K.; Sangiovanni-Vincentelli, A. Optimal state assignment for finite state machines. IEEE Trans. Comput.-Aided Des. Integr. Circuits Syst. 1985, 4, 269–285. [Google Scholar] [CrossRef]
- Villa, T.; Sangiovanni-Vincentelli, A. NOVA: State assignment of finite state machines for optimal two-level logic implementations. In Proceedings of the 26th ACM/IEEE Design Automation Conference, Las Vegas, NV, USA, 25–29 June 1989; pp. 327–332. [Google Scholar] [CrossRef]
- Devadas, S.; Ma, H.K.; Newton, A.R.; Sangiovanni-Vincentelli, A. MUSTANG: State assignment of finite state machines targeting multilevel logic implementations. IEEE Trans. Comput.-Aided Des. Integr. Circuits Syst. 1988, 7, 1290–1300. [Google Scholar] [CrossRef]
- Klimowicz, S.; Solov’ev, V.V. Structural models of finite-state machines for their implementation on programmable logic devices and systems on chip. J. Comput. Syst. Sci. Int. 2015, 54, 230–242. [Google Scholar] [CrossRef]
- Meyer, M.J.; Agrawal, P.; Pfister, R.G. A VLSI FSM Design System. In Proceedings of the 21st Design Automation Conference, Albuquerque, NM, USA, 25–27 June 1984; pp. 434–440. [Google Scholar] [CrossRef]
- Luba, T.; Gorski, K.; Wronski, L.B. ROM-based Finite State Machines with PLA address modifiers. In Proceedings of the EURO-DAC’92: European Design Automation Conference, Hamburg, Germany, 7–10 September 1992; pp. 272–273. [Google Scholar] [CrossRef]
- Baranov, S.; Levin, I.; Keren, O.; Karpovsky, M. Designing fault tolerant FSM by nano-PLA. In Proceedings of the 15th IEEE International On-Line Testing Symposium, Lisbon, Portugal, 24–26 June 2009; pp. 229–234. [Google Scholar] [CrossRef]
- Solovjev, V.; Chyzy, M. Refined CPLD macrocell architecture for the effective FSM implementation. In Proceedings of the 25th Euromicro Conference, Informatics: Theory and Practice for the New Millennium, Milan, Italy, 8–10 September 1999; Volume 1, pp. 102–109. [Google Scholar] [CrossRef]
- Czerwinski, R.; Kania, D. CPLD-oriented synthesis of finite state machines. In Proceedings of the 12th Euromicro Conference on Digital System Design, Architectures, Styles and Tools, Patras, Greece, 27–29 August 2009; pp. 521–528. [Google Scholar] [CrossRef]
- Garcia-Vargas, I.; Senhadji-Navarro, R.; Jimenez-Moreno, G.; Civit-Balcells, A.; Guerra-Gutierrez, P. ROM-based finite state machine implementation in low cost FPGAs. In Proceedings of the IEEE International Symposium on Industrial Electronics, Vigo, Spain, 4–7 June 2007; pp. 2342–2347. [Google Scholar] [CrossRef]
- Garcia-Vargas, I.; Senhadji-Navarro, R. Finite state machines with input multiplexing: A performance study. IEEE Trans. Comput.-Aided Des. Integr. Circuits Syst. 2015, 34, 867–871. [Google Scholar] [CrossRef]
- Villa, T.; Kam, T.; Brayton, R.K.; Sangiovanni-Vincentelli, A.L. Synthesis of Finite State Machines: Logic Optimization; Springer Science & Business Media: Berlin, Germany, 2012. [Google Scholar]
- Golson, S. State machine design techniques for Verilog and VHDL. Synopsys J. High-Level Des. 1994, 9, 1–20. [Google Scholar]
- Arnold, M.G.; Sample, N.J.; Shuler, J.D. Guidelines for safe simulation and synthesis of implicit style Verilog. In Proceedings of the International Verilog HDL Conference and VHDL International Users Forum, Santa Clara, CA, USA, 16–19 March 1998; pp. 59–66. [Google Scholar] [CrossRef][Green Version]
- Wang, T.H.; Edsall, T. Practical FSM analysis for Verilog. In Proceedings of the International Verilog HDL Conference and VHDL International Users Forum, Santa Clara, CA, USA, 16–19 March 1998; pp. 52–58. [Google Scholar] [CrossRef]
- Cummings, C.E. State machine coding styles for synthesis. In Proceedings of the Synopsys Users Group (SNUG’98), San Jose, CA, USA, March 1998; Synopsys: Sunnyvale, CA, USA, 1998; pp. 1–20. [Google Scholar]
- Cummings, C.E. Coding and scripting techniques for FSM designs with synthesis-optimized, glitch-free outputs. In Proceedings of the Synopsys Users Group Boston (SNUG), Boston, MA, USA, 20–22 September 2020; pp. 1–13. [Google Scholar]
- Cummings, C.E. Synthesizable Finite State Machine Design Techniques Using the New SystemVerilog 3.0 Enhancements. In Proceedings of the Synopsys Users Group (SNUG), San Jose, CA, USA, 29–31 March 2003; pp. 1–53. [Google Scholar]
- Rafla, N.I.; Davis, B.L. A study of finite state machine coding styles for implementation in FPGAs. In Proceedings of the 49th IEEE International Midwest Symposium on Circuits and Systems, San Juan, PR, USA, 6–9 August 2006; Volume 1, pp. 337–341. [Google Scholar] [CrossRef]
- Chiuchisan, I.; Potorac, A.D.; Graur, A. Finite state machine design and VHDL coding techniques. In Proceedings of the 10th International Conference on Development and Application Systems, Suceava, Romania, 27–29 May 2010; pp. 273–278. [Google Scholar]
- Masoumi, S.H.; Al-Haddad, S.A.R.; Rokhani, F.Z. New tool for converting high-level representations of finite state machines to Verilog HDL. In Proceedings of the IEEE 15th Student Conference on Research and Development (SCOReD), Putrajaya, Malaysia, 13–14 December 2017; pp. 1–6. [Google Scholar] [CrossRef]
- Sentovich, M.; Singh, K.J.; Lavagno, L.; Moon, C.; Murgai, R.; Saldanha, A.; Savoj, H.; Stephan, P.R.; Brayton, R.K.; Sangiovanni-Vincentelli, A. SIS: A System for Sequential Circuit Synthesis; University of California: Berkeley, CA, USA, 1992; p. 94720. [Google Scholar]
- Salauyou, V.; Zabrocki, L. Coding techniques in Verilog for finite state machine designs in FPGA. In Proceedings of the Computer Information Systems and Industrial Management: 18th International Conference (CISIM 2019), Belgrade, Serbia, 19–21 September 2019; pp. 493–505. [Google Scholar] [CrossRef]
- Salauyou, V. Description styles of fault-tolerant finite state machines for unmanned aerial vehicles. Radioelectron. Comput. Syst. 2024, 2024, 196–206. [Google Scholar] [CrossRef]
- Salauyou, V. Styles for Describing Reliable Finite State Machines in Verilog HDL. In Proceedings of the International Conference on Dependability of Computer Systems (DepCoS), Wroclaw, Poland, 1–5 June 2024; pp. 241–251. [Google Scholar] [CrossRef]
- Cummings, C.E. The Fundamentals of Efficient Synthesizable Finite State Machine Design using NC-Verilog and BuildGates. In Proceedings of the International Cadence Usergroup Conference, Aix-en-Provence, France, 2–6 September 2002; pp. 1–27. [Google Scholar]
- Yang, S. Logic Synthesis and Optimization Benchmarks User Guide, Version 3.0; Microelectronics Center of North Carolina (MCNC): Research Triangle Park, NC, USA, 1991. [Google Scholar]
- Lin, B.; Newton, A.R. Synthesis of multiple level logic from symbolic high-level description languages. In Proceedings of the IFIP International Conference on VLSI, Munich, Germany, 16–18 August 1989; pp. 187–196. [Google Scholar]




| ps | X(ps, ns) | ns | Y(ps, ns) |
|---|---|---|---|
| s0 | --0 | s1 | 001 |
| s0 | --1 | s3 | 111 |
| s1 | -0- | s2 | 010 |
| s1 | -1- | s3 | 111 |
| s2 | 0-- | s4 | 011 |
| s2 | 1-- | s3 | 111 |
| s3 | 000 | s3 | 111 |
| s3 | 111 | s0 | 101 |
| s4 | -00 | s3 | 111 |
| s4 | -11 | s0 | 100 |
| FSM | A | F |
|---|---|---|
| Mealy_3proc | 24 | 181 |
| Mealy_dstate | 16 | 543 |
| Mealy_dout | 19 | 237 |
| Mealy_dstate_out | 11 | 651 |
| FSM | L | N | T | M | Ts | To | λs | λo | λso |
|---|---|---|---|---|---|---|---|---|---|
| bbsse | 7 | 7 | 56 | 16 | 28 | 14 | 1.500 | 1.250 | 1.750 |
| beecount | 3 | 4 | 28 | 7 | 12 | 19 | 1.429 | 1.679 | 2.107 |
| cse | 7 | 7 | 91 | 16 | 47 | 31 | 1.516 | 1.341 | 1.857 |
| dk14 | 3 | 5 | 56 | 7 | 13 | 6 | 1.232 | 1.107 | 1.339 |
| dk16 | 2 | 3 | 108 | 27 | 9 | 34 | 1.083 | 1.315 | 1.398 |
| dk512 | 1 | 3 | 30 | 15 | 6 | 17 | 1.200 | 1.567 | 1.767 |
| ex1 | 9 | 19 | 233 | 18 | 45 | 32 | 1.193 | 1.137 | 1.330 |
| ex2 | 2 | 2 | 72 | 18 | 32 | 59 | 1.444 | 1.819 | 2.264 |
| ex3 | 2 | 2 | 36 | 10 | 16 | 30 | 1.444 | 1.833 | 2.278 |
| ex4 | 6 | 9 | 21 | 14 | 4 | 6 | 1.190 | 1.286 | 1.476 |
| ex5 | 2 | 2 | 32 | 9 | 15 | 18 | 1.469 | 1.563 | 2.031 |
| ex6 | 5 | 8 | 34 | 8 | 10 | 7 | 1.294 | 1.206 | 1.500 |
| ex7 | 2 | 2 | 36 | 10 | 18 | 23 | 1.500 | 1.639 | 2.139 |
| keyb | 7 | 2 | 170 | 19 | 112 | 111 | 1.659 | 1.653 | 2.312 |
| lion | 2 | 1 | 11 | 4 | 3 | 7 | 1.273 | 1.636 | 1.909 |
| lion9 | 2 | 1 | 25 | 9 | 3 | 17 | 1.120 | 1.680 | 1.800 |
| planet | 7 | 19 | 115 | 48 | 8 | 11 | 1.070 | 1.096 | 1.165 |
| planet1 | 7 | 19 | 115 | 48 | 8 | 11 | 1.070 | 1.096 | 1.165 |
| pma | 8 | 8 | 73 | 24 | 21 | 5 | 1.288 | 1.068 | 1.356 |
| s1 | 8 | 6 | 107 | 20 | 12 | 12 | 1.112 | 1.112 | 1.224 |
| s27 | 4 | 1 | 34 | 6 | 10 | 27 | 1.294 | 1.794 | 2.088 |
| s208 | 11 | 2 | 153 | 18 | 99 | 75 | 1.647 | 1.490 | 2.137 |
| s1488 | 8 | 19 | 251 | 48 | 121 | 62 | 1.482 | 1.247 | 1.729 |
| sand | 11 | 9 | 184 | 32 | 32 | 30 | 1.174 | 1.163 | 1.337 |
| sse | 7 | 7 | 56 | 16 | 28 | 14 | 1.500 | 1.250 | 1.750 |
| styr | 9 | 10 | 166 | 30 | 44 | 46 | 1.265 | 1.277 | 1.542 |
| tbk | 6 | 3 | 1569 | 32 | 567 | 1274 | 1.361 | 1.812 | 2.173 |
| tma | 7 | 6 | 44 | 20 | 9 | 4 | 1.205 | 1.091 | 1.295 |
| train4 | 2 | 1 | 14 | 4 | 4 | 10 | 1.286 | 1.714 | 2.000 |
| train11 | 2 | 1 | 25 | 11 | 5 | 18 | 1.200 | 1.720 | 1.920 |
| Av | 1.317 | 1.421 | 1.738 | ||||||
| Max | 11 | 19 | 1569 | 48 | 567 | 1274 | 1.659 | 1.833 | 2.312 |
| Methods | Area | Performance | ||
|---|---|---|---|---|
| Av | Max | Av | Max | |
| [1] | 79.6% | - | 22.4% | - |
| [2] | 15.0% | - | 8% | - |
| [3] | 25.0% | - | - | - |
| [4] | 30.0% | - | - | - |
| [5] | 30.0% | - | - | - |
| [6] | 25.8% | 100% | - | - |
| [8] | 50.0% | - | - | - |
| [9] | 5.0% | - | - | - |
| [10] | 67.0% | - | - | - |
| [11] | 30.0% | - | - | - |
| [12] | 87.0% | - | - | - |
| [13] | 50.6% | - | 19.7% | - |
| [25] | 26.0% | 3.1 times | 21.0% | 60% |
| [26] | 77.4% | 4.8 times | 19.3% | 2.4 times |
| [30] | 3.7% | 71.4% | 4.4% | 51.6% |
| Doh | 93.0% | 5.2 times | 93.4% | 4.4 times |
| Db | 97.6% | 6.2 times | 64.9% | 3.1 times |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Salauyou, V.; Klimowicz, A. Optimizing Digital Systems Implemented in FPGA Through Effective Description of Finite State Machines. Electronics 2026, 15, 831. https://doi.org/10.3390/electronics15040831
Salauyou V, Klimowicz A. Optimizing Digital Systems Implemented in FPGA Through Effective Description of Finite State Machines. Electronics. 2026; 15(4):831. https://doi.org/10.3390/electronics15040831
Chicago/Turabian StyleSalauyou, Valery, and Adam Klimowicz. 2026. "Optimizing Digital Systems Implemented in FPGA Through Effective Description of Finite State Machines" Electronics 15, no. 4: 831. https://doi.org/10.3390/electronics15040831
APA StyleSalauyou, V., & Klimowicz, A. (2026). Optimizing Digital Systems Implemented in FPGA Through Effective Description of Finite State Machines. Electronics, 15(4), 831. https://doi.org/10.3390/electronics15040831

