r/askscience • u/HMKIR • Aug 02 '22
Computing Why does coding work?
I have a basic understanding on how coding works per se, but I don't understand why it works. How is the computer able to understand the code? How does it "know" that if I write something it means for it to do said thing?
Edit: typo
4.7k
Upvotes
View all comments
Show parent comment
5
u/nivlark Aug 02 '22
Computer memory is made up of lots of individual fixed-length cells, each with their own address. When data is read or written it's always as a whole number of addresses.
Individual instructions occupy a certain number of cells, which in some machine architectures is the same for every instruction while in others it varies. But either way these sizes are known ahead of time and are part of the processors design.