Chapter Eight

Relays and Gates

Reduced to its essentials, a computer is a synthesis of Boolean algebra and electricity. The crucial components that embody this melding of math and hardware are known as logic gates. These gates are not unlike the familiar gates through which water or people pass. Logic gates perform simple operations in Boolean logic by blocking or letting through the flow of electrical current.

You’ll recall that in Chapter 6 you entered a pet shop and boldly announced, “I want a male cat, neutered, either white or tan; or a female cat, neutered, any color but white; or I’ll take any cat you have as long as it’s black.” These criteria are summarized by the following Boolean expression:

(M×N×(W+T))+(F×N×(1W))+B

This expression ...

Get Code: The Hidden Language of Computer Hardware and Software, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.