Verilog-a code for 8-3 priority encoder

Status
Not open for further replies.

Engineer4ever

Member level 3
Joined
Feb 2, 2013
Messages
67
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,748
Hi,

I am trying to design 64-6 priority encoder using verilog-a, so I started writing a code for 8-3 priority encoder for practicing as I am new to verilog-a. I tried the following code but there is a syntax error in "code=3'b000" line. How can I assign the the output of the encoder?

Code:
module priorityencoder (sel, code);
input [0:7] sel;
output [0:2] code;
electrical [0:7] sel;
electrical [0:2] code;

analog begin

if (sel[0]) begin
code=3'b000;
end 

else if (sel[1]) begin
.
.
.
.
.
endmodule


Thanks,
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…