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 LogicWorks and/or the Falstad online simulator to build and debug simulated circuits:
    1. Use the filter in the component pane of LogicWorks to find components for voltage sources, ground connections, basic gates, logic switches and logic indicators, and clocks.
    2. Use the ‘Draw’ menu in the Falstad simulator to create voltage sources, ground connections, basic gates, logic switches (inputs), and logic indicators (outputs) and clocks.
    3. Use the basic wire tool in LogicWorks to draw wires and connect components.
    4. Draw wires to connect components in the Falstad simulator using the wire tool.
    5. Use the lightning tool and/or the delete key in LogicWorks to delete wires/components.
    6. Use the delete key to delete components in the Falstad simulator.
    7. Add labels and open the timing pane in LogicWorks to view timing diagrams.
    8. Add labeled nodes and create and stack scopes nodes in the Falstad simulator to view timing diagrams.
    9. Turn on voltage indicators in LogicWorks and debug circuits to ensure they are connected properly.
    10. Read voltage colors in the Falstad simulator and debug circuits to ensure they are connected properly.
  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 LogicWorks or the Falstad simulator 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 2 Reflection form to complete today’s lab reflection.