CS 240 Lab 2

Learning Goals & Reflection

CS 240 Lab 2

Learning Goals

Core Goals

Students can:

  1. Deal with signed and unsigned binary and hexadecimal numbers:
    1. Explain the difference between signed an unsigned binary numbers.
    2. Explain how the two’s-complement system represents both positive and negative numbers using binary.
    3. Identify which positive numbers in an unsigned interpretation are equivalent to which negative numbers in a two’s-complement interpretation.
    4. Explain the difference between overflow and carry-out in binary addition.
    5. Perform binary addition for fixed-width signed and unsigned binary operands, identifying overflow and/or carry-out conditions.
    6. Perform addition for fixed-width hexadecimal numbers, identifying overflow and/or carry-out conditions.
    7. Convert numbers between binary, hexadecimal, and decimal, including two’s-complement binary for negative numbers.
    8. Explain why computers use fixed-width binary to represent numbers.
    9. Explain why hexadecimal is used by low-level programmers.
  2. Build physical circuits that use binary representations, based on logic diagrams:
    1. Explain the difference between a pinout and a logic diagram.
    2. Given a logic diagram, connect wires to one or more chips on a workbench to build the circuit it represents.
    3. Record a circuit’s behavior across multiple input events to create a table of its outputs over time.
    4. Explain how groups of high- and low-voltage wires in a circuit can represent a number.
    5. Read the number represented by a group of LEDs that are turned on or off by a connected circuit.
    6. Recognize the pattern of bits formed when counting up in binary.
    7. Connect multiple chips together to form a more complicated circuit.
  3. Use CircuitVerse online simulator to build and debug simulated circuits:
    1. Use the “Circuit Elements” panel to add components like inputs, outputs, and gates to a circuit.
    2. Draw wires and connect components, and delete wires.
    3. Add debug flags, name them, and open the timing pane in CircuitVerse to view timing diagrams.
  4. Work with timing diagrams for sequential circuits:
    1. Explain the difference between combinational and sequential circuits.
    2. Identify the voltage for each listed input/output of a circuit at a particular time in a timing diagram.
    3. Draw the timing diagram for a clock component’s output.
    4. Draw the timing diagram for a circuit composed of clocks and basic gates.
  5. Design circuits that compute single-bit functions:
    1. Convert between truth tables, Boolean algebra expressions, and circuit diagrams.
    2. Use XOR gates to create a circuit that outputs the parity bit for a 4-bit input.
    3. Build simulated circuits in CircuitVerse based on a circuit diagram, and test that they implement a particular truth table.
  6. Work with bitwise & boolean operators in C:
    1. Identify the argument types, argument names, function name, and return type of a C function.
    2. Using limited constants and operations, and without using any control constructs, macros or helper functions, write C functions to implement simple operations on 32-bit integers.
    3. Calculate results of the C bitwise operators !, ~, &, ^, << and >> as well as normal addition (+) on paper for 8-bit signed and unsigned integers, in binary.

Stretch goals

  1. Work with timing diagrams for sequential circuits
    1. Explain what happens if you connect a NOT gate’s output to its input to form a loop.
    2. Identify AND, OR, and NOT relationships among inputs/outputs in a timing diagram.
  2. Work with bitwise & boolean operators in C:
    1. Calculate results of the C bitwise operators on paper in hexadecimal and/or decimal, for 32-bit signed and unsigned integers.
    2. Explore different operator combinations to design solutions for complex bitwise operations by combining simpler operations, including with a limited set of operators.
    3. Explain multiple strategies for designing such functions.

Reflection

Fill out the CS 240 Lab Reflection form to complete today’s lab reflection.