This page does not represent the most current semester of this course; it is present merely as an archive.
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:
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.
There are many kinds of transistors, but they all behave like voltage-actuated current valves.
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 logic consists of the operators and, or, and not.
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: . The output wire has high voltage only if both input wires have high voltage.
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 or
as a spade-shaped gate: . The output wire has high voltage if either of the input wires has high voltage.
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: . The output wire has high voltage if the input is low, low if the input is high.
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: . The output wire has high voltage if one input is high and the other is low.
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 and nor , 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).
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.
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.
A hardware register is made up of one or more flip-flops. The exact kind of flip-flop is not important for this course, though the D-type flip-flop has the behavior we most often discuss.
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 gated input to simulate bubble
and stall
behaviors); program registers (which are addressable as operands in code); status registers (which impact program behavior but are not accessible as operands); and register files (which are muxed sets of program registers). All are made up of hardware registers under the hood.
Prof. Kurmas from Grand Valley State University has a video you might find useful if you want another perspective on this.
Hyperphysics has a summary of how gates are made from transistors. Their discussion uses a different kind of transistor than is commonly used in microchips, but the ideas generally hold.