4-bit comparator X61860


Statement
 

pdf   zip   verilog

main.dvi
background image

Jutge.org

The Virtual Learning Environment for Computer Programming

4-bit comparator

X61860 en

Design a circuit that compares two 4-bit numbers represented in binary code and indicates

whether the first is greater than, equal to or smaller than the second.

The root module must be called cmp4.

module

cmp4(abeqgt lt );

input

[3:0] b;

output

eqgt lt ;

Hint

Design a 1-bit comparator that receives the result of the comparison of the least-significant

bits. Use four instances of this circuit.

Input

• and are the two 4-bit input numbers.

Output

• eq indicates that a=b.

• gt indicates that a

>

b.

• lt indicates that a

<

b.

Problem information

Author : Jordi Cortadella

Generation : 2013-07-17 16:31:42

© Jutge.org, 2006–2013.

http://www.jutge.org

Information
Author
Jordi Cortadella
Language
English
Official solutions
Unknown. This problem is being checked.
User solutions
Verilog