Code - by Charles Petzold
ISBN: 0137909101Date read: 2022-09-24
How strongly I recommend it: 8/10
(See my list of 360+ books, for more.)
Go to the Amazon page for details and reviews.
Masterpiece of clear explanation! How to make a computer from scratch. Basics of electricity, 1/0 AND/OR switches, boolean algebra, how physical switches can make an adding machine, bytes and ASCII text, memory, CPU, and so on, up to a working computer. Each chapter building perfectly on the previous. If you’re interested in learning computers from scratch, this is the definitive book for it. (I rate this book a perfect 10 for what it is, but only giving an 8 here, because it’s not for everyone.)
my notes
Electricity is like nothing else in this universe.
Electrons can be dislodged from atoms. That’s how electricity happens.
An imbalance of protons and electrons will attempt to correct itself.
During storms, the bottoms of clouds accumulate electrons while the tops of clouds lose electrons.
Eventually, the imbalance is evened out with a bolt of lightning.
Lightning is a lot of electrons moving very quickly from one spot to another.
As one atom in the circuit loses an electron to another atom nearby, it grabs another electron from an adjacent atom, which grabs an electron from another adjacent atom, and so on. The electricity in the circuit is the passage of electrons from atom to atom.
Batteries generate electricity through a chemical reaction. The chemicals in batteries are chosen so that the reactions between them generate spare electrons on the side of the battery marked with a minus sign (called the negative terminal, or anode) and demand extra electrons on the other side of the battery (the positive terminal, or cathode). In this way, chemical energy is converted to electrical energy.
All electrons are identical.
Voltage refers to a potential for doing work.
Current is related to the number of electrons actually zipping around the circuit.
Current is measured in amps.
Current is similar to the amount of water flowing through a pipe.
Voltage is similar to the water pressure.
Resistance - the tendency of a substance to impede the flow of electrons - is measured in ohms.
The earth is to electrons as an ocean is to drops of water.
Boolean algebra can also be used to determine whether something satisfies a certain set of criteria.
+ (a union) can also mean OR.
× (an intersection) can also mean AND.
1 − (the universe without something) means NOT.
The phrase binary digit? Coin a new, shorter word: the short, simple, elegant, and perfectly lovely word: bit.
The word bit, coined to mean binary digit, is surely one of the loveliest words invented in connection with computers.
Regarded in the computer age as the basic building block of information.
We base our number system on ten because that’s the number of fingers we have.
There’s nothing all that special about the decimal number system
But there is something special about binary, because binary is the simplest number system possible. There are only two binary digits - 0 and 1. If we want something simpler than binary, we’ll have to get rid of the 1, and then we’ll be left with just a 0, and we can’t do much of anything with just that.
8 bits to a byte.
As an 8-bit quantity, a byte can take on values from 00000000 through 11111111, which can represent decimal numbers from 0 through 255,
A byte is ideal for storing text because many written languages around the world can be represented with fewer than 256 characters.
A byte is also ideal for representing gray shades in black-and-white photographs because the human eye can differentiate approximately 256 shades of gray.
For color on video displays, 3 bytes work well to represent red, green, and blue.