82. Four-State FSM Using LUT-Based CPLD Blocks

Loading simulator…

The pre-defined template contains three unconnected copies of the CPLD logic element.

The solution connects Q0, Q1, A, and B to every LUT in address order BAQ1Q0, where Q0 is the least-significant address bit.

The D0 and D1 blocks use registered mode and feed their outputs back as Q0 and Q1. The Y block uses combinational mode.

All three blocks retain the same control-signal names; validation drives only RST and Clock while the other controls use their shown default states.

Q1+ and Q0+ in the excitation table are the next-state bits. For D flip-flops, D1 = Q1+ and D0 = Q0+.

Q1Q0ABQ1+Q0+D1D0Y
000000000
000100000
001001010
001100000
010001010
010100000
011010100
011100000
100010100
100100000
101011110
101100000
110011110
110100000
111000001
111100001

Reading the D0, D1, and Y columns in ascending B A Q1 Q0 address order gives these LUT values:

LUT_D0 = 0000000001011010
LUT_D1 = 0000000001101100
LUT_Y  = 1000000010000000

Before the first active reset clock edge, the state flip-flops are uninitialized, so validation expects Q1, Q0, and Y to read X.

A rising edge with RST = 1 initializes the state to S0 = 00.