Design a level-sensitive D latch. When EN=1, the output must follow D. When EN=0, the latch must hold its previous value.
Requirements
d_latchENDQEN=1 → Q tracks DEN=0 → Q holds previous valuealways @(EN or D) (or always @(*)).<=) for storage.Behaviour / Worked Example
Starting from Q=0:
EN=1, D=0 → Q=0EN=1, D=1 → Q=1EN=0, D=0 → Q=1 (hold)EN=0, D=1 → Q=1 (hold)EN=1, D=0 → Q=0