Studio 2A


Overview

Studio sessions must be done in small groups of 2-4 people. The group work is an important part of the studio experience. You are not required to work with specific students and may adjust groups next week or when we move to a new room. We expect you to be be respectful and professional in your interactions with your peers.

Studios are time to:

  1. Explore: They are meant to provide guided exploration of ideas and skills that are critical to the subject.
  2. Practice Technical Communication: Talking about technical concepts is critical to your major/minor (and probably your future career). Intentional discussions in studio times will help prepare you for interviews and technical meetings. More importantly, it can help correct or reenforce your thinking.
  3. Be Accountable for the Team: Part of the goal is to ensure everyone learns the material. Consider yourself responsible for both your understanding and that of those you are working with. (This is also a valuable skill — you are likely train and lead others in your career).

Studios are not:

  1. Study Hall: It is not time to work on other homework or courses or to catch up on socials/videos/etc.
  2. A Free Ride: You are expected to be engaged in the work and a part of ensuring that your group explores and understands the material.
  3. A Timed Contest: There’s no need to rush through the work or even complete it. If you finish unusually early and want to leave, you may be questioned by instructors or TAs to ensure that everyone in your group has a thorough understanding of the material. If there isn’t a clear sign of effort by each individual, credit may not be given for the studio.
  4. A Time to Read/Prep: You’ll be working with others. It is important that you be prepared and unfair to them if you are not.

Studio Artifacts / Submission

Different studio sessions will have different “artifacts” due. Studios credit is not based on completion, so only submit the ones relevant to the components of the studio you complete. This week your submission should be answers to the questions below and will be submitted via Canvas. You can submit a link to a shared (public) document, like a publicly viewable Google Doc or files: PDFs (.pdf), Word documents (.doc or .docx), JLS files (.jls), text (.txt), or MarkDown (.md), zip (.zip) or a mix. Use whatever is convenient.

Be sure to include the names of everyone in your group in the submission at the top of the document. If all names are included, only one person per group needs to submit the work (but it’s ok if multiple people submit it). It is best to share the work so everyone has it for reference and future study.

Studio submissions are a record of your work in studio and will not be graded for correctness.

Artifacts for this studio

Include an answer to questions in the numbered sections in your submission. Include the relevant section number for each answer, like 1.1.

Chapter 1: Binary Basics

Binary: What’s it all mean?

A set of bits, like 10101100 has no inherent meaning. This is one reason we have data types in programming languages like Java and Python — so there are cues about how people want bits to be interpreted.

Take a look at the C Programming Language’s Data Types and indicate at least two that could perfectly fit the binary 10101100 (at least two are directly relevant to the reading). Indicate the meaning of 10101100 for each.

The Unsigned Number Line

In class we looked at a diagram of the segment of the integer number line that can be used for unsigned, 3-bit binary:

3-bit number line

4-bits

Sketch out the number line for 4-bit unsigned numbers.

$n$-bits

Consider how two $n$-bit number lines can be combined together to create a $(n+1)$-bit number line. Explain the pattern and how to take two 3-bit lines to build the 4-bit line.

The Signed Number Line

In class we drew the signed number line as a single, long line. In some ways it may help to think of “bending” that line so that half is above the bend and half is below the bend:

Bent number line

Draw the 3-bit and 4-bit number lines with the bend. Label the binary and decimal values of each point on the lines assuming it’s using two’s complement numbers.

Going negative:

Signs of negativity

One way to identify a negative 2’s complement number if via the leading (leftmost) bit. Explain how it indicates negative values and what it means in terms of the “bent number line”.

$-1$

Consider the binary representation of negative one (-1) in both examples of signed number lines. How can you describe the representation of -1 for an arbitrary $n$-bit, 2’s complement value?

Addition

As we discussed in class, we can think of addition as moving to the right on the flat number line. How would you describe the motion caused by addition on this “bent” depiction of the number line? And what happens when “adding one” to the point in the top right? And to the bottom left?

Bitwise Inversion & the bent number line

