The amd sempron 145 cpu is a Socket AM3 processot.
The amd a6 6400k CPU is a FM2 socket processor.
The sockets are different and therefore the CPUs are not inter-changeable on the same motherboard.
The second thing to look for even if the sockets are the same is to make sure that the motherboard is compatible with both processors. There are other considerations too, like TDP.