P6: 16-bit comparator
Due
March 04, 2026 at 11:59 PM
March 04, 2026 at 11:59 PM
Goals
- Demonstrate your knowledge of basic circuit design
- Put your knowledge about binary numbers to use
Objective
This circuit will implement a 16-bit comparator. It will take in two 16-bit inputs representing unsigned binary integers and indicate if the first number is greater than, equal to or less than the second number.
Requirements
- your work must be in a file called
sixteen_bit_comp.circ - your implementation must be in the
maincircuit (you are welcome to create sub-circuits however) - your circuit must have two inputs:
AandB AandBare both 16-bit unsigned integer values- the circuit should have a 1-bit output called
gtthat will be 1 only whenAis greater thanBand 0 otherwise - the circuit should have a 1-bit output called
eqthat will be 1 only whenAis equal toBand 0 otherwise - the circuit should have a 1-bit output called
ltthat will be 1 only whenAis less thanBand 0 otherwise - you are restricted to
- input pins
- output pins
- splitters
- components in the Gates library (i.e., basic logic gates)
- you must include a text vector in a file called
comparator-test.txtthat provides sufficient tests to test the functionality of your circuit
Implementation
With 32 bits of input, it would be impractical to try to design a 16-bit comparator with a truth table. So start small. What if this a 1-bit comparator? Then recall the theme of the class: abstraction.
You may add as many subcircuits as you deem appropriate.
Submission
Upload your .circ file and test vector to Gradescope.