Exercises

Interactive tools

Reference

Examples

Right-click and save to download the examples.

Safari users: Safari sometimes changes file extensions. Do not trust it.

Numerical examples
IntRanges.java Shows and explains the ranges of the integer types in Java.
FloatBits.java Shows some interesting examples of float bit patterns.
Combinational Circuits
not_gate.circ How a NOT gate is constructed out of transistors.
full_adder.circ A 1-bit full adder made of gates.
ripple_carry_adder.circ A 3-bit ripple-cary adder made of 3 full adders.
Sequential Circuits
RS_latch.circ An RS latch made of NOR gates.
Circuit.js RS Latch Circuit.js can simulate it at a lower level, so you can see the current and voltages.
D_latch.circ A D latch made from an RS latch.
D_flipflop.circ A D flip-flop made from 2 D latches.
register_4bit.circ A 4-bit register made from D flip-flops.
simple_counter.circ A register paired with an adder can count up each clock tick.
fan_controller.circ A simple FSM for controlling a ceiling fan.
MIPS
array_and_for_loop.asm Example from class of declaring a 5-item array and printing its items.
args_and_ret_vals.asm Showing how to pass arguments and return values, and also some s reg use.
recursive_func.asm A recursive implementation of factorial. The stack is required for recursion!