83. Three-Block CPLD Sequence Reconfiguration

Loading simulator…

The pre-defined circuit uses the same three LUT blocks, feedback paths, D flip-flops, reset connection, and clock connection as the solution. Its original LUT configuration generates the four-state cycle while keeping Q2 LOW. The solution changes the three LUT values and enables polarity inversion only in the Q2 block.

Each present state forms the LUT address in Q2 Q1 Q0 order, with Q2 as the most-significant bit and Q0 as the least-significant bit. For every address, the three bits of the required next state are placed into the corresponding Q2_next, Q1_next, and Q0_next truth tables.

Q0_next = 8'hC3
Q1_next = 8'h4E
Q2_next = 8'hE4

The Q0 and Q1 blocks store their next-state tables directly. The Q2 block uses polarity_Q2 = 1, so its LUT stores the complement of Q2_next:

LUT_Q0 = 8'hC3 = 8'b11000011
LUT_Q1 = 8'h4E = 8'b01001110
LUT_Q2 = 8'h1B = 8'b00011011
LUT_Q2 = 8'hE4 XOR 8'hFF

The polarity XOR restores the required Q2_next value before the Q2 D flip-flop captures it. All three blocks use mode_sel = 1, CE = 1, and OE = 1 for normal registered operation. At each rising edge of CLK_G, the three flip-flops capture the next-state bits simultaneously. An active RST clears the registered state to 000 on the next rising edge.

The output sequence alone cannot prove that polarity_Q2 was used, because an equivalent non-inverted LUT table can produce the same states. The required polarity setting must therefore be confirmed by inspecting the circuit configuration.