CodiodeCodiode
Home
Problem Solving
Skill Tracks
My Assignments
Contests
Leaderboard
Community
Settings
Codiode/Problems/Combinational Logic

8-Bit Cascaded Magnitude Comparator

HardLogic CircuitBuild

Address decoding, sorting networks, and branch condition evaluation rely on wide magnitude comparators to determine the relationship between data words. Standard discrete ICs and ASIC libraries provide 4-bit comparator primitives that must be chained together to evaluate wider buses.

Construct an 8-bit magnitude comparator that compares an 8-bit unsigned input A against an 8-bit unsigned input B. The circuit must drive three outputs: GT when A is greater than B, EQ when A is equal to B, and LT when A is less than B. The lower block processes bits 3 to 0, and its outputs feed the cascade inputs of the upper block processing bits 7 to 4.

| A | B | GT | EQ | LT | |-----|-----|------|------|------| | 10 | 10 | 0 | 1 | 0 | | 10 | 9 | 1 | 0 | 0 | | 9 | 10 | 0 | 0 | 1 | | 255 | 0 | 1 | 0 | 0 |

Constraints

  • Use exactly two 4-bit magnitude comparator blocks.
  • Route the cascade outputs of the lower block into the cascade inputs of the upper block.
  • Tie the cascade inputs of the lower block to represent strict equality.

Topics

arithmeticcomparatorcascade

Solve this problem

Place the gates, wire them up and watch the signals settle. Every submission runs on the same simulation engine that grades it.

This problem is part of Codiode Pro. The statement above is free to read.

Sign in to solveSee what Pro unlocks

The circuit builder and code editor need a desktop screen. On a phone, read the problem here and open it on a laptop to solve.

Related problems

  • Binary to HexEasy
  • 1-to-4 Demultiplexer from AND and NOT GatesEasy
  • 2-to-4 Line Decoder with Active-High EnableEasy
  • Hex Nibble to BinaryEasy
  • Odd Parity Bit Generator for 3-bit DataEasy
  • Full Adder from Half AddersEasy
  • Modulo ArithmeticMedium
  • Two's Complement: Encode a Negative DecimalEasy

Browse all problems · Learning tracks