library for 7 segment display

For one of my projects I am using a 7 segement display driven by a cd4511 ic. I need to control the display using arduino. Is there a specific arduino library for cd4511 ic.

No need.

The 4511 takes 4 data bits and displays the corresponding character. When you know what four data bits you want to send to it, you write them to the four port pins to which you have connected the 4511. That's it!

I dont get you Will I have to define the 4 bit code corresponding to each number in setup? then what about alphabets?

What alphabet? The 4511 displays 0 to 9, that's it.

if i wanted to display text?

Well you can’t, not via the 4511.
If you want to display text on the 7 seg, then get rid of the 4511 and wire each of the 7 segments (via resistors) to some pins on the Arduino.
Now you have complete control over each segment.

thanks, now i understand

Pretty simple part. Say you had the bits D-C-B-A connected to the analog pins A3-A2-A1-A0, and the strobe pin connected to A4. Which are all PORTC pins on a '328P. And your data was in byte numberDisplay; // values from 0b00000000 to 0b00001001 (0 to 9) and you had a flag that you used to keep track of when the display needed to change. byte displayFlag = 0; then as part of loop you could have this:

if (displayFlag == 1){
displayFlag = 0; // clear flag for next pass
PORTC = PORTC & 0b11110000;  // clear the lower bits, leave upper 4 alone
PORTC = PORTC | numberDisplay; // bring in the 4 bits that make 0 to 9
PORTC = PORTC & 0b11101111; // clear the latch bit to let the data in, leave the rest alone
PORTC = PORT | 0b00010000; // set the latch bit to hold the data
}

Now, did you really need a library for that? I don't think so. Just need to have the pins A0 to A4 (or D14 to D18) set as outputs in setup.

If you want to display text, use a cd74AC164 (or less suitably a 74HC595) and shift in the code you wanted to make these letters: AbcCdEFgHhiJLnOPSTU 0123456789 Make a font Array and shift the data into a shift register:

byte fontArray[] = {
0b00111111, // 0, with 1 = segment On, 7=DP, 6 = g, 5=f, 4=e, 3=d, 2=c, 1=b, 0=a
0b00000110, // 1       a
0b01011011, // 2   f        b
0b01001111, // 3       g
0b01100110, // 4   e        c
0b01101101, // 5        d       DP
0b01111101, // 6
// etc
};

// send the data out
if (updateFlag == 1){
updateFlag = 0;
digitalWrite (csPin, LOW); //  LOW for '595, HIGH for '164
SPI.transfer(fontArray[numberDisplay]);
digitalWrite (csPin,  HIGH); // HIGH for '595, LOW for '164
}

There you go!