Å·±¦ÓéÀÖ

Alb85's Reviews > Code: The Hidden Language of Computer Hardware and Software

Code by Charles Petzold
Rate this book
Clear rating

by
41843444
's review

it was amazing
bookshelves: computer-science, not-found-in-ita, to-re-read

Ottimo libro che ha l'ambizioso obiettivo di spiegare come è fatto un computer, dalla A alla Z. Nella prima metà vengono spiegati dei concetti specifici in modo dettagliato e chiaro. Nella seconda metà del libro la complessità dei concetti aumenta ed ovviamente diventa difficile descriverli con completezza in poche pagine. L'autore fa di tutto per facilitare la comprensione del testo, raccontando per esempio aneddoti su come si è evoluto il computer, inserendo un sacco di immagini e tabelle, ed arricchendo il tutto con del buon umorismo. Libro molto denso di concetti e scritto molto ma molto bene.

SPUNTI INTERESSANTI:

³§³Ü±ô±ô'±ð±ô±ð³Ù³Ù°ù¾±³¦¾±³Ùá:
- Lightning is a lot of electrons moving very quickly from one spot to another.
- In all batteries, chemical reactions take place, which means that some molecules break down into other molecules, or molecules combine to form new molecules. 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.
The reactions take place only if an electrical circuit is present to take electrons away from the negative side and supply electrons to the positive side. The electrons travel around this circuit in a counterclockwise direction
- But why do we need the wires? Can't the electricity just flow through the air? Well, yes and no. Yes, electricity can flow through air (particularly wet air), or else we wouldn't see lightning. But electricity doesn't flow through air very readily.
- An atom that has just one electron in its outer shell can readily give up that electron, which is what's necessary to carry electricity. These substances are conducive to carrying electricity and thus are said to be conductors. The best conductors are copper, silver, and gold. It's no coincidence that these three elements are found in the same column of the periodic table. Copper is the most common substance for making wires. The opposite of conductance is resistance. Some substances are more resistant to the passage of electricity than others, and these are known as resistors. If a substance has a very high resistance—meaning that it doesn't conduct electricity much at all—it's known as an insulator. Rubber and plastic are good insulators, which is why these substances are often used to coat wires. Cloth and wood are also good insulators as is dry air. Just about anything will conduct electricity, however, if the voltage is high enough.
Copper has a very low resistance, but it still has some resistance. The longer a wire, the higher the resistance it has. If you tried wiring a flashlight with wires that were miles long, the resistance in the wires would be so high that the flashlight wouldn't work.
The thicker a wire, the lower the resistance it has. This may be somewhat counterintuitive. You might imagine that a thick wire requires much more electricity to "fill it up." But actually the thickness of the wire makes available many more electrons to move through the wire.
- Voltage refers to a potential for doing work. Voltage exists whether or not something is hooked up to a battery. A much easier concept in electricity is the notion of current. Current is related to the number of electrons actually zipping around the circuit.
- The water-and-pipes analogy helps out here: Current is similar to the amount of water flowing through a pipe. Voltage is similar to the water pressure. Resistance is similar to the width of a pipe—the smaller the pipe, the larger the resistance. So the more water pressure you have, the more water that flows through the pipe. The smaller the pipe, the less water that flows through it. The amount of water flowing through a pipe (the current) is directly proportional to the water pressure (the voltage) and inversely proportional to the skinniness of the pipe (the resistance).
- In electricity, you can calculate how much current is flowing through a circuit if you know the voltage and the resistance. Resistance—the tendency of a substance to impede the flow of electrons—is measured in ohms, who also proposed the famous Ohm's Law. The law states I = E / R where I is traditionally used to represent current in amperes, E is used to represent voltage, and R is resistance.
- let's look at a battery that's just sitting around not connected to anything. The voltage E is 1.5. But because the positive and negative terminals are connected solely by air, the current is just about zero. Now let's connect the positive and negative terminals with a short piece of copper wire. Lots and lots of electrons will be flowing through the wire. In reality, the actual current will be limited by the physical size of the battery. The battery will probably not be able to deliver such a high current, and the voltage will drop below 1.5 volts. If the battery is big enough, the wire will get hot because the electrical energy is being converted to heat. If the wire gets very hot, it will actually glow and might even melt. If a wire has a low resistance, it can get hot and start to glow. This is how an incandescent lightbulb works. Inside a lightbulb is a thin wire called a filament, which is commonly made of tungsten. One end of the filament is connected to the tip at the bottom of the base; the other end of the filament is connected to the side of the metal base, separated from the tip by an insulator. The resistance of the wire causes it to heat up. In open air, the tungsten would get hot enough to burn, but in the vacuum of the lightbulb, the tungsten glows and gives off light. Most common flashlights have two batteries connected in series. The total voltage is 3.0 volts. A lightbulb of the type commonly used in a flashlight has a resistance of about 4 ohms. Thus, the current is 3 volts divided by 4 ohms, or 0.75 ampere, which can also be expressed as 750 milliamperes. This means that 4,680,000,000,000,000,000 electrons are flowing through the lightbulb every second.
- The watt is a measurement of power (P) and can be calculated as P = E x I
- One thing we learned about conductors is this: The larger the better. A very thick wire conducts much better than a very thin wire. That's where the earth excels. It's really, really, really big.

