Once read the post - "*7 Segment Display Decoder Circuit*(BCD to 7 Segment LED Display Decoder Circuit)":http://www.electronicshub.org/bcd-7-segment-led-display-decoder-circuit/. It is best example to understand your required concept. The circuit diagram and working details are also given in that post.