Code and Elements of Computing Systems are two of the most recommended books (top 20) on HN according to a now defunct scraping site.
The Elements of Computing Systems: Building a Modern Computer from First Principles
by Noam Nisan and Shimon Schocken
https://openlibrary.org/works/OL21015000W/Elements_of_Comput...