In this paper, a photonic crystal structure based on nonlinear cavities has been proposed to improve the time response of a 2-to-4 decoder. The structure includes an array of chalcogenide rods with an air gap in which the spatial period of rods is 500 nm. The radius of the fundamental rods is assumed to be 125 nm, which results in a photonic bandgap of 1092–1724 nm at TM mode. Three cavities, including the nonlinear rods with a Kerr coefficient of
10
−
14
m
2
/
W
, drop the incoming waves concerning the amount of optical intensity. The finite-difference time-domain method was used to calculate the components of the electric and magnetic fields throughout the structure. The time analysis of the device shows the rise time is equal to 200 fs, which is less than one for the previous structures. The area of
110
µ
m
2
and the margins of 4% and 88% for logics 0 and 1 are other advantages of the proposed structure. Based on the obtained results, it was proven that the performance of the 2-to-4 photonic crystal-based decoder has been improved by this work.