Open ctapobep opened 3 years ago
Nice article, keep going! BTW, why don't you use https://pages.github.com/ instead?
Seems like Github Issues has everything needed for this purpose - comments, reactions, Markdown, pictures. Anyway, this is an experiment - we'll see how it turns out :)
Inspired by the book Code that I've been reading I decided to explain how programs work at the very bottom and we talked about logic gates, electricity and Boolean Algebra. It seems like to explain it we need to cover only these 3 topics:
a
andb
), the result should be:Second bit of the result is a sum bit, while the 1st bit is a carry over bit. Here's a Boolean expression that achieves it (
'
is a negation/inversion):Which in many programming languages can be written as:
Such circuit is called a Half Adder. I'd like them to realize that computers don't have a notion of a letter or a digit. It's all electricity and bits and numbers are the next level of abstraction. And only after that we get text, graphics and everything else. Eventually we got to this schematic picture:
Hopefully this kind of thinking will help to explain a lot of magic with time. And I wish someone had explained it to me when I was starting to write code.