Description
Problem 1: adder4.circ
Implement a 4-bit prefix adder. The adder you implement must be a prefix adder. If you implement any other adder, such as a ripple carry adder, you will not receive any points. The automated checking cannot tell the difference between adders so the TAs will look at your submission after the due date to validate that you implemented the correct type of adder. Again, if you did not, you will not receive any credit for this problem.
It should go without saying that you cannot use the builtin adder for this problem not only because it would defeat the purpose of this problem but also because it isn’t one of the generally allowed components.
Inputs
Pin | Size (in bits) | Explanation |
Ain | 4 | The A in A + B |
Bin | 4 | The B in A + B |
Cinin | 1 | The incoming carry bit |
Outputs
Pin | Size (in bits) | Explanation |
Sum_Out | 4 | The sum of A + B |
Carry_Out | 1 | The carry coming out of the most significant bit from doing A + B |
Problem 2: shifter.circ
Build a circuit that can logical/arithmetic left/right shift a value a variable amount.
Additional Components
For this problem and this problem only, you can also use
- Muxes
Inputs
Pin | Size (in bits) | Explanation |
IsRightShiftIn | 1 | If 0 do a left shift. If 1 do a right shift. |
IsArithmeticIn | 1 | If 0 do a logical shift. If 1 do an arithmetic shift |
ShiftAmountIn | 2 | How much to shift NumberIn by |
NumberIn | 3 | The bit string to shift |
Outputs
Pin | Size (in bits) | Explanation |
ShiftedNumberOut | 3 | The result of the shift performed on NumberIn |
Hints
- Don’t focus heavily on Kmaps for this problem. An easier solution can be found by thinking of this problem at a higher level
- Focus on each bit of the output one by one when trying to find an answer to this problem
- Treat the multi-bit inputs as a bunch of bits instead of as numbers
- Use muxes to solve this problem
Problem 3: bitcounter.circ
Create a circuit that counts the number of 1’s or 0’s in an 8 bit bit string.
Additional Components
For this problem and this problem only, you can also use
- All of the components under Plexers
- All of the components under Arithmetic except for Bit Adder
Inputs
Pin | Size (in bits) | Explanation |
BitsIn | 8 | The bit string whose 1’s or 0’s your circuit is to count |
CountZerosIn | 1 | If 0 count the number of 1’s in BitsIn. If 1 count the number of 0’s in BitsIn |
Outputs
Pin | Size (in bits) | Explanation |
BitCountOut | 4 | The number of 1’s/0’s in BitsIn |