CS 3330: Lec 2: 2330 Lite

This page does not represent the most current semester of this course; it is present merely as an archive.

Oversimplified Electronics

A wire is like a hose; voltage measures water pressure and current measures water flow.

In a chip we generalize the world into two kinds of wires: those that have high voltage ("on" or "live" or "1") and those that have low voltage ("off" or "ground" or "0").

We will mostly ignore current in this course, besides two observations:

Transistors

A transistor is like a pressure-activated valve. There are three wires into it; if voltage is applied to one of them then current can flow between the other two.

Pressure-activated valve (Transistor)

Larger Circuit Components

Transistors can be used to construct a variety of higher-level components often called "gates". How this is done is discussed in ECE/CS 2330. For our purposes, you just need to know about the behavior of the following components.

Hpyerphysics has a summary of how gates and inverters are made from transistors if you are curious.

Boolean Gates

Boolean logic consists of the operators and, or, and not.

And

The expression x & y in programming languages is "on" if x and y are "on", "off" if either x or y is "off". In circuit diagrams we draw "and" as a D-shaped gate: AND ANSI.svg. The output wire has high voltage only if both input wires have high voltage.

Or

The expression x | y in programming languages is "on" if either x or y is "on", "off" if both x and y are "off". In circuit diagrams we draw "and" as a spade-shaped gate: OR ANSI.svg. The output wire has high voltage if either of the input wires has high voltage.

Not

The expression ~x in programming languages is "on" if x is "off", "off" is x is "on". In circuit diagrams we draw "not" as little circle, often attached to other gates. If we need to draw it by itself, we put it on a triangle: NOT ANSI.svg. The output wire has high voltage if the input is low, low if the input is high.

Exclusive Or

The expression x ^ y in programming languages is "on" if x | y but not x & y. In circuit diagrams we draw "exclusive-or" or "xor" as a spade-shaped gate with an extra line over the inputs: XOR ANSI.svg. The output wire has high voltage if one input is high and the other is low.

Others

The "not" circle can be attached to any input or output of any other gate symbol to make a new symbol. Two of these, the nand NAND ANSI.svg and nor NOR ANSI.svg, are common enough to have their own name and own symbol, but do not have a standard operator representation in code (we'd have to use ~(x & y) for nand and ~(x | y) for nor).

Multiplexer

A multiplexer, or mux, selects one of a set of inputs to be the output. Given 2n inputs, it requires n selector inputs to decide which one to use. Multiplexers are typically drawn as trapezoids, though out textbook uses rounded boxes with the letters MUX in them instead.

Multiplexers are kind of like the hardware equivalent of an array. You can learn more at wikipedia.

Math

The ALU (Arithmetic Logic Unit) contains particular series of logic gates that can perform operations like addition and subtraction on groups of wires called words. We'll basically ignore how these work in this class.

Register

A hardware register is made up of one or more flip-flops. The exact kind of flip-flop is not important for this course. A register has an input, an output, and a clock input. Normally the output is constant, ignoring the input completely. However, on the rising edge of the clock input (that is, as the clock input transitions from low- to high-voltage) the register changes the output it is producing to match the current input. It will continue to produce that new output until the next rising clock edge.

This course will discuss several kinds of registers, including pipeline registers (which have muxed input to simulate "bubble" and "stall" behaviors); program registers (which are addressable as operands in code); and register files (which are muxed sets of program registers). All are made up of hardware registers under the hood.

Other sources

Prof. Kurmas from Grand Valley State University has a video you might find useful if you want another perspective on this.

Hpyerphysics has a summary of how gates are made from transistors.

Copyright © 2015 by Luther Tychonievich. All rights reserved.
Last updated 2015-01-13 13:52 -0500