Stuck with verilog

Thread Starter

aceminer

Joined Aug 26, 2011
21
This is the question.
Using behavioral description, write a Verliog module that has three 8-bit inputs, a,b,c and outputs the values of the largest, max, and smallest, min, of them. Add another output, diff, that outputs the difference between the two. You should use if statement(s). You can ignore equal inputs.
Sorry but i do not really get what the question wanted.

What i have so far is this.

module Check (input [7:0] a,b,c
output [7:0] max, min)
always @*

begin
if (a > b> c)
max = a;
else if (b>a>c)
max = b;
else
max = c;

if (a<b<c)
min = a;
else if (b<a<c)
min = b;
else
min = c;

end

endmodule

-----------------------------------------------

Sorry if i seem super newbie as i am just introduced to it recently. Would appreciate any links or URLs to read up on verilog. Thanks in advance.
 
Top