I learned a lot of these things from taking Harvard's CS50 online, reading the blog posts I linked (and doing problems), and I would imagine this book (https://bigmachine.io/products/the-imposters-handbook/) would help out - a friend recommended it, but I never got around to it.
https://www.amazon.com/Code-Language-Computer-Hardware-Softw...
^Covers logic gates and the basics of how a computer is built to an incredible degree, but it's VERY time intensive. Still, I really recommend it.