Lab 4 Michael Kim 3/15/18 Section: 7448
Lab 4 Michael Kim 3/15/18 Section: 7448
Michael Kim
3/15/18
Section: 7448
ALU
1.
1. To add F=A NAND B, four additional NOT gates would be included where the outputs F and X are
inputted to each NOT gate respectively. For the function F=A XOR B, four additional XOR gates would be
included to each XOR gate respectively. By adding these changes to the design, there would now be 8-
input MUXes as a result of there now being 6 total inputs.
000
001
010
011
100
101
110
111
4.
a)
b)
c)
d)
e)
f)
1. To “remember” the last carry output, the carry out would be sent into a DFF.
2. To take the 2’s complement of a number loaded in Reg. A, perform the complement operation and
save the output into B. Next, perform the SUM operation of 1 and save the output into B. This will
successfully get the 2’s complement of A into B.
3. To subtract with your CPU, the number that will be subtracted must get its 2’s complement through
the same steps as in #2. Once the complement is stored into B and the first number into A, perform a
SUM operation between A and B. You must still verify your answer as a possible carry will result in a
different answer than what is expected.
4. Dividing by two will not work for all 4-bit 2’s complement numbers because a division by 2 is equal to
right shifting by one. For negative numbers in 2’s complement, this would lead to a positive result,
which is incorrect.
5. In the case where you’re not allowed to use a flip-flop that has an asynchronous CLR or SET, you can
add a function that clears the contents of either A or B by inputting a 0000 and performing an AND
operation with the values of either A or B, which will make sure that the value is cleared.
Problems Encountered
Initially, I had trouble understanding the CPU with RALU section of the lab, especially the table. After
consulting the TAs and fellow classmates, I was able to complete with chart. Also, it took me some time
to figure out the pattern generator on Waveforms.
Future Work/Applications
Given more time/ambition, I would definitely start this lab earlier, as this lab took many hours to
complete. Additionally, I would also experiment with Waveforms’ Pattern Generator and try to create
different patterns and functions using different inputs.