Sui numeri binari:
- The binary number system bridges the gap between arithmetic and electricity. In previous chapters, we've been looking at switches and wires and lightbulbs and relays, and any of these objects can represent the binary digits 0 and 1
- The sum of two binary numbers is given by the output of an XOR gate, and the carry bit is given by the output of an AND gate.
- When used in computers, transistors basically function the same way relays do, but (as we'll see) they're much faster and much smaller and much quieter and use much less power and are much cheaper.

Sugli oscillatori:
- The frequency of the oscillator is 1 divided by the period. In this example, if the period of the oscillator is 0.05 second, the frequency of the oscillator is 1 ÷ 0.05, or 20 cycles per second. Twenty times per second, the output of the oscillator changes and changes back.
Cycles per second is a fairly self-explanatory term, much like miles per hour or pounds per square inch or calories per serving. But cycles per second isn't used much any more. In commemoration of Heinrich Rudolph Hertz (1857�1894), who was the first person to transmit and receive radio waves, the word hertz is now used instead.
- A flip-flop circuit retains information. It "remembers." In particular, the flip-flop shown previously remembers which switch was most recently closed. If you happen to come upon such a flip-flop in your travels and you see that the light is on, you can surmise that it was the upper switch that was most recently closed; if the light is off, the lower switch was most recently closed. Although it might not be apparent yet, flip-flops are essential tools. They add memory to a circuit to give it a history of what's gone on before. Imagine trying to count if you couldn't remember anything.

Sui Byte:
- The word byte originated at IBM, probably around 1956. The word had its origins in the word bite but was spelled with a y so that nobody would mistake the word for bit. For a while, a byte meant simply the number of bits in a particular data path. But by the mid-1960s, in connection with the development of IBM's System/360 (their large complex of business computers), the word came to mean a group of 8 bits.
- It turns out that 8 is, indeed, a nice bite size of bits. The byte is right, in more ways than one. One reason that IBM gravitated toward 8-bit bytes was the ease in storing numbers in a format known as BCD (which I'll describe in Chapter 23). But as we'll see in the chapters ahead, quite by coincidence a byte is ideal for storing text because most written languages around the world (with the exception of the ideographs used in Chinese, Japanese, and Korean) 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. And where 1 byte is inadequate (for representing, for example, the aforementioned ideographs of Chinese, Japanese, and Korean), 2 bytes—which allow the representation of 216, or 65,536, things—usually works just fine.

Sulla matematica:
The Scottish mathematician John Napier (1550�1617) ... invented logarithms for the specific purpose of simplifying these operations. The product of two numbers is simply the sum of their logarithms. So if you need to multiply two numbers, you look them up in a table of logarithms, add the numbers from the table, and then use the table in reverse to find the actual product.

Sui computer:
- But beginning in the early 1940s, vacuum tubes began supplanting relays in new computers. By 1945, the transition was complete. While relay machines were known as electromechanical computers, vacuum tubes were the basis of the first electronic computers.
- It wasn't until the mid-1950s that magnetic core memory was developed. Such memory consisted of large arrays of little magnetized metal rings strung with wires. Each little ring could store a bit of information.
- The transistor inaugurated solid-state electronics, which means that transistors don't require vacuums and are built from solids, specifically semiconductors and most commonly (these days) silicon. Besides being much smaller than vacuum tubes, transistors require much less power, generate much less heat, and last longer.
- Vacuum tubes were originally developed for amplification, but they could also be used for switches in logic gates. The same goes for the transistor.
- Transistors certainly make computers more reliable, smaller, and less power hungry. But do transistors make computers any simpler to construct?
Not really. The transistor lets you fit more logic gates in a smaller space, of course, but you still have to worry about all the interconnections of these components. It's just as difficult wiring transistors to make logic gates as it is wiring relays and vacuum tubes.

Sui monitor:
- Around 1889, when Edison and his engineer William Kennedy Laurie Dickson were working on the Kinetograph motion picture camera and the Kinetoscope projector, they decided to make the motion picture image one-third wider than it was high. The ratio of the width of the image to its height is called the aspect ratio. The ratio that Edison and Dickson established is commonly expressed as 1.33 to 1, or 1.33:1, or, to avoid fractions, 4:3.

Sulla memoria:
- The most obvious difference between memory and storage is that memory is volatile; it loses its contents when the power is shut off. Storage is non-volatile; data stays on the floppy disk or hard disk until it's deliberately erased or written over. Yet there's another significant difference that you can appreciate only by understanding what a microprocessor does. When the microprocessor outputs an address signal, it's always addressing memory, not storage.

Sui numeri:
- Beyond whole numbers, mathematicians also define rational numbers as those numbers that can be represented as a ratio of two whole numbers. This ratio is also referred to as a fraction.
- Irrational numbers are monsters such as the square root of 2. This number can't be expressed as the ratio of two integers
- If a number is not a solution of any algebraic equation with whole number coefficients, it's called a transcendental. (All transcendental numbers are irrational, but not all irrational numbers are transcendental.)
- This type of storage and notation is also called fixed-point format because the decimal point is always fixed at a particular number of places—in our example, at two decimal places. Notice that there's nothing actually stored along with the number that indicates the position of the decimal point. Programs that work with numbers in fixed-point format must know where the decimal point is.
- Scientific notation is particularly useful for representing very large and very small numbers because it incorporates a power of ten that allows us to avoid writing out long strings of zeros.
- In computers, the alternative to fixed-point notation is called floating-point notation, and the floating-point format is ideal for storing small and large numbers because it's based on scientific notation.
- In decimal scientific notation, the normalized significand should be greater than or equal to 1 but less than 10. Similarly, the normalized significand of numbers in binary scientific notation is always greater than or equal to 1 but less than binary 10, which is 2 in decimal.

Sui programmi:
- it's not enough to simply define a high-level language (which involves developing a syntax to express all the things you want to do with the language); you must also write a compiler, which is the program that converts the statements of your high-level language to machine code. Like an assembler, a compiler must read through a source-code file character by character and break it down into short words and symbols and numbers. A compiler, however, is much more complex than an assembler. An assembler is simplified somewhat because of the one-to-one correspondence between assembly-language statements and machine code. A compiler usually must translate a single statement of a high-level language into many machine-code instructions. Compilers aren't easy to write.
- Many subsequent implementations of BASIC have been in the form of interpreters rather than compilers. As I explained earlier, a compiler reads a source-code file and creates an executable file. An interpreter, however, reads source code and executes it directly as it's reading it without creating an executable file. Interpreters are easier to write than compilers, but the execution time of the interpreted program tends to be slower than that of a compiled program

Su internet:
- The telephone system is built to transmit sound, not bits, over wires. Sending bits over telephone wires requires that the bits be converted to sound and then back again. A continuous sound wave of a single frequency and a single amplitude (called a carrier) doesn't convey any substantial information at all. But change something about that sound wave—in other words, modulate that sound wave between two different states—and you can represent 0s and 1s. The conversion between bits and sound occurs in a device called the modem (which stands for modulator/demodulator). The modem is a form of serial interface because the individual bits in a byte are sent one after another rather than all at once.
- While much of this book has focused on using electricity to send signals and information through a wire, a more efficient medium is light transmitted through optical fiber—thin tubes made of glass or polymer that guide the light around corners. Light passing through such optical fibers can achieve data transmission rates in the gigahertz region—some billion of bits per second.
2 likes ·  âˆ� flag

Sign into Å·±¦ÓéÀÖ to see if any of your friends have read Code.
Sign In »

Reading Progress

November 14, 2018 – Shelved
November 17, 2018 – Started Reading
December 5, 2018 – Finished Reading

Comments Showing 1-1 of 1 (1 new)

dateDown arrow    newest »

message 1: by Fra Cesko (new) - added it

Fra Cesko Bastava anche meno per convincermi... ottima recensione! 😉


back to top