Inverting a single bit is flipping it to the complementary value: a 0 becomes a 1 and a 1 becomes a zero. Bitwise inversion of an $n$-bit number flips each individual bit. When working with equations we represent bit-wise inversion of a multi-bit value $A$ by placing a bar over it: $\bar{A}$, or in plain text with a slash in front of it to indicate the bar: /A.

Describe the “motion” that results when inverting any number on the bent number line. That is, if you start at $A$, where is $\bar{A}$? (Be sure to consider the top left and bottom right values)

Mathematical Negation

We will be emulating subtraction by adding the mathematical negation of a value. For example, we will transform $4-5$ into $4 + (-5)$, which can be thought of as $4 + (-1 \times 5)$. Another example: $4 - (-5)$ would be thought of as $4 - (-1 \times -5)$. Consequently, we need to be able to handle the concept of “$-1 \times$”.

Moving from $A$ to $-1 \times A$

Using the “bent number line” describe how to get from value $A$ to the value $-1 \times A$

Formal Equation for Mathematical Negation

What is the equation that can be used to mathematically negate a value?

Chapter 2: Gates

Tees

Although you may not find Bill’s shirt today to be a witty take on Shakespeare, he feels that it’s eventually true, no matter what. Explain what he means by this.

Simulation of the Tee

One person in your group should download and install the simulator used in class, JLS: https://github.com/bsiever/JLS/releases.

  • Intel Macs & Linux: The macOS version does not currently support Intel-based Macs. The JAR version will will run on Intel Macs (or PCs or Linux), but requires Java’s JRE 6.0 or later to be installed.
  • Apple Silicon / macOS: Different versions of macOS may require different approaches to allow you to open the file after unzipping it.

Also download this starter file: studio_2a_211.jls

Open the file in JLS and look it over. Note that:

  1. Throughout the class “ports” will be a key part of breaking complex circuits into manageable parts. Moreover, JLS requires “ports” to interact with circuits. The only two elements in the circuit are two ports.
  2. One port is highlighted because it’s being “watched”. Discuss what this means.

Now:

  1. Add in a Signal Generator (Signal Generator) and, using it, a description of a test case for this circuit. The description can be just 3 lines… or even just 10 characters on one line!
  2. Simulate the circuit (Simulator > Show Simulator Window and then the Start button). Does it clearly show that the circuit is “eventually true”?
  3. Update the test case to show that it’s “eventually true, no matter what”. I.e., that it becomes true for any initial condition that could be given.

Simple Circuits

Now download this starter file: studio_2a_22.jls (it’s empty, but please use the starter file anyway).

  1. Write out the full truth table for Figure 2.25 of the text: $Y = \bar{B} \cdot \bar{C} + A \cdot \bar{B}$ (or, in text: Y=/B*/C + A*/B).
    1. Be sure to go in a “counting order”, with the bits in the order $A$, $B$, $C$. Initially they should all be zero (false), then $C$ should be come a one (001), then $B$ should become a 1 and C should be a zero (010), etc.
    2. How many rows are needed for the table? Why? (There are three inputs. Consider the 3-bit number line)
  2. Create a circuit for the equation using JLS and the provided starter file.
  3. Create a simulation that cycles through all possible values of $A$, $B$, and $C$. Be sure your simulation accounts for the computation time (propagation delay) needed for the circuit. Again, use a “Counting Order”, with the bits in the order $A$, $B$, $C$.
  4. How does the simulation compare to your truth table? Explain any instants in time where it does not precisely match the table.
  5. What is the propagation delay (total time that may be needed) for your circuit?

Looking It Up

As has been mentioned, the concept of a “Look-Up Table” (LUT) is vital in digital logic. Explain how one can use your truth table to “lookup” the output needed.

Challenge: Simple Selection

Another (empty) starter file: studio_2a_23.jls

We’ll soon be using Multiplexers in larger circuits. Multiplexers can also have some unique behaviors that correspond to LUTs. Can you use a multiplexer (mu) to implement the above equation? You may need to use other parts, like a bundle of wires or constants (hover over parts in JLS for the help text). You should be able to use the same test-case you used before.

Submission / End-of-class

Discuss your work/findings with TAs/instructors. Submit a copy of the questions with everyone’s name at the top (at least one person should submit it, but it’s ok if everyone does).

Submission Link: Canvas