Studio 2A
Overview
Studios are:
- Must be done in small groups of 2-3 people.
- 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 as needed.
- We expect you to be be respectful and professional in your interactions with your peers.
- Credit is largely based on attendance and participation.
- Studios do NOT need to be entirely completed for credit. Often studios contain more content than can be completed during class time. Submit the completed portion during time. It’s to your benefit to complete all of it, but additional out-of-class work does not impact the credit for the studio activity itself.
Studios are time to:
- Explore: They are meant to provide guided exploration of ideas and skills that are critical to the subject.
- 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.
- 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:
- Study Hall: It is not time to work on other homework or courses or to catch up on socials/videos/etc.
- 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.
- 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.
- 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.
Studio Intent
- Create a document for your studio group’s work.
- List everyone’s name at the top.
- Review the overview above carefully. Each person in the group should add a comment to the document indicating they are aware of goals of studio time.
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:
4-bits
Sketch out the number line for 4-bit unsigned numbers.
The Signed Number Line
In class we drew the signed number line as a single, long line and as a circle/ring. 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:
Notice that the line starts with 0 in the top left (all 0’s) and ends with the maximum value, all 1’s, in the bottom left. Exactly half of the values should be on the top part and half on the bottom part.
Draw both the 3-bit and 4-bit number lines in this bent form. Label the binary and decimal values of each point on the lines assuming it’s using two’s complement numbers.
Signs of negativity
One way to identify a negative 2’s complement number is via the leading (leftmost) bit. Explain how it indicates negative values and what it means in terms of the bent number line.
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. When working with equations we represent bit-wise inversion of a value $A$ by placing a bar over it: $\overline{A}$, or in plain text, with a slash in front of it to indicate the bar: /A
. Bitwise inversion of an $n$-bit number flips each individual bit. If $A$ is an $n$-bit number, $\overline{A}$ would represent the bitwise inversion of each individual bit. For example, if $A$ is $010$, $\overline{A}$ would be $101$.
Bitwise inversion simply uses an invertor on each bit of a multi-bit value.
Look carefully your number 3-bit and 4-bit two’s complement number lines you’ve just drawn. Develop an equation that represents the mathematical relationship between $A$’s value and $\overline{A}$’s value.
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$”.
Using your work in the prior part, how can we do mathematical negation with just the two operations we already have available, negation and addition? Provide an equation of operations that emulates “$-1 \times$”.
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 (a logical tautology).
Tee’s Truth via Table
Create a truth table showing that the result of the circuit shown on the shirt will always be true. Include columns for the input, the negation of the input, and the result.
Tee’s Truth via Axioms
Which boolean Algebra axio (from class) is represented by the tee shirt? Axioms are given on slides 19-21 of Tuesday’s class)
Simulation of the Tee
Download this starter file: studio_2a_tee.jls and open it in JLS.
Open the file in JLS and look it over. Note that:
- 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.
- One port is highlighted because it’s being “watched”. Discuss what this means.
Now:
- Add in a
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!
- Simulate the circuit (
Simulator > Show Simulator Window
and then theStart
button). Does it clearly show that the circuit is “eventually true”? - 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.
JLS Simulations
JLS is a simulator and makes assumptions about values at the start of the simulations ($t=0$). Based on the last part, what assumptions does it appear to be making at $t=0$? And why is the “eventually true” a relevant statement?
More Simple Circuits
Now download this starter file: studio_2a_circuit.jls (it’s empty, but please use the starter file anyway).
- Write out the full truth table for Figure 2.25 of the text: $Y = \overline{B} \cdot \overline{C} + A \cdot \overline{B}$ (or, in text:
Y=/B*/C + A*/B
).- 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.
- How many rows are needed for the table? Why? (There are three inputs. Consider the 3-bit number line)
- Create a circuit for the equation using JLS and the provided starter file.
- 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$.
- How does the simulation compare to your truth table? Explain any instants in time where it does not precisely match the table.
- 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_lut.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 () 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
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