pete > courses > CS 202 Spring 24 > Tier 2, Phase 1, Problem 06: 16-bit comparator


Tier 2, Phase 1, Problem 06: 16-bit comparator

You will implement a 16-bit comparator, a circuit that takes two 16-bit inputs representing unsigned binary integers and tells whether the first is greater than, equal to, or less than the second. Treat bit 0 as the right-most bit, often called the "least significant bit" (LSB), and bit 15 as the left-most bit, often called the "most significant bit" (MSB).

Your test-vector.txt file will be expected to test all meaningful behavior of your circuit.

Submission Requirements

You will submit a single Logisim-Evolution circuit file and a single text file containing tests that verify your circuit’s correctness. The name of the circuit file must be comparator16.circ and the name of the test file must be test-vector.txt.

The main circuit within comparator16.circ should have two 16-bit inputs, labeled "A" and "B", respectively; and three 1-bit outputs, labeled "gt", "eq", and "lt". When A and B are interpreted as unsigned binary numbers, the "gt" output should be 1 when A is greater than B, and 0 otherwise; the "eq" output should be 1 when A is equal to B, and 0 otherwise; and the "lt" output should be 1 when A is less than B, and 0 otherwise.

You are limited to the following Logisim components (though you are not required to use them all):

You may add as many subcircuits as you deem appropriate.

Submission Instructions

Copy the comparator16.circ and test-vector.txt files to weathertop and then run:

$ 202 submit t2p1p06 comparator16.circ
$ 202 submit t2p1p06 test-vector.txt

Submissions will not be accepted after 2pm on Monday, 04 March.

Last modified: