Logic in displaying numbers in 7 segment 4 digit display
Generally the segments are named a through g, starting with the top segment a, clockwise around to the top left segment f, and finally the center segment g.  See the wikipedia article: https://en.wikipedia.org/wiki/Seven-segment_display .  Unfortunately, I cannot post the image here because it is an SVG.  

Consult the datasheet or poke around with a resistor and battery to work out which pins correspond to which segment.  Generally displays are either common anode or common cathode, with all of the anodes or cathodes connected to one common pin.  There are also some common pinouts, so if you don't know the part number, do a google image search to find a part number of a display that looks the same and then use that to find the datasheet.  

With a 4 digit display, there will generally be four separate commons - one for each digit - and all of the corresponding segments will be wired in parallel.  So if you put a current in the correct direction between the common for digit 1 and the segment a connection, segment a on digit 1 will light up.  It is not possible to illuminate two digits with different patterns at the same time with this configuration.  If you want different patterns on each digit, what you need to do is multiplex.  Turn one digit on at a time, and cycle through them all at high speed.