Logic Gates and Hardware

Logic in Computer Science

Logic is a foundational component of computer programming. As you create programs, there will be occasions in which you want to check multiple conditions at the same time for an intended result. If you want to check multiple conditions in a selection statement (if-else), Boolean/logical operators (such as AND and OR) allow this to happen. In Unit 2: Decisions, you were first exposed to Boolean operators as well as seeing them implemented in the subsequent activity, “How Many Days…?” You were also able to see the practical application of Boolean operators in the Logic Gate Game—each logic gate performs a logical operation.

Logic Gates

A logic gate is a hardware abstraction that is modeled by a Boolean function. At the simplest level, a computer can be described as a vast collection of switches that are either on or off (1s and 0s in binary). Most of these electronic switches are transistors or diodes. Transistors act as “water faucets” by controlling the flow of electricity to logic gates. Multiple logic gates form integrated circuits (or microchips). A collection of integrated circuits form computer hardware components, such as motherboards, video cards, memory, etc. In this way, computer hardware is built using multiple levels of abstraction. In Unit 1, you learned about Moore’s Law and its implications for computing. Each transistor performs a single operation. Moore’s Law states the processing power of computers will double every two years. It is important to note that

"From 2000 – 2009 there has not really been much of a speed difference as the speeds range from 1.3 GHz to 2.8 GHz, which suggests that the speeds have barely doubled within a 10 year span. This is because we are looking at the speeds and not the number of transistors; in 2000 the number of transistors in the CPU numbered 37.5 million, while in 2009 the number went up to an outstanding 904 million; this is why it is more accurate to apply the law to transistors than to speed.”— MooresLaw.org

Moore’s Law and hardware abstraction is demonstrated well in this article, which claims that IBM has been able to squeeze 30 billion transistors into a fingernail-sized chip (WOW!). Similar to how the human body is made of cells, computers are made of transistors.

Using the table below, explain how the idea of abstraction pervades both biology and computer science by

  • Describing if the structure is low-level abstraction.
  • Summarizing how each structure functions individually and part of the larger system.
  • Describing the similarities between each side-by-side structure (i.e. how is a cell similar to a transistor?).
Biological Science Computational Science

Cell (Muscle Cell)

Transistor (Bipolar Junction Transistor)

Tissue (Muscle Tissue)

Logic Gate (AND Gate)

Organ (Heart)

Integrated Circuit (Microchip)

Organ System (Circulatory)

Hardware Component (Random Access Memory)

Organism (Human)

Computer System (Laptop)

Mapping Bits

As you can see, the use of 1s and 0s is just a (software) abstraction of electrical switches turning on and off (hardware). Keeping in mind the relationship between hardware and software, take a look at your Unintend’o Project.

Imagine the Unintend’o controller was not on screen, but instead in your hand (in place of the keyboard).

As you press the “β” button, you are changing that switch from “off” to “on” and producing a 1 for the bitstring.

In your Unintend’o Project, you will ultimately generate a bitstring that will change based on which input is allowing an electrical signal to pass through (i.e., which button is being pressed). Like this example, software applications and computer systems are designed, developed, and analyzed using a combination of levels of hardware, software, and conceptual abstractions.