Due Tuesday, November 21 at 9:29 AM
By the time you have completed this work, you should be able to:
AND
, OR
, and NOT
gatesAND
, OR
, and NOT
gateslab9problems.txt
File
Using a text editor of your choice, open the lab9problems.txt
file.
The file contains a series of questions for you to answer.
The answers should be placed directly in the file itself, except where noted.
All questions must be answered correctly for full credit.
Make sure you save your answers before you exit.
The last question in lab9problems.txt
required you to write out a circuit for part of a single-bit adder (that is, a circuit that adds two individual bits together).
In this part, you will build a 2-bit ALU (that is, each operand is two bits large) with support for addition and subtraction.
To this end, you are given the component below:
The above component takes the following single-bit inputs:
A
: The first operandB
: The second operandCin
: The carry-in bitGiven the above inputs, the circuit produces the following single-bit outputs:
Cout
: The carry-out bitR
: The result bit
In making your 2-bit ALU, you may use as many of the above components as you want, along with any number of AND
, OR
, NOT
, and 2-input MUX
s.
Overall, your 2-bit ALU takes the following single-bit inputs:
Op
: Which operation is to be performed, 0
for addition and 1
for subtraction (A - B
)A0
: Bit 0 of operand A
A1
: Bit 1 of operand A
B0
: Bit 0 of operand B
B1
: Bit 1 of operand B
Given the above inputs, your ALU must produce the following outputs:
Cout
: The carry-out bitR0
: Bit 0 of the resultR1
: Bit 1 of the result
You must draw your circuit, and submit it as “lab9alu.jpg
”.
You may find the following hints helpful as part of this process:
MUX
s will simplify things.+
” components together.1
.
MUX
for each output bit.
This is straightforward, but it requires a lot of components.
+
” component, based on the value of Op
.
This requires more thinking about exactly what values are fed to the “+
” components, but the resulting circuit is much smaller.
Log into Canvas, and go to the COMP 122L class. Click “Assignments” on the left pane, then click “Lab 9”. From here, you can submit the following files:
lab9problems.txt
lab9smallmux.jpg
lab9bigmux.jpg
lab9cout.jpg
lab9alu.jpg
collaborators.txt
, if you're working with anyone else.
Each person you're working with should be listed in the file, with one person per line.
You can turn in the assignment multiple times, but only the last version you submitted will be graded.