"Cyanide" doesn't refer to just one compound, but given the lethal dose you mention of "half a gram" you are probably referring to potassium cyanide, with a molecular weight of about 65g/mol, so 0.5 gram is about $10^{22}$ molecules. Potassium cyanide becomes hydrogen cyanide in the stomach, and hydrogen cyanide is the gas (at body temperature) that causes toxic effects.
The toxicity of cyanide containing compounds is because they bind with high affinity to cytochrome c oxidase, an enzyme that is part of the mitochondrial electron transport chain. The result is that electrons cannot be efficiently transferred to oxygen molecules. The effect is roughly the same as if oxygen was not present in the inspired air.
$10^{22}$ is a huge number. That's about 250 million molecules per human cell in an adult (taking # of human cells from Bianconi et al). Even so, it isn't likely that cyanide molecules be perfectly bound at every molecule of cytochrome c oxidase, just that there is enough to cause massive brain damage or stop the heart.
By comparison, cyanide is not even close to the most toxic substance. Toxins that target neurotransmission can be much more potent. For example, the IV LD50 for botulinum toxin is about 2 ng/kg, so something like 125 ng for an average adult, equaling only $5\times10^{11}$ molecules.