Recall & Review
beginner Click to reveal answer
What is a subtractor in digital logic?
A subtractor is a digital circuit that performs subtraction of two binary numbers. It outputs the difference and borrow bits.
beginner Click to reveal answer
What is the difference between a half subtractor and a full subtractor?
A half subtractor subtracts two bits and produces a difference and borrow. A full subtractor subtracts three bits (including borrow-in) and produces difference and borrow-out.
intermediate Click to reveal answer
Write the Verilog module header for a 1-bit full subtractor.
module full_subtractor(input a, input b, input bin, output diff, output bout);
intermediate Click to reveal answer
What is the Boolean expression for the difference output in a full subtractor?
Difference (diff) = a ^ b ^ bin
intermediate Click to reveal answer
How is the borrow output (bout) calculated in a full subtractor?
Borrow out (bout) = (~a & b) | (b & bin) | (~a & bin)
Which of the following is true about a half subtractor?
✗ Incorrect
A half subtractor subtracts two bits and outputs difference and borrow.
In Verilog, which keyword is used to define a module?
✗ Incorrect
The keyword 'module' is used to define a module in Verilog.
What is the difference output of a full subtractor when inputs a=1, b=0, bin=1?
✗ Incorrect
Difference = a XOR b XOR bin = 1 XOR 0 XOR 1 = 0.
Which expression correctly represents borrow out in a full subtractor?
✗ Incorrect
Borrow out is calculated as (~a & b) | (b & bin) | (~a & bin).
What does 'bin' stand for in a full subtractor?
✗ Incorrect
'bin' stands for borrow input, the borrow from the previous subtraction.
Explain the difference between a half subtractor and a full subtractor and their typical uses.
Think about how many inputs each subtractor handles and why borrow input matters.
You got /4 concepts.
Describe how to implement a 1-bit full subtractor in Verilog including inputs, outputs, and logic expressions.
Recall the Boolean formulas for difference and borrow and how to write them in Verilog.
You got /5 concepts.
