You will need to give us a lot more information than you have before we can help you.
For a start you will need to tel us how the displays are connected to the MCU. Can you show us a schematic diagram?
What is the display you are using? I assume that you have connected it to PORTB. Are you using the same port to connect to the other
digit display?
What is "k"? Is it the variable that holds the digit that you want to display?
With the MCU you are using, you need to be careful about 'read-modify-write' issues as it does not have LAT registers associated with each PORT. Just looking at your code, if you use sequences such as the two "output_low" function calls in quick succession (and depending on how the code is written) you might be susceptible to this problem.
Susan